From: Jeremy Allison Date: Tue, 7 Apr 2020 00:36:44 +0000 (-0700) Subject: s3: smbd: Always call canonicalize_connect_path() for a share. X-Git-Tag: ldb-2.2.0~929 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78a25320dcef958cb6515599275ae47ccba55e40;p=thirdparty%2Fsamba.git s3: smbd: Always call canonicalize_connect_path() for a share. Share path definitions don't need to be aware of symlinks. This is strictly a change in behavior, but the vfs_widelinks module (if loaded) copes with symlinks in the share definition. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 4de36bf6ff9..3249c660983 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -535,6 +535,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn, uid_t effuid; gid_t effgid; NTSTATUS status; + bool ok; fstrcpy(dev, pdev); @@ -796,21 +797,20 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn, /* ROOT Activites: */ /* - * If widelinks are disallowed we need to canonicalise the connect + * Canonicalise the connect * path here to ensure we don't have any symlinks in the * connectpath. We will be checking all paths on this connection are * below this directory. We must do this after the VFS init as we * depend on the realpath() pointer in the vfs table. JRA. */ - if (!lp_widelinks(snum)) { - if (!canonicalize_connect_path(conn)) { - DBG_ERR("canonicalize_connect_path failed " - "for service %s, path %s\n", - lp_const_servicename(snum), - conn->connectpath); - status = NT_STATUS_BAD_NETWORK_NAME; - goto err_root_exit; - } + ok = canonicalize_connect_path(conn); + if (!ok) { + DBG_ERR("canonicalize_connect_path failed " + "for service %s, path %s\n", + lp_const_servicename(snum), + conn->connectpath); + status = NT_STATUS_BAD_NETWORK_NAME; + goto err_root_exit; } /* Add veto/hide lists */