static void nss_wins_init(void)
{
initialised = 1;
- DEBUGLEVEL = 0;
- AllowDebugChange = False;
+ lp_set_cmdline("log level", "0");
TimeInit();
setup_logging("nss_wins",False);
/* set default debug level to 1 regardless of what smb.conf sets */
setup_logging( "smbclient", DEBUG_DEFAULT_STDERR );
- DEBUGLEVEL_CLASS[DBGC_ALL] = 1;
+ lp_set_cmdline("log level", "1");
load_case_tables();
poptGetArg(pc));
}
- /*
- * Don't load debug level from smb.conf. It should be
- * set by cmdline arg or remain default (0)
- */
- AllowDebugChange = false;
-
/* save the workgroup...
FIXME!! do we need to do this for other options as well
static char *debugf = NULL;
bool debug_warn_unknown_class = True;
bool debug_auto_add_unknown_class = True;
-bool AllowDebugChange = True;
/*
used to check if the user specified a
/* Just in case */
debug_init();
- if (AllowDebugChange == False)
- return True;
-
params = str_list_make_v3(talloc_tos(), params_str, NULL);
if (debug_parse_params(params)) {
#include "secrets.h"
#include "krb5_env.h"
-extern bool AllowDebugChange;
-
struct libnetapi_ctx *stat_ctx = NULL;
TALLOC_CTX *frame = NULL;
static bool libnetapi_initialized = false;
return W_ERROR_V(WERR_NOMEM);
}
- if (!DEBUGLEVEL) {
- DEBUGLEVEL = 0;
- }
+ lp_set_cmdline("log level", "0");
/* prevent setup_logging() from closing x_stderr... */
setup_logging("libnetapi", DEBUG_STDERR);
- AllowDebugChange = false;
-
load_case_tables();
if (!lp_load(get_dyn_CONFIGFILE(), true, false, false, false)) {
return W_ERROR_V(WERR_GENERAL_FAILURE);
}
- AllowDebugChange = true;
-
init_names();
load_interfaces();
reopen_logs();
NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx,
const char *debuglevel)
{
- AllowDebugChange = true;
ctx->debuglevel = talloc_strdup(ctx, debuglevel);
- if (!debug_parse_levels(debuglevel)) {
+ if (!lp_set_cmdline("log level", debuglevel)) {
return W_ERROR_V(WERR_GENERAL_FAILURE);
}
return NET_API_STATUS_SUCCESS;
enum {OPT_OPTION=1};
-extern bool AllowDebugChange;
extern bool override_logfile;
static void set_logfile(poptContext con, const char * arg)
case 'd':
if (arg) {
- debug_parse_levels(arg);
- AllowDebugChange = False;
+ lp_set_cmdline("log level", arg);
}
break;
#include "includes.h"
#include "popt_common.h"
-extern bool AllowDebugChange;
-
int main(int argc, const char **argv)
{
const char *config_file = get_dyn_CONFIGFILE();
TALLOC_CTX *frame = talloc_stackframe();
load_case_tables();
- DEBUGLEVEL_CLASS[DBGC_ALL] = 0;
+ lp_set_cmdline("log level", "0");
pc = poptGetContext(NULL, argc, argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
count = atoi(count_str);
}
- /* Don't let the debuglevel be changed by smb.conf. */
- AllowDebugChange = False;
-
for (i=0; i < count; i++) {
printf("call lp_load() #%d: ", i+1);
if (!lp_load_with_registry_shares(config_file,
extern char *optarg;
extern int optind;
-extern bool AllowDebugChange;
/* a test fn for LANMAN mask support */
static int ms_fnmatch_lanman_core(const char *pattern, const char *string)
setlinebuf(stdout);
- DEBUGLEVEL = 0;
- AllowDebugChange = False;
+ lp_set_cmdline("log level", "0");
if (argc < 2 || argv[1][0] == '-') {
usage();
#include "includes.h"
#include "dbwrap.h"
-extern bool AllowDebugChange;
-
typedef enum { OP_FETCH, OP_STORE, OP_DELETE, OP_ERASE, OP_LISTKEYS } dbwrap_op;
typedef enum { TYPE_INT32, TYPE_UINT32 } dbwrap_type;
int ret = 1;
load_case_tables();
- DEBUGLEVEL_CLASS[DBGC_ALL] = 0;
+ lp_set_cmdline("log level", "0");
setup_logging(argv[0], DEBUG_STDERR);
- AllowDebugChange = false;
lp_load(get_dyn_CONFIGFILE(), true, false, false, true);
if ((argc < 3) || (argc > 6)) {
#include <time.h>
#endif
-extern bool AllowDebugChange;
-
#define DEFAULT_DB_NAME "transaction.tdb"
static int timelimit = 10;
}
setup_logging(argv[0], DEBUG_STDERR);
- DEBUGLEVEL_CLASS[DBGC_ALL] = 0;
+ lp_set_cmdline("log level", "0");
pc = poptGetContext(argv[0], argc, argv, popt_options, POPT_CONTEXT_KEEP_FIRST);
}
load_case_tables();
- AllowDebugChange = false;
lp_load(get_dyn_CONFIGFILE(), true, false, false, true);
ev_ctx = tevent_context_init(mem_ctx);
#include "lib/netapi/netapi.h"
#include "../libcli/security/security.h"
-extern bool AllowDebugChange;
-
#ifdef WITH_FAKE_KASERVER
#include "utils/net_afs.h"
#endif
#endif
/* set default debug level to 0 regardless of what smb.conf sets */
- DEBUGLEVEL_CLASS[DBGC_ALL] = 0;
+ lp_set_cmdline("log level", "0");
c->private_data = net_func;
pc = poptGetContext(NULL, argc, (const char **) argv, long_options,
}
}
- /*
- * Don't load debug level from smb.conf. It should be
- * set by cmdline arg or remain default (0)
- */
- AllowDebugChange = false;
lp_load(get_dyn_CONFIGFILE(), true, false, false, true);
argv_new = (const char **)poptGetArgs(pc);
#include "includes.h"
#include "popt_common.h"
-extern bool AllowDebugChange;
-
static bool give_flags = false;
static bool use_bcast = true;
static bool got_bcast = false;
/* set default debug level to 1 regardless of what smb.conf sets */
setup_logging( "sharesec", DEBUG_STDERR);
- DEBUGLEVEL_CLASS[DBGC_ALL] = 1;
+ lp_set_cmdline("log level", "1");
pc = poptGetContext("sharesec", argc, argv, long_options, 0);
#include "rpc_client/cli_lsarpc.h"
#include "../libcli/security/security.h"
-extern bool AllowDebugChange;
-
static int test_args;
#define CREATE_ACCESS_READ READ_CONTROL_ACCESS
/* set default debug level to 1 regardless of what smb.conf sets */
setup_logging( "smbcacls", DEBUG_STDERR);
- DEBUGLEVEL_CLASS[DBGC_ALL] = 1;
- AllowDebugChange = false;
+ lp_set_cmdline("log level", "1");
setlinebuf(stdout);
/* set default debug level to 1 regardless of what smb.conf sets */
setup_logging( "smbcquotas", DEBUG_STDERR);
- DEBUGLEVEL_CLASS[DBGC_ALL] = 1;
+ lp_set_cmdline("log level", "1");
setlinebuf(stdout);
#include "secrets.h"
#include "../librpc/gen_ndr/samr.h"
-extern bool AllowDebugChange;
-
/*
* Next two lines needed for SunOS and don't
* hurt anything else...
int local_flags = 0;
int ret;
- AllowDebugChange = False;
-
#if defined(HAVE_SET_AUTH_PARAMETERS)
set_auth_parameters(argc, argv);
#endif /* HAVE_SET_AUTH_PARAMETERS */
#include "includes.h"
#include "popt_common.h"
-extern bool AllowDebugChange;
-
int main(int argc, const char *argv[])
{
const char *config_file = get_dyn_CONFIGFILE();
fprintf(stderr, "ERROR: missing sequence string\n");
return 1;
}
-
- DEBUGLEVEL = 0;
- AllowDebugChange = false;
+
+ lp_set_cmdline("log level", "0");
if (!lp_load(config_file,false,true,false,true)) {
fprintf(stderr,"Error loading services.\n");
#include "includes.h"
#include "popt_common.h"
-extern bool AllowDebugChange;
-
/*******************************************************************
Check if a directory exists.
********************************************************************/
* Allow it to be overridden by the command line,
* not by smb.conf.
*/
- DEBUGLEVEL_CLASS[DBGC_ALL] = 2;
+ lp_set_cmdline("log level", "2");
pc = poptGetContext(NULL, argc, argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
goto done;
}
- /* Don't let the debuglevel be changed by smb.conf. */
- AllowDebugChange = False;
-
fprintf(stderr,"Load smb config files from %s\n",config_file);
if (!lp_load_with_registry_shares(config_file,False,True,False,True)) {