s3: DFS: Remove is_msdfs_link_internal() - no longer used.
authorJeremy Allison <jra@samba.org>
Wed, 12 Feb 2020 21:54:08 +0000 (13:54 -0800)
committerRalph Boehme <slow@samba.org>
Tue, 18 Feb 2020 22:34:16 +0000 (22:34 +0000)
All DFS links are now read through the VFS and not via
symlink calls.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Feb 18 22:34:16 UTC 2020 on sn-devel-184

source3/smbd/msdfs.c

index 6a6ee3fd5f224731323967533ea672afe10e809d..cc32ebc9d29682eadc974e9259d389c1e0957224 100644 (file)
@@ -620,80 +620,6 @@ bool parse_msdfs_symlink(TALLOC_CTX *ctx,
        return true;
 }
 
-#if 0
-/**********************************************************************
- Returns true if the unix path is a valid msdfs symlink and also
- returns the target string from inside the link.
-**********************************************************************/
-
-static bool is_msdfs_link_internal(TALLOC_CTX *ctx,
-                       connection_struct *conn,
-                       struct smb_filename *smb_fname,
-                       char **pp_link_target)
-{
-       int referral_len = 0;
-#if defined(HAVE_BROKEN_READLINK)
-       char link_target_buf[PATH_MAX];
-#else
-       char link_target_buf[7];
-#endif
-       size_t bufsize = 0;
-       char *link_target = NULL;
-
-       if (pp_link_target) {
-               bufsize = 1024;
-               link_target = talloc_array(ctx, char, bufsize);
-               if (!link_target) {
-                       return False;
-               }
-               *pp_link_target = link_target;
-       } else {
-               bufsize = sizeof(link_target_buf);
-               link_target = link_target_buf;
-       }
-
-       if (SMB_VFS_LSTAT(conn, smb_fname) != 0) {
-               DEBUG(5,("is_msdfs_link_read_target: %s does not exist.\n",
-                       smb_fname->base_name));
-               goto err;
-       }
-       if (!S_ISLNK(smb_fname->st.st_ex_mode)) {
-               DEBUG(5,("is_msdfs_link_read_target: %s is not a link.\n",
-                       smb_fname->base_name));
-               goto err;
-       }
-
-       referral_len = SMB_VFS_READLINKAT(conn,
-                               conn->cwd_fsp,
-                               smb_fname,
-                               link_target,
-                               bufsize - 1);
-
-       if (referral_len == -1) {
-               DEBUG(0,("is_msdfs_link_read_target: Error reading "
-                       "msdfs link %s: %s\n",
-                       smb_fname->base_name, strerror(errno)));
-               goto err;
-       }
-       link_target[referral_len] = '\0';
-
-       DEBUG(5,("is_msdfs_link_internal: %s -> %s\n", smb_fname->base_name,
-                               link_target));
-
-       if (!strnequal(link_target, "msdfs:", 6)) {
-               goto err;
-       }
-       return True;
-
-  err:
-
-       if (link_target != link_target_buf) {
-               TALLOC_FREE(link_target);
-       }
-       return False;
-}
-#endif
-
 /**********************************************************************
  Returns true if the unix path is a valid msdfs symlink.
 **********************************************************************/