summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-08-28 20:59:51 +0000
committerJeremy Allison <jra@samba.org>1997-08-28 20:59:51 +0000
commit45c266baaea8755f1a3c0c4c7a87eb0752848ca2 (patch)
tree328e49877c6636904de329acbdab23c36a8cc05c
parent3909576849025ed21e5282abc892ae7582ee0275 (diff)
downloadsamba-45c266baaea8755f1a3c0c4c7a87eb0752848ca2.tar.gz
includes.h: Make sure REPLACE_GETPASS are wrapped with #ifdefs.
nmbsync.c: Make sure REPLACE_GETPASS is defined before including includes.h clientutil.c: Catch null passwords. Fixes for a nmbd crash bug found by Herb Lewis @ SGI. Jermey(jallison@whistle.com)
-rw-r--r--source/client/clientutil.c6
-rw-r--r--source/include/includes.h4
-rw-r--r--source/nmbsync.c2
3 files changed, 12 insertions, 0 deletions
diff --git a/source/client/clientutil.c b/source/client/clientutil.c
index 000cbba1a78..b4f0849c5fe 100644
--- a/source/client/clientutil.c
+++ b/source/client/clientutil.c
@@ -428,6 +428,12 @@ BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setu
else
pass = (char *)getpass("Password: ");
+ if(pass == NULL)
+ {
+ DEBUG(0, ("cli_send_login : no password available - logon failed.\n"));
+ return False;
+ }
+
if (Protocol >= PROTOCOL_LANMAN1 && use_setup)
{
fstring pword;
diff --git a/source/include/includes.h b/source/include/includes.h
index 15a5e74e469..a63f8f8597c 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -308,7 +308,9 @@ extern int innetgr (const char *, const char *, const char *, const char *);
#define USE_STATVFS
#define USE_GETCWD
#define USE_SETSID
+#ifndef REPLACE_GETPASS
#define REPLACE_GETPASS
+#endif /* REPLACE_GETPASS */
#define USE_SIGPROCMASK
#endif
@@ -459,7 +461,9 @@ char *mktemp(char *); /* No standard include */
#define NO_FSYNC
#define USE_GETCWD
#define USE_SETSID
+#ifndef REPLACE_GETPASS
#define REPLACE_GETPASS
+#endif /* REPLACE_GETPASS */
#define NO_GETRLIMIT
#endif /* CLIX */
diff --git a/source/nmbsync.c b/source/nmbsync.c
index fd85c82e2cd..f2161f631af 100644
--- a/source/nmbsync.c
+++ b/source/nmbsync.c
@@ -20,6 +20,8 @@
*/
+/* We *must have REPLACE_GETPASS defined here before the includes. */
+#define REPLACE_GETPASS
#include "includes.h"
extern int ClientNMB;