From: Tim Potter Date: Wed, 5 Nov 2003 17:32:38 +0000 (+0000) Subject: Merge of setenv->putenv for winbind client. X-Git-Tag: release-3-0-1~21^2~27 X-Git-Url: http://git.samba.org/samba.git/?p=tprouty%2Fsamba.git;a=commitdiff_plain;h=a26d425f93e43641195d0aaf0f9ce5ef0e69f5e1 Merge of setenv->putenv for winbind client. --- diff --git a/source/nsswitch/wb_common.c b/source/nsswitch/wb_common.c index f146391653..40221b69fe 100644 --- a/source/nsswitch/wb_common.c +++ b/source/nsswitch/wb_common.c @@ -472,17 +472,23 @@ NSS_STATUS winbindd_request(int req_type, } /************************************************************************* - A couple of simple jfunctions to disable winbindd lookups and re- + A couple of simple functions to disable winbindd lookups and re- enable them ************************************************************************/ +/* Use putenv() instead of setenv() in these functions as not all + environments have the latter. */ + BOOL winbind_off( void ) { - return (setenv( WINBINDD_DONT_ENV, "1", 1 ) != -1); + static char *s = WINBINDD_DONT_ENV "=1"; + + return putenv(s) != -1; } BOOL winbind_on( void ) { - return (setenv( WINBINDD_DONT_ENV, "0", 1 ) != -1); -} + static char *s = WINBINDD_DONT_ENV "=0"; + return putenv(s) != -1; +}