prompt for password when invoking --set-auth-user and no pw
authorGerald Carter <jerry@samba.org>
Fri, 31 Oct 2003 20:29:18 +0000 (20:29 +0000)
committerGerald Carter <jerry@samba.org>
Fri, 31 Oct 2003 20:29:18 +0000 (20:29 +0000)
is given (patch from Tom Dickson)

source/nsswitch/wbinfo.c

index 0018e99f60f83e017f227d12eaa8dd45cc7d8910..04233bb85cb5db9eb22c01228f135b81d859d90a 100644 (file)
@@ -789,8 +789,13 @@ static BOOL wbinfo_set_auth_user(char *username)
        if (password) {
                *password = 0;
                password++;
-       } else
-               password = "";
+       } else {
+               char *thepass = getpass("Password: ");
+               if (thepass) {
+                       password = thepass;     
+               } else
+                       password = "";
+       }
 
        /* Store or remove DOMAIN\username%password in secrets.tdb */