Problems with rpcclient on FreeBSD
Rudolf Cejka
cejkar at fit.vutbr.cz
Tue May 18 09:53:20 GMT 2004
Richard Sharpe wrote (2004/05/17):
> 2. Since it is likely that all of *BSD have this issue, we really should
> have a configure test that tests for the presence of optreset. The #ifdefs
> below then would be #ifdef HAVE_OPTRESET ...
Do you mean something like the following patch? Why not.
Regards.
PS: I'm still unable to log into your bugzilla, because I could not
retrieve a password - please, if you really want to use bugzilla with
registration and feedback with password via an e-mail, atleast correctly
setup dp2.samba.org server. Currently it has just direct DNS
dp2.samba.org -> 66.70.73.152, but there is missing reverse DNS
66.70.73.152 -> dp2.samba.org.
diff -ur samba-2.2.9.orig/source/configure.in samba-2.2.9/source/configure.in
--- samba-2.2.9.orig/source/configure.in Sat May 8 03:07:17 2004
+++ samba-2.2.9/source/configure.in Tue May 18 11:11:22 2004
@@ -597,6 +597,13 @@
AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE)
fi
+AC_CACHE_CHECK([for optreset], samba_cv_var_optreset, [
+ AC_TRY_LINK([#include <unistd.h>],[extern int optreset; 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)
+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 -ur samba-2.2.9.orig/source/include/config.h.in samba-2.2.9/source/include/config.h.in
--- samba-2.2.9.orig/source/include/config.h.in Sat May 8 03:07:16 2004
+++ samba-2.2.9/source/include/config.h.in Tue May 18 11:11:23 2004
@@ -67,6 +67,7 @@
#undef HAVE_VOLATILE
#undef HAVE_BROKEN_READDIR
#undef HAVE_C99_VSNPRINTF
+#undef HAVE_OPTRESET
#undef HAVE_ERRNO_DECL
#undef HAVE_LONGLONG
#undef HAVE_OFF64_T
diff -ur samba-2.2.9.orig/source/rpcclient/cmd_reg.c samba-2.2.9/source/rpcclient/cmd_reg.c
--- samba-2.2.9.orig/source/rpcclient/cmd_reg.c Sat May 8 03:07:07 2004
+++ samba-2.2.9/source/rpcclient/cmd_reg.c Tue May 18 11:11:24 2004
@@ -900,6 +900,9 @@
{
extern char *optarg;
extern int optind;
+#ifdef HAVE_OPTRESET
+ extern int optreset;
+#endif
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
fstring msg;
uint32 timeout = 20;
@@ -907,7 +910,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