Bug 2264 - On FreeBSD getopt() requires initialisation of optreset variable
Summary: On FreeBSD getopt() requires initialisation of optreset variable
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.0.10
Hardware: All FreeBSD
: P3 normal
Target Milestone: none
Assignee: Tim Potter
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-19 21:18 UTC by Timur Bakeyev
Modified: 2005-08-24 10:19 UTC (History)
0 users

See Also:


Attachments
Check, that optreset variable is declared. (647 bytes, patch)
2005-01-19 21:19 UTC, Timur Bakeyev
no flags Details
Set optreset variable in the rpcclient (363 bytes, patch)
2005-01-19 21:19 UTC, Timur Bakeyev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur Bakeyev 2005-01-19 21:18:05 UTC
Report from Rudolf Cejka <cejkar@fit.vutbr.cz> and a patch from him:

getopt(3) implementation under FreeBSD intorduces one more gloval variable, that
need to be initialized - optreset:

 extern int optreset;

     In order to use getopt() to evaluate multiple sets of arguments, or to
     evaluate a single set of arguments multiple times, the variable optreset
     must be set to 1 before the second and each additional set of calls to
     getopt(), and the variable optind must be reinitialized.

Apparently, rpcclient requires such a usage of getopt(), so the variable need to
be initialised.
Comment 1 Timur Bakeyev 2005-01-19 21:19:14 UTC
Created attachment 901 [details]
Check, that optreset variable is declared.
Comment 2 Timur Bakeyev 2005-01-19 21:19:52 UTC
Created attachment 902 [details]
Set optreset variable in the rpcclient
Comment 3 Gerald (Jerry) Carter (dead mail address) 2005-02-01 11:48:18 UTC
I'm removing that function from rpcclient since the stable interface 
is actually 'net rpc shutdown'.
Comment 4 Gerald (Jerry) Carter (dead mail address) 2005-02-07 07:34:47 UTC
originally reported against 3.0.11pre1.  Moving back to version to 3.0.10 
to remove preX and rcX versions.
Comment 5 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:19:21 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.