summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/client/clientutil.c6
-rw-r--r--source3/include/includes.h4
-rw-r--r--source3/nmbsync.c2
3 files changed, 12 insertions, 0 deletions
diff --git a/source3/client/clientutil.c b/source3/client/clientutil.c
index 000cbba1a7..b4f0849c5f 100644
--- a/source3/client/clientutil.c
+++ b/source3/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/source3/include/includes.h b/source3/include/includes.h
index 15a5e74e46..a63f8f8597 100644
--- a/source3/include/includes.h
+++ b/source3/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/source3/nmbsync.c b/source3/nmbsync.c
index fd85c82e2c..f2161f631a 100644
--- a/source3/nmbsync.c
+++ b/source3/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;