]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Always call canonicalize_connect_path() for a share.
authorJeremy Allison <jra@samba.org>
Tue, 7 Apr 2020 00:36:44 +0000 (17:36 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 9 Apr 2020 19:40:35 +0000 (19:40 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/service.c

index 4de36bf6ff9287df43f3a9a640c14c57718e4ada..3249c660983c487fbb1038605118871de0c5deb5 100644 (file)
@@ -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 */