Problems with rpcclient on FreeBSD

Rudolf Cejka cejkar at fit.vutbr.cz
Thu May 20 13:06:21 GMT 2004


Richard Sharpe wrote (2004/05/19):
> Hmmm, I have just noticed that this is a patch to 2.2.9. We are only doing
> updates to 2.2.9 for security reasons, as all users really should be using
> 3.0.x.

Below is patch for 3.0.4.

> I am not sure I will apply this patch after all.

Atleast for history purposes, so that broken things are solved
and documented?

diff -urN samba-3.0.4.orig/source/configure.in samba-3.0.4/source/configure.in
--- samba-3.0.4.orig/source/configure.in	Thu Apr 29 09:34:48 2004
+++ samba-3.0.4/source/configure.in	Thu May 20 14:16:15 2004
@@ -800,6 +800,13 @@
    AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
 fi
 
+AC_CACHE_CHECK([for optreset], samba_cv_var_optreset, [
+  AC_TRY_LINK([#include <unistd.h>],[optreset = 1],
+  [samba_cv_var_optreset=yes],[samba_cv_var_optreset=no])])
+if test x"$samba_cv_var_optreset" = x"yes"; then
+  AC_DEFINE(HAVE_OPTRESET,1,[Whether the system has optreset])
+fi
+
 # stupid headers have the functions but no declaration. grrrr.
 AC_HAVE_DECL(errno, [#include <errno.h>])
 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
diff -urN samba-3.0.4.orig/source/include/config.h.in samba-3.0.4/source/include/config.h.in
--- samba-3.0.4.orig/source/include/config.h.in	Sat May  8 02:33:46 2004
+++ samba-3.0.4/source/include/config.h.in	Thu May 20 14:17:44 2004
@@ -236,6 +236,9 @@
 /* Define to 1 if you have the `endnetgrent' function. */
 #undef HAVE_ENDNETGRENT
 
+/* Whether optreset is available */
+#undef HAVE_OPTRESET
+
 /* Whether errno() is available */
 #undef HAVE_ERRNO_DECL
 
diff -urN samba-3.0.4.orig/source/rpcclient/cmd_reg.c samba-3.0.4/source/rpcclient/cmd_reg.c
--- samba-3.0.4.orig/source/rpcclient/cmd_reg.c	Sun Apr  4 09:37:28 2004
+++ samba-3.0.4/source/rpcclient/cmd_reg.c	Thu May 20 14:18:36 2004
@@ -905,7 +905,11 @@
 	int opt;
 
 	*msg = 0;
-	optind = 0; /* TODO: test if this hack works on other systems too --simo */
+#ifdef HAVE_OPTRESET
+	optreset = optind = 1;
+#else
+	optind = 0;
+#endif
 
 	while ((opt = getopt(argc, argv, "m:t:rf")) != EOF)
 	{
-- 
Rudolf Cejka <cejkar at fit.vutbr.cz> http://www.fit.vutbr.cz/~cejkar
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, 612 66  Brno, Czech Republic


More information about the samba-technical mailing list