diff options
author | Andreas Schneider <asn@samba.org> | 2016-10-05 08:22:54 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-10-06 02:30:16 +0200 |
commit | c7bcbd166d23b6ebcc2d968b76b0640b9a9beebb (patch) | |
tree | 00391259a5cde61a3db10160ac0bb5cb0041b7a0 | |
parent | fdf84713781b8ca9ec8fcbd7ca82f49713908f57 (diff) | |
download | samba-c7bcbd166d23b6ebcc2d968b76b0640b9a9beebb.tar.gz |
s3-utils: Fix loading smb.conf in smbcquotas
Pair-Programmed-With: Uri Simchoni <uri@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/utils/smbcquotas.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c index 06ecea15661..8ba3cc5f78f 100644 --- a/source3/utils/smbcquotas.c +++ b/source3/utils/smbcquotas.c @@ -582,6 +582,7 @@ int main(int argc, char *argv[]) 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; @@ -617,9 +618,6 @@ FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" }, fault_setup(); - lp_load_global(get_dyn_CONFIGFILE()); - load_interfaces(); - smbcquotas_auth_info = user_auth_info_init(frame); if (smbcquotas_auth_info == NULL) { exit(1); @@ -714,6 +712,17 @@ FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" }, 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); |