summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-10-07 15:04:48 +0000
committerAndrew Tridgell <tridge@samba.org>1996-10-07 15:04:48 +0000
commit7c135d499409d4ddedb978f681559dae90ac4288 (patch)
tree5259d03ba042d26f7b8694215e2ef243a61e669e /source
parent13c3a05093ab49908f8357017051d680dbc633eb (diff)
downloadsamba-7c135d499409d4ddedb978f681559dae90ac4288.tar.gz
samba-7c135d499409d4ddedb978f681559dae90ac4288.tar.xz
samba-7c135d499409d4ddedb978f681559dae90ac4288.zip
- revert to old idle dir code (marty pointed out a problem with the
new code) - handle server level security in the new "detect NT password length stuffups" code
Diffstat (limited to 'source')
-rw-r--r--source/include/local.h2
-rw-r--r--source/smbd/reply.c2
-rw-r--r--source/smbd/server.c3
-rw-r--r--source/smbd/uid.c10
4 files changed, 11 insertions, 6 deletions
diff --git a/source/include/local.h b/source/include/local.h
index 465e0029b6a..12d3fb9e88b 100644
--- a/source/include/local.h
+++ b/source/include/local.h
@@ -156,6 +156,6 @@
/* the directory to sit in when idle */
-#define IDLE_DIR "/"
+/* #define IDLE_DIR "/" */
#endif
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index 48a0732617e..a37c1901bea 100644
--- a/source/smbd/reply.c
+++ b/source/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/source/smbd/server.c b/source/smbd/server.c
index 5db62426ca9..2dc78e0176b 100644
--- a/source/smbd/server.c
+++ b/source/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/source/smbd/uid.c b/source/smbd/uid.c
index 9312a447a08..f7005b53cf2 100644
--- a/source/smbd/uid.c
+++ b/source/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()));