Problem with getopt() in rpcclient.c

Woodrich, Jason D (Jason) jwoodrich at
Tue Dec 11 15:27:03 GMT 2001

I made an attempt at what you suggested (converting rpcclient.c to use
popt).  I found that it's still returning -1 once it gets to the while
loop (using poptGetNextOpt in this case).  Do you know if this getopt
bug is limited to samba or if it is something that affects anything on
Solaris 2.6/SPARC using getopt()?  Or would you have any additional


Jason Woodrich
- Avaya, Inc.
- TSO eBusiness Tools Development & Lab Manager
- jwoodrich at

-----Original Message-----
From: Andrew Bartlett [mailto:abartlet at]
Sent: Friday, December 07, 2001 4:24 PM
To: Woodrich, Jason D (Jason)
Cc: samba-technical at
Subject: Re: Problem with getopt() in rpcclient.c

Did I miss the 'today is rpcclient getopt() day' or somthing?  See my
reply to the similar message on samba at  That is, getopt() may
well be broken, and a patch to convert rpcclient to popt would go down
very nicely.  (Popt is much nicer to work with, and still works when the
first argument doesn't have a - on it, or so I understand).

Send patches to samba-patches at (instructions at and I hope someone else on the team will be
able to pick it up.

Andrew Bartlett

Andrew Bartlett                                 abartlet at
Manager, Authentication Subsystems, Samba Team  abartlet at
Student Network Administrator, Hawker College   abartlet at

More information about the samba-technical mailing list