diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-10-29 15:29:09 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-11-02 04:36:04 +0000 |
commit | d9f67eebf621adacf5514c7ba1ed17b4953db762 (patch) | |
tree | d47933d295d9291c0711bb6c103c7c365c685d49 /source3 | |
parent | cf4de8ec2c8df2ceabbe3d836d296b058e7b19fb (diff) | |
download | samba-d9f67eebf621adacf5514c7ba1ed17b4953db762.tar.gz samba-d9f67eebf621adacf5514c7ba1ed17b4953db762.tar.bz2 samba-d9f67eebf621adacf5514c7ba1ed17b4953db762.zip |
s3-debug Remove last direct assignements to DEBUGLEVEL
All future assignments of the debug level should go via
lp_set_cmdline("log level", "x") because this will ensure the value is
not overwritten in an smb.conf load.
Andrew Bartlett
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/libsmb_setget.c | 4 | ||||
-rw-r--r-- | source3/rpcclient/rpcclient.c | 2 | ||||
-rw-r--r-- | source3/torture/masktest.c | 2 | ||||
-rw-r--r-- | source3/torture/torture.c | 2 | ||||
-rw-r--r-- | source3/torture/vfstest.c | 2 | ||||
-rw-r--r-- | source3/utils/smbpasswd.c | 2 |
6 files changed, 8 insertions, 6 deletions
diff --git a/source3/libsmb/libsmb_setget.c b/source3/libsmb/libsmb_setget.c index 20835781ec..f2f5aec6c4 100644 --- a/source3/libsmb/libsmb_setget.c +++ b/source3/libsmb/libsmb_setget.c @@ -90,8 +90,10 @@ smbc_getDebug(SMBCCTX *c) void smbc_setDebug(SMBCCTX *c, int debug) { + char buf[32]; + snprintf(buf, sizeof(buf), "%d", debug); c->debug = debug; - DEBUGLEVEL = debug; + lp_set_cmdline("log level", buf); } /** diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index a98f500e62..707889a44f 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -324,7 +324,7 @@ static NTSTATUS cmd_debuglevel(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, } if (argc == 2) { - DEBUGLEVEL = atoi(argv[1]); + lp_set_cmdline("log level", argv[1]); } printf("debuglevel is %d\n", DEBUGLEVEL); diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c index 335bc4ca22..1fc46b9c28 100644 --- a/source3/torture/masktest.c +++ b/source3/torture/masktest.c @@ -515,7 +515,7 @@ static void usage(void) NumLoops = atoi(optarg); break; case 'd': - DEBUGLEVEL = atoi(optarg); + lp_set_cmdline("log level", optarg); break; case 'E': die_on_error = 1; diff --git a/source3/torture/torture.c b/source3/torture/torture.c index bc4b58be73..161c6f9a64 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -8009,7 +8009,7 @@ static void usage(void) torture_numops = atoi(optarg); break; case 'd': - DEBUGLEVEL = atoi(optarg); + lp_set_cmdline("log level", optarg); break; case 'O': sockops = optarg; diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index 3b0ec54564..3ebe63ee53 100644 --- a/source3/torture/vfstest.c +++ b/source3/torture/vfstest.c @@ -188,7 +188,7 @@ static NTSTATUS cmd_debuglevel(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a } if (argc == 2) { - DEBUGLEVEL = atoi(argv[1]); + lp_set_cmdline("log level", argv[1]); } printf("debuglevel is %d\n", DEBUGLEVEL); diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index c530c78f41..b4e8b19f1f 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -152,7 +152,7 @@ static int process_options(int argc, char **argv, int local_flags) lp_set_name_resolve_order(optarg); break; case 'D': - DEBUGLEVEL = atoi(optarg); + lp_set_cmdline("log level", optarg); break; case 'U': { got_username = True; |