summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-11-22 18:23:24 +0100
committerJeremy Allison <jra@samba.org>2018-12-05 01:38:14 +0100
commit99695528f7453023446956d5f8f0656574e243af (patch)
tree97ba5e6e51875b0b9c6c0f2a197713e88a3db3cd /source3/param
parentcc471448df91c43fe38e2fcdf9b3874636ca51a6 (diff)
downloadsamba-99695528f7453023446956d5f8f0656574e243af.tar.gz
s3:smbd: Make sure we do not export "/" (root) as home dir
If "/" (root) is returned as the home directory, prevent exporting it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13699 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/service.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/param/service.c b/source3/param/service.c
index b21be6093d4..22f46f08894 100644
--- a/source3/param/service.c
+++ b/source3/param/service.c
@@ -149,7 +149,11 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out)
DEBUG(3,("checking for home directory %s gave %s\n",*p_service_out,
phome_dir?phome_dir:"(NULL)"));
- iService = add_home_service(*p_service_out,*p_service_out /* 'username' */, phome_dir);
+ if (!strequal(phome_dir, "/")) {
+ iService = add_home_service(*p_service_out,
+ *p_service_out, /* username */
+ phome_dir);
+ }
}
/* If we still don't have a service, attempt to add it as a printer. */