lp_set_cmdline("log level", "1");
+ popt_common_credentials_set_ignore_missing_conf();
popt_common_credentials_set_delay_post();
/* skip argv(0) */
poptGetArg(pc));
}
- if ( override_logfile )
- setup_logging( lp_logfile(talloc_tos()), DEBUG_FILE );
-
- if (!lp_load_client(get_dyn_CONFIGFILE())) {
- fprintf(stderr, "%s: Can't load %s - run testparm to debug it\n",
- argv[0], get_dyn_CONFIGFILE());
- }
-
- load_interfaces();
-
if (service_opt && service) {
size_t len;
extern struct user_auth_info *cmdline_auth_info;
+void popt_common_credentials_set_ignore_missing_conf(void);
void popt_common_credentials_set_delay_post(void);
void popt_common_credentials_post(void);
void popt_burn_cmdline_password(int argc, char *argv[]);
*/
struct user_auth_info *cmdline_auth_info;
+static bool popt_common_credentials_ignore_missing_conf;
static bool popt_common_credentials_delay_post;
+void popt_common_credentials_set_ignore_missing_conf(void)
+{
+ popt_common_credentials_delay_post = true;
+}
+
void popt_common_credentials_set_delay_post(void)
{
popt_common_credentials_delay_post = true;
}
if (reason == POPT_CALLBACK_REASON_POST) {
+ bool ok;
+
+ if (override_logfile) {
+ setup_logging(lp_logfile(talloc_tos()), DEBUG_FILE );
+ }
+
+ ok = lp_load_client(get_dyn_CONFIGFILE());
+ if (!ok) {
+ const char *pname = poptGetInvocationName(con);
+
+ fprintf(stderr, "%s: Can't load %s - run testparm to debug it\n",
+ pname, get_dyn_CONFIGFILE());
+ if (!popt_common_credentials_ignore_missing_conf) {
+ exit(1);
+ }
+ }
+
+ load_interfaces();
+
if (popt_common_credentials_delay_post) {
return;
}
char *user, *domain, *q;
const char *host;
int signing_state = SMB_SIGNING_IPC_DEFAULT;
- bool ok;
/* make sure the vars that get altered (4th field) are in
a fixed location or certain compilers complain */
popt_burn_cmdline_password(argc, argv);
rpcclient_auth_info = cmdline_auth_info;
- /* Load smb.conf file */
-
- ok = lp_load_global(get_dyn_CONFIGFILE());
- if (!ok) {
- fprintf(stderr,
- "Can't load %s - run testparm to debug it\n",
- get_dyn_CONFIGFILE());
- result = 1;
- goto done;
- }
-
nt_status = messaging_init_client(talloc_autofree_context(),
samba_tevent_context_init(talloc_autofree_context()),
&rpcclient_msg_ctx);
goto done;
}
- /* We must load interfaces after we load the smb.conf */
- load_interfaces();
-
if (!init_names()) {
result = 1;
goto done;
/* TODO */
}
- if (!lp_load_global(get_dyn_CONFIGFILE())) {
- DEBUG(0, ("ERROR loading config file...\n"));
- exit(1);
- }
-
rv = reg_open_samba3(frame, &ctx);
if (!W_ERROR_IS_OK(rv)) {
fprintf(stderr, "Unable to open registry: %s\n",
setlinebuf(stdout);
+ popt_common_credentials_set_ignore_missing_conf();
+
pc = poptGetContext("smbcacls", argc, argv_const, long_options, 0);
poptSetOtherOptionHelp(pc, "//server1/share1 filename\nACLs look like: "
return -1;
}
- lp_load_global(get_dyn_CONFIGFILE());
- load_interfaces();
-
filename = talloc_strdup(frame, poptGetArg(pc));
if (!filename) {
return -1;
static bool test_args = False;
struct cli_state *cli;
bool fix_user = False;
- bool ok;
SMB_NTQUOTA_STRUCT qt;
TALLOC_CTX *frame = talloc_stackframe();
poptContext pc;
poptFreeContext(pc);
popt_burn_cmdline_password(argc, argv);
- ok = lp_load_global(get_dyn_CONFIGFILE());
- if (!ok) {
- DBG_ERR("ERROR: Loading config file %s - "
- "run testparm to debug it\n",
- get_dyn_CONFIGFILE());
- exit(EXIT_PARSE_ERROR);
- }
-
- /* We must load interfaces after we load the smb.conf */
- load_interfaces();
-
string_replace(path, '/', '\\');
server = SMB_STRDUP(path+2);
setup_logging(argv[0], DEBUG_STDERR);
+ popt_common_credentials_set_ignore_missing_conf();
+
pc = poptGetContext("smbtree", argc, argv_const, long_options,
POPT_CONTEXT_KEEP_FIRST);
while(poptGetNextOpt(pc) != -1);
poptFreeContext(pc);
popt_burn_cmdline_password(argc, argv);
- lp_load_global(get_dyn_CONFIGFILE());
- load_interfaces();
-
/* Now do our stuff */
if (!print_tree(cmdline_auth_info)) {