summaryrefslogtreecommitdiff
path: root/source3/lib
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
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')
-rw-r--r--source3/lib/privileges.c8
-rw-r--r--source3/lib/substitute.c3
2 files changed, 6 insertions, 5 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 */
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index b456b9b992..3fbdd2859e 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -302,13 +302,14 @@ static char * realloc_expand_env_var(char *str, char *p)
static char *longvar_domainsid( void )
{
DOM_SID sid;
+ fstring tmp;
char *sid_string;
if ( !secrets_fetch_domain_sid( lp_workgroup(), &sid ) ) {
return NULL;
}
- sid_string = SMB_STRDUP( sid_string_static( &sid ) );
+ sid_string = SMB_STRDUP( sid_to_string( tmp, &sid ) );
if ( !sid_string ) {
DEBUG(0,("longvar_domainsid: failed to dup SID string!\n"));