The branch, v3-2-test has been updated
       via  793a9d24a163cb6cf5a3a0aa5ae30e9f8cf4744a (commit)
      from  36578b22f12a7de21df5a795d7702c10d19b1f3d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 793a9d24a163cb6cf5a3a0aa5ae30e9f8cf4744a
Author: Jeremy Allison <[EMAIL PROTECTED]>
Date:   Fri Oct 19 11:38:36 2007 -0700

    Fix the popt / bool issues. Some places we used BOOL
    where we meant int. Fix this. Thanks to metze for
    pointing this out.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source/nmbd/nmbd.c         |   41 ++++++++++++++++++++++++++++--------
 source/smbd/server.c       |   43 ++++++++++++++++++++++++++++---------
 source/utils/log2pcaphex.c |   14 ++++++++---
 source/utils/net.c         |   10 ++++----
 source/utils/net.h         |    8 +++---
 source/utils/nmblookup.c   |   32 ++++++++++++++++++++++------
 source/utils/pdbedit.c     |   28 ++++++++++++------------
 source/utils/profiles.c    |    2 +-
 source/utils/smbcacls.c    |    2 +-
 source/utils/smbcquotas.c  |   15 ++++++++++--
 source/utils/smbtree.c     |    2 +-
 source/utils/status.c      |   50 +++++++++++++++++++++++++++++++------------
 source/utils/testparm.c    |    4 +-
 source/web/swat.c          |    4 +-
 source/winbindd/winbindd.c |   38 ++++++++++++++++++++++++--------
 15 files changed, 205 insertions(+), 88 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index 510e676..69117ee 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -681,23 +681,31 @@ static bool open_sockets(bool isdaemon, int port)
 /**************************************************************************** 
**
  main program
  **************************************************************************** 
*/
+
  int main(int argc, const char *argv[])
 {
-       static int is_daemon;
-       static int Fork = True;
-       static int log_stdout;
+       static bool is_daemon;
+       static bool opt_interactive;
+       static bool Fork = true;
+       static bool no_process_group;
+       static bool log_stdout;
        pstring logfile;
-       static int opt_interactive;
        poptContext pc;
        static char *p_lmhosts = dyn_LMHOSTSFILE;
-       static int no_process_group = False;
        int opt;
+       enum {
+               OPT_DAEMON = 1000,
+               OPT_INTERACTIVE,
+               OPT_FORK,
+               OPT_NO_PROCESS_GROUP,
+               OPT_LOG_STDOUT
+       };
        struct poptOption long_options[] = {
        POPT_AUTOHELP
-       {"daemon", 'D', POPT_ARG_VAL, &is_daemon, True, "Become a 
daemon(default)" },
-       {"interactive", 'i', POPT_ARG_VAL, &opt_interactive, True, "Run 
interactive (not a daemon)" },
-       {"foreground", 'F', POPT_ARG_VAL, &Fork, False, "Run daemon in 
foreground (for daemontools & etc)" },
-       {"no-process-group", 0, POPT_ARG_VAL, &no_process_group, True, "Don't 
create a new process group" },
+       {"daemon", 'D', POPT_ARG_NONE, NULL, OPT_DAEMON, "Become a 
daemon(default)" },
+       {"interactive", 'i', POPT_ARG_NONE, NULL, OPT_INTERACTIVE, "Run 
interactive (not a daemon)" },
+       {"foreground", 'F', POPT_ARG_NONE, NULL, OPT_FORK, "Run daemon in 
foreground (for daemontools & etc)" },
+       {"no-process-group", 0, POPT_ARG_NONE, NULL, OPT_NO_PROCESS_GROUP, 
"Don't create a new process group" },
        {"log-stdout", 'S', POPT_ARG_VAL, &log_stdout, True, "Log to stdout" },
        {"hosts", 'H', POPT_ARG_STRING, &p_lmhosts, 'H', "Load a netbios hosts 
file"},
        {"port", 'p', POPT_ARG_INT, &global_nmb_port, NMB_PORT, "Listen on the 
specified port" },
@@ -712,6 +720,21 @@ static bool open_sockets(bool isdaemon, int port)
        pc = poptGetContext("nmbd", argc, argv, long_options, 0);
        while ((opt = poptGetNextOpt(pc)) != -1) {
                switch (opt) {
+               case OPT_DAEMON:
+                       is_daemon = true;
+                       break;
+               case OPT_INTERACTIVE:
+                       opt_interactive = true;
+                       break;
+               case OPT_FORK:
+                       Fork = false;
+                       break;
+               case OPT_NO_PROCESS_GROUP:
+                       no_process_group = true;
+                       break;
+               case OPT_LOG_STDOUT:
+                       log_stdout = true;
+                       break;
                default:
                        d_fprintf(stderr, "\nInvalid option %s: %s\n\n",
                                  poptBadOption(pc, 0), poptStrerror(opt));
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 1ae2c71..e52c2b3 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -882,24 +882,30 @@ extern void build_options(bool screen);
  int main(int argc,const char *argv[])
 {
        /* shall I run as a daemon */
-       static int is_daemon = False;
-       static int interactive = False;
-       static int Fork = True;
-       static int no_process_group = False;
-       static int log_stdout = False;
+       static bool is_daemon = False;
+       static bool interactive = False;
+       static bool Fork = True;
+       static bool no_process_group = False;
+       static bool log_stdout = False;
        static char *ports = NULL;
        static char *profile_level = NULL;
        int opt;
        poptContext pc;
        bool print_build_options = False;
-
+        enum {
+               OPT_DAEMON = 1000,
+               OPT_INTERACTIVE,
+               OPT_FORK,
+               OPT_NO_PROCESS_GROUP,
+               OPT_LOG_STDOUT
+       };
        struct poptOption long_options[] = {
        POPT_AUTOHELP
-       {"daemon", 'D', POPT_ARG_VAL, &is_daemon, True, "Become a daemon 
(default)" },
-       {"interactive", 'i', POPT_ARG_VAL, &interactive, True, "Run interactive 
(not a daemon)"},
-       {"foreground", 'F', POPT_ARG_VAL, &Fork, False, "Run daemon in 
foreground (for daemontools, etc.)" },
-       {"no-process-group", '\0', POPT_ARG_VAL, &no_process_group, True, 
"Don't create a new process group" },
-       {"log-stdout", 'S', POPT_ARG_VAL, &log_stdout, True, "Log to stdout" },
+       {"daemon", 'D', POPT_ARG_NONE, NULL, OPT_DAEMON, "Become a daemon 
(default)" },
+       {"interactive", 'i', POPT_ARG_NONE, NULL, OPT_INTERACTIVE, "Run 
interactive (not a daemon)"},
+       {"foreground", 'F', POPT_ARG_NONE, NULL, OPT_FORK, "Run daemon in 
foreground (for daemontools, etc.)" },
+       {"no-process-group", '\0', POPT_ARG_NONE, NULL, OPT_NO_PROCESS_GROUP, 
"Don't create a new process group" },
+       {"log-stdout", 'S', POPT_ARG_NONE, NULL, OPT_LOG_STDOUT, "Log to 
stdout" },
        {"build-options", 'b', POPT_ARG_NONE, NULL, 'b', "Print build options" 
},
        {"port", 'p', POPT_ARG_STRING, &ports, 0, "Listen on the specified 
ports"},
        {"profiling-level", 'P', POPT_ARG_STRING, &profile_level, 0, "Set 
profiling level","PROFILE_LEVEL"},
@@ -919,6 +925,21 @@ extern void build_options(bool screen);
        pc = poptGetContext("smbd", argc, argv, long_options, 0);
        while((opt = poptGetNextOpt(pc)) != -1) {
                switch (opt)  {
+               case OPT_DAEMON:
+                       is_daemon = true;
+                       break;
+               case OPT_INTERACTIVE:
+                       interactive = true;
+                       break;
+               case OPT_FORK:
+                       Fork = false;
+                       break;
+               case OPT_NO_PROCESS_GROUP:
+                       no_process_group = true;
+                       break;
+               case OPT_LOG_STDOUT:
+                       log_stdout = true;
+                       break;
                case 'b':
                        print_build_options = True;
                        break;
diff --git a/source/utils/log2pcaphex.c b/source/utils/log2pcaphex.c
index 6f07c4f..20cc40c 100644
--- a/source/utils/log2pcaphex.c
+++ b/source/utils/log2pcaphex.c
@@ -35,8 +35,8 @@
 
 #include <assert.h>
 
-int quiet = 0;
-int hexformat = 0;
+bool quiet = 0;
+bool hexformat = 0;
 
 #define itoa(a) ((a) < 0xa?'0'+(a):'A' + (a-0xa))
 
@@ -233,8 +233,8 @@ int main (int argc, char **argv)
        int in_packet = 0;
        struct poptOption long_options[] = {
                POPT_AUTOHELP
-               { "quiet", 'q', POPT_ARG_NONE, &quiet, 0, "Be quiet, don't 
output warnings" },
-               { "hex", 'h', POPT_ARG_NONE, &hexformat, 0, "Output format 
readable by text2pcap" },
+               { "quiet", 'q', POPT_ARG_NONE, NULL, 'q', "Be quiet, don't 
output warnings" },
+               { "hex", 'h', POPT_ARG_NONE, NULL, 'h', "Output format readable 
by text2pcap" },
                POPT_TABLEEND
        };
        
@@ -245,6 +245,12 @@ int main (int argc, char **argv)
        
        while((opt = poptGetNextOpt(pc)) != -1) {
                switch (opt) {
+               case 'q':
+                       quiet = true;
+                       break;
+               case 'h':
+                       hexformat = true;
+                       break;
                }
        }
 
diff --git a/source/utils/net.c b/source/utils/net.c
index 6cdc7f8..068118f 100644
--- a/source/utils/net.c
+++ b/source/utils/net.c
@@ -74,9 +74,9 @@ int opt_flags = -1;
 int opt_timeout = 0;
 const char *opt_target_workgroup = NULL;
 int opt_machine_pass = 0;
-bool opt_localgroup = False;
-bool opt_domaingroup = False;
-static bool do_talloc_report=False;
+int opt_localgroup = False;
+int opt_domaingroup = False;
+static int do_talloc_report=False;
 const char *opt_newntname = "";
 int opt_rid = 0;
 int opt_acls = 0;
@@ -84,9 +84,9 @@ int opt_attrs = 0;
 int opt_timestamps = 0;
 const char *opt_exclude = NULL;
 const char *opt_destination = NULL;
-bool opt_testmode = False;
+int opt_testmode = False;
 
-bool opt_have_ip = False;
+int opt_have_ip = False;
 struct in_addr opt_dest_ip;
 
 extern bool AllowDebugChange;
diff --git a/source/utils/net.h b/source/utils/net.h
index d2deb93..177c6d3 100644
--- a/source/utils/net.h
+++ b/source/utils/net.h
@@ -102,8 +102,8 @@ extern const char *opt_user_name;
 extern const char *opt_password;
 extern bool opt_user_specified;
 
-extern bool opt_localgroup;
-extern bool opt_domaingroup;
+extern int opt_localgroup;
+extern int opt_domaingroup;
 extern const char *opt_newntname;
 extern int opt_rid;
 extern int opt_acls;
@@ -111,9 +111,9 @@ extern int opt_attrs;
 extern int opt_timestamps;
 extern const char *opt_exclude;
 extern const char *opt_destination;
-extern bool opt_testmode;
+extern int opt_testmode;
 
-extern bool opt_have_ip;
+extern int opt_have_ip;
 extern struct in_addr opt_dest_ip;
 
 extern const char *share_type[];
diff --git a/source/utils/nmblookup.c b/source/utils/nmblookup.c
index 6d17fb7..1a26e81 100644
--- a/source/utils/nmblookup.c
+++ b/source/utils/nmblookup.c
@@ -30,7 +30,7 @@ static struct in_addr bcast_addr;
 static bool recursion_desired = False;
 static bool translate_addresses = False;
 static int ServerFD= -1;
-static int RootPort = False;
+static bool RootPort = False;
 static bool find_status=False;
 
 /****************************************************************************
@@ -201,14 +201,14 @@ int main(int argc,char *argv[])
   struct poptOption long_options[] = {
          POPT_AUTOHELP
          { "broadcast", 'B', POPT_ARG_STRING, NULL, 'B', "Specify address to 
use for broadcasts", "BROADCAST-ADDRESS" },
-         { "flags", 'f', POPT_ARG_VAL, &give_flags, True, "List the NMB flags 
returned" },
+         { "flags", 'f', POPT_ARG_NONE, NULL, 'f', "List the NMB flags 
returned" },
          { "unicast", 'U', POPT_ARG_STRING, NULL, 'U', "Specify address to use 
for unicast" },
-         { "master-browser", 'M', POPT_ARG_VAL, &find_master, True, "Search 
for a master browser" },
-         { "recursion", 'R', POPT_ARG_VAL, &recursion_desired, True, "Set 
recursion desired in package" },
-         { "status", 'S', POPT_ARG_VAL, &find_status, True, "Lookup node 
status as well" },
+         { "master-browser", 'M', POPT_ARG_NONE, NULL, 'M', "Search for a 
master browser" },
+         { "recursion", 'R', POPT_ARG_VAL, NULL, 'R', "Set recursion desired 
in package" },
+         { "status", 'S', POPT_ARG_VAL, NULL, 'S', "Lookup node status as 
well" },
          { "translate", 'T', POPT_ARG_NONE, NULL, 'T', "Translate IP addresses 
into names" },
-         { "root-port", 'r', POPT_ARG_VAL, &RootPort, True, "Use root port 137 
(Win95 only replies to this)" },
-         { "lookup-by-ip", 'A', POPT_ARG_VAL, &lookup_by_ip, True, "Do a node 
status on <name> as an IP Address" },
+         { "root-port", 'r', POPT_ARG_VAL, NULL, 'r', "Use root port 137 
(Win95 only replies to this)" },
+         { "lookup-by-ip", 'A', POPT_ARG_VAL, NULL, 'A', "Do a node status on 
<name> as an IP Address" },
          POPT_COMMON_SAMBA
          POPT_COMMON_CONNECTION
          { 0, 0, 0, 0 }
@@ -227,6 +227,24 @@ int main(int argc,char *argv[])
 
   while ((opt = poptGetNextOpt(pc)) != -1) {
          switch (opt) {
+         case 'f':
+                 give_flags = true;
+                 break;
+         case 'M':
+                 find_master = true;
+                 break;
+         case 'R':
+                 recursion_desired = true;
+                 break;
+         case 'S':
+                 find_status = true;
+                 break;
+         case 'r':
+                 RootPort = true;
+                 break;
+         case 'A':
+                 lookup_by_ip = true;
+                 break;
          case 'B':
                  bcast_addr = *interpret_addr2(poptGetOptArg(pc));
                  got_bcast = True;
diff --git a/source/utils/pdbedit.c b/source/utils/pdbedit.c
index b87e88e..7af4170 100644
--- a/source/utils/pdbedit.c
+++ b/source/utils/pdbedit.c
@@ -723,13 +723,13 @@ static int delete_machine_entry (struct pdb_methods *in, 
const char *machinename
 
 int main (int argc, char **argv)
 {
-       static bool list_users = False;
-       static bool verbose = False;
-       static bool spstyle = False;
-       static bool machine = False;
-       static bool add_user = False;
-       static bool delete_user = False;
-       static bool modify_user = False;
+       static int list_users = False;
+       static int verbose = False;
+       static int spstyle = False;
+       static int machine = False;
+       static int add_user = False;
+       static int delete_user = False;
+       static int modify_user = False;
        uint32  setparms, checkparms;
        int opt;
        static char *full_name = NULL;
@@ -740,10 +740,10 @@ int main (int argc, char **argv)
        static char *backend = NULL;
        static char *backend_in = NULL;
        static char *backend_out = NULL;
-       static bool transfer_groups = False;
-       static bool transfer_account_policies = False;
-       static bool reset_account_policies = False;
-       static bool  force_initialised_password = False;
+       static int transfer_groups = False;
+       static int transfer_account_policies = False;
+       static int reset_account_policies = False;
+       static int  force_initialised_password = False;
        static char *logon_script = NULL;
        static char *profile_path = NULL;
        static char *user_domain = NULL;
@@ -752,10 +752,10 @@ int main (int argc, char **argv)
        static char *user_sid = NULL;
        static long int account_policy_value = 0;
        bool account_policy_value_set = False;
-       static bool badpw_reset = False;
-       static bool hours_reset = False;
+       static int badpw_reset = False;
+       static int hours_reset = False;
        static char *pwd_time_format = NULL;
-       static bool pw_from_stdin = False;
+       static int pw_from_stdin = False;
        struct pdb_methods *bin, *bout, *bdef;
        char *configfile = NULL;
        TALLOC_CTX *frame = talloc_stackframe();
diff --git a/source/utils/profiles.c b/source/utils/profiles.c
index d6094f8..f9b17d3 100644
--- a/source/utils/profiles.c
+++ b/source/utils/profiles.c
@@ -26,7 +26,7 @@
 
 DOM_SID old_sid, new_sid;
 int change = 0, new_val = 0;
-bool opt_verbose = False;
+int opt_verbose = False;
 
 /********************************************************************
 ********************************************************************/
diff --git a/source/utils/smbcacls.c b/source/utils/smbcacls.c
index affebf3..b8b29b4 100644
--- a/source/utils/smbcacls.c
+++ b/source/utils/smbcacls.c
@@ -32,7 +32,7 @@ static TALLOC_CTX *ctx;
 
 /* numeric is set when the user wants numeric SIDs and ACEs rather
    than going via LSA calls to resolve them */
-static bool numeric = False;
+static int numeric = False;
 
 enum acl_mode {SMB_ACL_SET, SMB_ACL_DELETE, SMB_ACL_MODIFY, SMB_ACL_ADD };
 enum chown_mode {REQUEST_NONE, REQUEST_CHOWN, REQUEST_CHGRP};
diff --git a/source/utils/smbcquotas.c b/source/utils/smbcquotas.c
index 387c296..a3d90f8 100644
--- a/source/utils/smbcquotas.c
+++ b/source/utils/smbcquotas.c
@@ -413,9 +413,9 @@ SETSTRING:\n\
 UQLIM:<username>/<softlimit>/<hardlimit> for user quotas\n\
 FSQLIM:<softlimit>/<hardlimit> for filesystem defaults\n\
 FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" },
-               { "numeric", 'n', POPT_ARG_NONE, &numeric, True, "Don't resolve 
sids or limits to names" },
-               { "verbose", 'v', POPT_ARG_NONE, &verbose, True, "be verbose" },
-               { "test-args", 't', POPT_ARG_NONE, &test_args, True, "Test 
arguments"},
+               { "numeric", 'n', POPT_ARG_NONE, NULL, 'n', "Don't resolve sids 
or limits to names" },
+               { "verbose", 'v', POPT_ARG_NONE, NULL, 'v', "be verbose" },
+               { "test-args", 't', POPT_ARG_NONE, NULL, 'r', "Test arguments"},
                POPT_COMMON_SAMBA
                POPT_COMMON_CREDENTIALS
                { NULL }
@@ -444,6 +444,15 @@ 
FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" },
 
        while ((opt = poptGetNextOpt(pc)) != -1) {
                switch (opt) {
+               case 'n':
+                       numeric = true;
+                       break;
+               case 'v':
+                       verbose = true;
+                       break;
+               case 't':
+                       test_args = true;
+                       break;
                case 'L':
                        if (todo != 0) {
                                d_printf("Please specify only one option of 
<-L|-F|-S|-u>\n");
diff --git a/source/utils/smbtree.c b/source/utils/smbtree.c
index d3c95c0..0974039 100644
--- a/source/utils/smbtree.c
+++ b/source/utils/smbtree.c
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 
-static bool use_bcast;
+static int use_bcast;
 
 /* How low can we go? */
 
diff --git a/source/utils/status.c b/source/utils/status.c
index d5e482f..8bf1de0 100644
--- a/source/utils/status.c
+++ b/source/utils/status.c
@@ -38,12 +38,12 @@ static struct server_id     Ucrit_pid[SMB_MAXPIDS];  /* 
Ugly !!! */   /* added by OH
 static int             Ucrit_MaxPid=0;                    /* added by OH */
 static unsigned int    Ucrit_IsActive = 0;                /* added by OH */
 
-static int verbose, brief;
-static int            shares_only = 0;            /* Added by RJS */
-static int            locks_only  = 0;            /* Added by RJS */
-static bool processes_only=False;
-static int show_brl;
-static bool numeric_only = False;
+static bool verbose, brief;
+static bool shares_only;            /* Added by RJS */
+static bool locks_only;            /* Added by RJS */
+static bool processes_only;
+static bool show_brl;
+static bool numeric_only;
 
 const char *username = NULL;
 
@@ -281,16 +281,16 @@ static int traverse_sessionid(struct db_record *db, void 
*state)
        poptContext pc;
        struct poptOption long_options[] = {
                POPT_AUTOHELP
-               {"processes",   'p', POPT_ARG_NONE,     &processes_only, 'p', 
"Show processes only" },
-               {"verbose",     'v', POPT_ARG_NONE, &verbose, 'v', "Be verbose" 
},
-               {"locks",       'L', POPT_ARG_NONE,     &locks_only, 'L', "Show 
locks only" },
-               {"shares",      'S', POPT_ARG_NONE,     &shares_only, 'S', 
"Show shares only" },
+               {"processes",   'p', POPT_ARG_NONE,     NULL, 'p', "Show 
processes only" },
+               {"verbose",     'v', POPT_ARG_NONE,     NULL, 'v', "Be verbose" 
},
+               {"locks",       'L', POPT_ARG_NONE,     NULL, 'L', "Show locks 
only" },
+               {"shares",      'S', POPT_ARG_NONE,     NULL, 'S', "Show shares 
only" },
                {"user",        'u', POPT_ARG_STRING,   &username, 'u', "Switch 
to user" },
-               {"brief",       'b', POPT_ARG_NONE,     &brief, 'b', "Be brief" 
},
+               {"brief",       'b', POPT_ARG_NONE,     NULL, 'b', "Be brief" },
                {"profile",     'P', POPT_ARG_NONE, NULL, 'P', "Do profiling" },
                {"profile-rates", 'R', POPT_ARG_NONE, NULL, 'R', "Show call 
rates" },
-               {"byterange",   'B', POPT_ARG_NONE,     &show_brl, 'B', 
"Include byte range locks"},
-               {"numeric",     'n', POPT_ARG_NONE,     &numeric_only, 'n', 
"Numeric uid/gid"},
+               {"byterange",   'B', POPT_ARG_NONE,     NULL, 'B', "Include 
byte range locks"},
+               {"numeric",     'n', POPT_ARG_NONE,     NULL, 'n', "Numeric 
uid/gid"},
                POPT_COMMON_SAMBA
                POPT_TABLEEND
        };
@@ -315,12 +315,34 @@ static int traverse_sessionid(struct db_record *db, void 
*state)
        
        while ((c = poptGetNextOpt(pc)) != -1) {
                switch (c) {
-               case 'u':                                      
+               case 'p':
+                       processes_only = true;
+                       break;
+               case 'v':
+                       verbose = true;
+                       break;
+               case 'L':
+                       locks_only = true;
+                       break;
+               case 'S':
+                       shares_only = true;
+                       break;
+               case 'b':
+                       brief = true;
+                       break;
+               case 'u':
                        Ucrit_addUid(nametouid(poptGetOptArg(pc)));
                        break;
                case 'P':
                case 'R':
                        profile_only = c;
+                       break;
+               case 'B':
+                       show_brl = true;
+                       break;
+               case 'n':
+                       numeric_only = true;
+                       break;
                }
        }
 
diff --git a/source/utils/testparm.c b/source/utils/testparm.c
index dbfecf0..30e6b2f 100644


-- 
Samba Shared Repository

Reply via email to