summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorAndrew Walker <awalker@ixsystems.com>2020-10-21 05:38:45 -0400
committerJeremy Allison <jra@samba.org>2020-10-22 00:30:38 +0000
commit7b52c2db264a92ea77bcb7e45e016ea03f699393 (patch)
tree0da9b7937b0e17f0267a9c75b61c1a4abceafab6 /source3/param
parent3b2a9083f8ea7758ab545ff82578ba35e1f05679 (diff)
downloadsamba-7b52c2db264a92ea77bcb7e45e016ea03f699393.tar.gz
s3:param:service - ensure registry shares loaded before home check
Registry shares should be loaded and checked prior to checking home directories. This ensures that an explicitly defined service takes priority over home directories (same behavior as non-registry shares). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14543 Signed-off-by: Andrew Walker <awalker@ixsystems.com> Reviewed-by: Jeremy Alison <jra@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Oct 22 00:30:38 UTC 2020 on sn-devel-184
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/service.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/param/service.c b/source3/param/service.c
index 09b8228daad..add6b40d619 100644
--- a/source3/param/service.c
+++ b/source3/param/service.c
@@ -129,6 +129,16 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out)
iService = lp_servicenumber(*p_service_out);
+ /*
+ * check for whether the service is a registry share before
+ * handling home directories. This is to ensure that
+ * that in the case service name is identical to a user's
+ * home directory, the explicit service is preferred.
+ */
+ if (iService < 0) {
+ iService = load_registry_service(*p_service_out);
+ }
+
/* now handle the special case of a home directory */
if (iService < 0) {
char *phome_dir = get_user_home_dir(ctx, *p_service_out);
@@ -186,10 +196,6 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out)
}
}
- if (iService < 0) {
- iService = load_registry_service(*p_service_out);
- }
-
/* Is it a usershare service ? */
if (iService < 0 && *lp_usershare_path(talloc_tos(), lp_sub)) {
/* Ensure the name is canonicalized. */