includes.h: Make sure REPLACE_GETPASS are wrapped with #ifdefs.
authorJeremy Allison <jra@samba.org>
Thu, 28 Aug 1997 20:59:51 +0000 (20:59 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 28 Aug 1997 20:59:51 +0000 (20:59 +0000)
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)

source/client/clientutil.c
source/include/includes.h
source/nmbsync.c

index 000cbba1a78b51d521d1f9f0237d8787ff1933a1..b4f0849c5fe38504cd52437f9196c03c38ab64c1 100644 (file)
@@ -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;
index 15a5e74e46971aac88f29fa076abdfd776ba422b..a63f8f8597c25d2448e65785192f310217d00847 100644 (file)
@@ -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 */
 
index fd85c82e2cd8ee94c632e62e8fc51be173d72368..f2161f631afcc1bea65975a1e9a90f6c89791e7a 100644 (file)
@@ -20,6 +20,8 @@
    
 */
 
+/* We *must have REPLACE_GETPASS defined here before the includes. */
+#define REPLACE_GETPASS
 #include "includes.h"
 
 extern int ClientNMB;