diff options
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/reply.c | 2 | ||||
-rw-r--r-- | source3/smbd/server.c | 3 | ||||
-rw-r--r-- | source3/smbd/uid.c | 10 |
3 files changed, 10 insertions, 5 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 48a0732617..a37c1901be 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -372,7 +372,7 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize) if passlen1>0 and passlen2>0 then its a NT box and its setting passlen2 to some random value which really stuffs things up. we need to fix that one. */ - if (passlen1 > 0 && passlen2 > 0) { + if (passlen1 > 0 && passlen2 > 0 && passlen2 != 24) { passlen2 = 0; } /* we use the first password that they gave */ diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 5db62426ca..2dc78e0176 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -67,6 +67,7 @@ static int num_connections_open = 0; extern fstring remote_machine; +pstring OriginalDir; /* these can be set by some functions to override the error codes */ int unix_ERR_class=SUCCESS; @@ -3618,6 +3619,8 @@ static void usage(char *pname) so set our umask to 0 */ umask(0); + GetWd(OriginalDir); + init_uid(); /* this is for people who can't start the program correctly */ diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 9312a447a0..f7005b53cf 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -31,6 +31,8 @@ static int initial_gid; /* what user is current? */ struct current_user current_user; +extern pstring OriginalDir; + /**************************************************************************** initialise the uid routines ****************************************************************************/ @@ -54,7 +56,7 @@ void init_uid(void) current_user.cnum = -1; - ChDir(IDLE_DIR); + ChDir(OriginalDir); } @@ -280,7 +282,7 @@ BOOL unbecome_user(void ) if (current_user.cnum == -1) return(False); - ChDir(IDLE_DIR); + ChDir(OriginalDir); if (initial_uid == 0) { @@ -317,9 +319,9 @@ BOOL unbecome_user(void ) current_user.uid = initial_uid; current_user.gid = initial_gid; - if (ChDir(IDLE_DIR) != 0) + if (ChDir(OriginalDir) != 0) DEBUG(0,("%s chdir(%s) failed in unbecome_user\n", - timestring(),IDLE_DIR)); + timestring(),OriginalDir)); DEBUG(5,("unbecome_user now uid=(%d,%d) gid=(%d,%d)\n", getuid(),geteuid(),getgid(),getegid())); |