diff options
Diffstat (limited to 'source3/smbd/uid.c')
-rw-r--r-- | source3/smbd/uid.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 5a4b8a52e7..4f059bdb59 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -18,6 +18,7 @@ */ #include "includes.h" +#include "smbd/globals.h" /* what user is current? */ extern struct current_user current_user; @@ -28,13 +29,11 @@ extern struct current_user current_user; bool change_to_guest(void) { - static struct passwd *pass=NULL; + struct passwd *pass; + pass = getpwnam_alloc(talloc_autofree_context(), lp_guestaccount()); if (!pass) { - /* Don't need to free() this as its stored in a static */ - pass = getpwnam_alloc(talloc_autofree_context(), lp_guestaccount()); - if (!pass) - return(False); + return false; } #ifdef AIX @@ -49,9 +48,8 @@ bool change_to_guest(void) current_user.vuid = UID_FIELD_INVALID; TALLOC_FREE(pass); - pass = NULL; - return True; + return true; } /******************************************************************* @@ -352,16 +350,6 @@ bool unbecome_authenticated_pipe_user(void) Utility functions used by become_xxx/unbecome_xxx. ****************************************************************************/ -struct conn_ctx { - connection_struct *conn; - uint16 vuid; -}; - -/* A stack of current_user connection contexts. */ - -static struct conn_ctx conn_ctx_stack[MAX_SEC_CTX_DEPTH]; -static int conn_ctx_stack_ndx; - static void push_conn_ctx(void) { struct conn_ctx *ctx_p; |