summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/log2pcaphex.c14
-rw-r--r--source3/utils/net.c10
-rw-r--r--source3/utils/net.h8
-rw-r--r--source3/utils/nmblookup.c32
-rw-r--r--source3/utils/pdbedit.c28
-rw-r--r--source3/utils/profiles.c2
-rw-r--r--source3/utils/smbcacls.c2
-rw-r--r--source3/utils/smbcquotas.c15
-rw-r--r--source3/utils/smbtree.c2
-rw-r--r--source3/utils/status.c50
-rw-r--r--source3/utils/testparm.c4
11 files changed, 111 insertions, 56 deletions
diff --git a/source3/utils/log2pcaphex.c b/source3/utils/log2pcaphex.c
index 6f07c4f543..20cc40ca59 100644
--- a/source3/utils/log2pcaphex.c
+++ b/source3/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/source3/utils/net.c b/source3/utils/net.c
index 6cdc7f8671..068118f476 100644
--- a/source3/utils/net.c
+++ b/source3/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/source3/utils/net.h b/source3/utils/net.h
index d2deb931b8..177c6d3601 100644
--- a/source3/utils/net.h
+++ b/source3/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/source3/utils/nmblookup.c b/source3/utils/nmblookup.c
index 6d17fb7982..1a26e81206 100644
--- a/source3/utils/nmblookup.c
+++ b/source3/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/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index b87e88e406..7af417098a 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/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/source3/utils/profiles.c b/source3/utils/profiles.c
index d6094f8bae..f9b17d3dcc 100644
--- a/source3/utils/profiles.c
+++ b/source3/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/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index affebf38be..b8b29b44eb 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/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/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index 387c296385..a3d90f823b 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/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/source3/utils/smbtree.c b/source3/utils/smbtree.c
index d3c95c024c..0974039382 100644
--- a/source3/utils/smbtree.c
+++ b/source3/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/source3/utils/status.c b/source3/utils/status.c
index d5e482f6fb..8bf1de0e61 100644
--- a/source3/utils/status.c
+++ b/source3/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/source3/utils/testparm.c b/source3/utils/testparm.c
index dbfecf0a03..30e6b2f502 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -199,8 +199,8 @@ via the %%o substitution. With encrypted passwords this is not possible.\n", lp_
{
const char *config_file = dyn_CONFIGFILE;
int s;
- static bool silent_mode = False;
- static bool show_all_parameters = False;
+ static int silent_mode = False;
+ static int show_all_parameters = False;
int ret = 0;
poptContext pc;
static const char *term_code = "";