- Teach rpcclient to recognize parameters in -c <command> correctly, ie.:

rpcclient -c "shutdown -r" <host>

PR:		ports/66746
Submitted by:	Rudolf Cejka <cejkar@fit.vutbr.cz>
This commit is contained in:
Pav Lucistnik 2004-05-25 08:17:45 +00:00
parent 3cae33902c
commit 562781456c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=109939
2 changed files with 25 additions and 0 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= samba
PORTVERSION= 2.2.9
PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SAMBA}
MASTER_SITE_SUBDIR= . old-versions

View file

@ -0,0 +1,24 @@
--- source/rpcclient/cmd_reg.c.orig Thu Nov 27 12:17:08 2003
+++ source/rpcclient/cmd_reg.c Thu Nov 27 12:19:24 2003
@@ -900,6 +900,9 @@
{
extern char *optarg;
extern int optind;
+#if defined(__FreeBSD__)
+ extern int optreset;
+#endif
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
fstring msg;
uint32 timeout = 20;
@@ -907,7 +910,11 @@
int opt;
*msg = 0;
+#if defined(__FreeBSD__)
+ optreset = optind = 1;
+#else
optind = 0; /* TODO: test if this hack works on other systems too --simo */
+#endif
while ((opt = getopt(argc, argv, "m:t:rf")) != EOF)
{