From 1410803713440caf29a40aec30516489d1944665 Mon Sep 17 00:00:00 2001 From: Vinit Agnihotri Date: Tue, 3 Dec 2024 11:21:09 +0530 Subject: [PATCH] sharesec: Check if share exists in configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Load config from registry without share info and check if sharename exists from configuration. This results into lesser delay for the same. In case of view we load config with all shares to ensure we get all shares for diplay purpose. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15780 Signed-off-by: Vinit Agnihotri Reviewed-by: John Mulligan Reviewed-by: Guenther Deschner Autobuild-User(master): Günther Deschner Autobuild-Date(master): Fri Jan 10 10:45:30 UTC 2025 on atb-devel-224 --- source3/utils/sharesec.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c index 6094746e3cc..47182894a66 100644 --- a/source3/utils/sharesec.c +++ b/source3/utils/sharesec.c @@ -409,7 +409,6 @@ int main(int argc, const char *argv[]) static char *the_acl = NULL; fstring sharename; bool force_acl = False; - int snum; poptContext pc; bool initialize_sid = False; bool ok; @@ -604,7 +603,10 @@ int main(int argc, const char *argv[]) setlinebuf(stdout); - lp_load_with_registry_shares(get_dyn_CONFIGFILE()); + if (mode == SMB_ACL_VIEW_ALL) + lp_load_with_registry_shares(get_dyn_CONFIGFILE()); + else + lp_load_with_registry_without_shares(get_dyn_CONFIGFILE()); /* check for initializing secrets.tdb first */ @@ -631,7 +633,6 @@ int main(int argc, const char *argv[]) if (mode == SMB_ACL_VIEW_ALL) { int i; - for (i=0; i