summaryrefslogtreecommitdiff
path: root/source3/lib/privileges.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-15 22:00:39 +0100
committerVolker Lendecke <vl@samba.org>2007-12-15 22:09:37 +0100
commit14ef4cdec1ab6be55c97d0f32780cbddbcdde218 (patch)
treee7cb94297496f758a7935aaec62c7dd772e96f3a /source3/lib/privileges.c
parentd899b8c56ad6556baf2d2374704cc8cd1b15d5ad (diff)
downloadsamba-14ef4cdec1ab6be55c97d0f32780cbddbcdde218.tar.gz
samba-14ef4cdec1ab6be55c97d0f32780cbddbcdde218.tar.bz2
samba-14ef4cdec1ab6be55c97d0f32780cbddbcdde218.zip
Replace sid_string_static with sid_to_string
This adds 28 fstrings on the stack, but I think an fstring on the stack is still far better than a static one. (This used to be commit c7c885078be8fd3024c186044ac28275d7609679)
Diffstat (limited to 'source3/lib/privileges.c')
-rw-r--r--source3/lib/privileges.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/privileges.c b/source3/lib/privileges.c
index 3e2c756849..9f155acd8b 100644
--- a/source3/lib/privileges.c
+++ b/source3/lib/privileges.c
@@ -40,7 +40,7 @@ typedef struct {
static bool get_privileges( const DOM_SID *sid, SE_PRIV *mask )
{
TDB_CONTEXT *tdb = get_account_pol_tdb();
- fstring keystr;
+ fstring tmp, keystr;
TDB_DATA data;
/* Fail if the admin has not enable privileges */
@@ -54,7 +54,7 @@ static bool get_privileges( const DOM_SID *sid, SE_PRIV *mask )
/* PRIV_<SID> (NULL terminated) as the key */
- fstr_sprintf( keystr, "%s%s", PRIVPREFIX, sid_string_static(sid) );
+ fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_string(tmp, sid));
data = tdb_fetch_bystring( tdb, keystr );
@@ -79,7 +79,7 @@ static bool get_privileges( const DOM_SID *sid, SE_PRIV *mask )
static bool set_privileges( const DOM_SID *sid, SE_PRIV *mask )
{
TDB_CONTEXT *tdb = get_account_pol_tdb();
- fstring keystr;
+ fstring tmp, keystr;
TDB_DATA data;
if ( !lp_enable_privileges() )
@@ -95,7 +95,7 @@ static bool set_privileges( const DOM_SID *sid, SE_PRIV *mask )
/* PRIV_<SID> (NULL terminated) as the key */
- fstr_sprintf( keystr, "%s%s", PRIVPREFIX, sid_string_static(sid) );
+ fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_string(tmp, sid));
/* no packing. static size structure, just write it out */