Remove a variable used just once
authorVolker Lendecke <vl@samba.org>
Fri, 30 Jan 2009 14:04:44 +0000 (15:04 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 10 Mar 2010 12:22:06 +0000 (13:22 +0100)
source3/smbd/vfs.c

index 4eb3b3aa9107af29b91127e3b6e01fba78aff0a8..13d962ce7c6e6875d21f94be172fe0c90fd2e9d5 100644 (file)
@@ -859,7 +859,6 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
        bool free_resolved_name = False;
 #endif
        char *resolved_name = NULL;
-       size_t con_path_len = strlen(conn->connectpath);
        char *p = NULL;
 
        DEBUG(3,("reduce_name [%s] [%s]\n", fname, conn->connectpath));
@@ -945,7 +944,9 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
        }
 
        /* Check for widelinks allowed. */
-       if (!lp_widelinks(SNUM(conn)) && (strncmp(conn->connectpath, resolved_name, con_path_len) != 0)) {
+       if (!lp_widelinks(SNUM(conn))
+           && (strncmp(conn->connectpath, resolved_name,
+                       strlen(conn->connectpath)) != 0)) {
                DEBUG(2, ("reduce_name: Bad access attempt: %s is a symlink outside the share path\n", fname));
                if (free_resolved_name) {
                        SAFE_FREE(resolved_name);