diff options
-rw-r--r-- | source3/smbd/reply.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index bd238c130c..169f69ee07 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -63,7 +63,7 @@ static void overflow_attack(int len) /**************************************************************************** does _both_ nt->unix and unix->unix username remappings. ****************************************************************************/ -static BOOL map_nt_and_unix_username(const char *domain, char *user) +static void map_nt_and_unix_username(const char *domain, char *user) { DOM_NAME_MAP gmep; fstring nt_username; @@ -83,13 +83,12 @@ static BOOL map_nt_and_unix_username(const char *domain, char *user) { fstrcpy(nt_username, user); } - if (!lookupsmbpwntnam(nt_username, &gmep)) + + if (lookupsmbpwntnam(nt_username, &gmep)) { - return False; + fstrcpy(user, gmep.unix_name); } - fstrcpy(user, gmep.unix_name); - /* * Pass the user through the unix -> unix user mapping * function. @@ -100,7 +99,7 @@ static BOOL map_nt_and_unix_username(const char *domain, char *user) /* * Do any UNIX username case mangling. */ - return Get_Pwnam( user, True) != NULL; + (void)Get_Pwnam( user, True); } /**************************************************************************** @@ -665,10 +664,7 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int pstrcpy( orig_user, user); - if (!map_nt_and_unix_username(domain, user)) - { - return(ERROR(ERRSRV,ERRbadpw)); - } + map_nt_and_unix_username(domain, user); add_session_user(user); |