smbd: remove dead code
[samba.git] / source3 / smbd / service.c
index 03125a30dad56acb2b23838936ebcbe1aab638ac..ea99f0d2129d83fc3eb52baa43e7930e92a295ea 100644 (file)
@@ -34,7 +34,7 @@
 #include "lib/afs/afs_funcs.h"
 #include "lib/util_path.h"
 
-static bool canonicalize_connect_path(connection_struct *conn)
+bool canonicalize_connect_path(connection_struct *conn)
 {
        bool ret;
        struct smb_filename con_fname = { .base_name = conn->connectpath };
@@ -80,6 +80,7 @@ bool set_conn_connectpath(connection_struct *conn, const char *connectpath)
                                conn->connectpath,
                                NULL,
                                NULL,
+                               0,
                                0);
        if (conn->cwd_fsp->fsp_name == NULL) {
                return false;
@@ -535,6 +536,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 +798,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 */
@@ -828,6 +829,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
                                        conn->connectpath,
                                        NULL,
                                        NULL,
+                                       0,
                                        0);
        if (smb_fname_cpath == NULL) {
                status = NT_STATUS_NO_MEMORY;