[patch] rpcclient doesn't return non-zero on error

Michael Sweet mike at easysw.com
Fri Jul 27 15:55:51 GMT 2001


The attached patch fixes an annoying little problem with rpcclient -
if you specify "-N" so that it doesn't ask for a password, the
session setup will fail and rpcclient returns 0 instead of 1.  This
means that another program (e.g. a GUI or a wrapper) cannot determine
if rpcclient needs a password or not...

This patch makes rpcclient return 1 like smbclient does for the
same situation...

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products                  mike at easysw.com
Printing Software for UNIX                       http://www.easysw.com
-------------- next part --------------
Index: rpcclient.c
===================================================================
RCS file: /cvsroot/samba/source/rpcclient/rpcclient.c,v
retrieving revision 1.120.4.14
diff -u -r1.120.4.14 rpcclient.c
--- rpcclient.c	31 May 2001 18:34:57 -0000	1.120.4.14
+++ rpcclient.c	27 Jul 2001 15:48:03 -0000
@@ -648,7 +648,7 @@
 	/* open a connection to the specified server */
 	ZERO_STRUCTP (&cli);
 	if (!setup_connection (&cli, server, &creds)) {
-		return 0;
+		return 1;
 	}
 	
 	/* There are no pointers in ntuser_creds struct so zero it out */


More information about the samba-technical mailing list