mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
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
This commit is contained in:
parent
3b2a9083f8
commit
7b52c2db26
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user