[PATCH] smbcquotas: fix initialization order

Uri Simchoni uri at samba.org
Wed Oct 5 12:03:29 UTC 2016


Hi,

This fixes make test when the system smb.conf contains "winbind
separator = +".

Review and push appreciated.
Thanks,
Uri
-------------- next part --------------
From 13f2f18ed67493b75adabeeb9c90463d4809951b Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri at samba.org>
Date: Wed, 5 Oct 2016 10:45:35 +0300
Subject: [PATCH v2] smbcquotas: fix initialization order

Load smb.conf only after the command line has been processed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12364

Signed-off-by: Uri Simchoni <uri at samba.org>
---
 source3/utils/smbcquotas.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index 06ecea1..4d0d511 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -617,9 +617,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 +711,13 @@ FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" },
 	poptFreeContext(pc);
 	popt_burn_cmdline_password(argc, argv);
 
+	if (!lp_load_global(get_dyn_CONFIGFILE())) {
+		DEBUG(0, ("ERROR loading config file...\n"));
+		exit(1);
+	}
+
+	load_interfaces();
+
 	string_replace(path, '/', '\\');
 
 	server = SMB_STRDUP(path+2);
-- 
2.5.5



More information about the samba-technical mailing list