[Samba] PATCH to Samba 3.0.0 to allow interactive --set-auth-user for wbinfo

Tom Dickson tdickson at inostor.com
Tue Oct 21 19:50:18 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This patch is against samba-3.0.0beta3 (tested), but will also apply
correctly to 3.0.0 (release)

It makes wbinfo ask for a password if there is no password on the
command line.

So:

wbinfo --set-auth-user=Administrator

Will make it prompt

Password:

This is to make it easier to script wbinfo for nas appliances using
expect to allow passwords with characters that bash doesn't like: '!*\,%
etc. This also prevents the password from being seen by ps auwx which
some may consider to be a security risk.

- -Tom Dickson
InoStor Corporation
13000 Gregg St
Poway, CA 92064-7151
www.inostor.com
858-726-1846

<TEXT OF PATCH>
- --- samba-3.0.0beta3/source/nsswitch/wbinfo.c    Wed Jul 16 06:24:00 2003
+++ samba-nuevo/source/nsswitch/wbinfo.c    Fri Aug 29 13:50:06 2003
@@ -756,8 +756,13 @@
~    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 */
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-nr2 (Windows 2000)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/lY362dxAfYNwANIRAtbrAJ9gogFU66QF0DVufktDP4EYWGJnowCdHPHn
2y4pn9rzg+Gzs/CdPGxq4U8=
=aJVk
-----END PGP SIGNATURE-----
-------------- next part --------------
--- samba-3.0.0beta3/source/nsswitch/wbinfo.c	Wed Jul 16 06:24:00 2003
+++ samba-nuevo/source/nsswitch/wbinfo.c	Fri Aug 29 13:50:06 2003
@@ -756,8 +756,13 @@
 	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 */
 


More information about the samba mailing list