andrej spotted that entries _not_ in domain map user were being refused.
authorLuke Leighton <lkcl@samba.org>
Tue, 1 Dec 1998 18:24:23 +0000 (18:24 +0000)
committerLuke Leighton <lkcl@samba.org>
Tue, 1 Dec 1998 18:24:23 +0000 (18:24 +0000)
modified map_nt_and_unix_names() to never refuse a mapping (returns void
now not BOOL).
(This used to be commit faffcb3c8955dcea3987e2978dc34b4dba580167)

source3/smbd/reply.c

index bd238c130cc75ba6204faa99ca18165cb32fda55..169f69ee07285817b55cc822e492eff7ba3e9eb6 100644 (file)
@@ -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);