From 9ee1320049cf148a2bb102bbdee4a4bcc24c0de1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 12 Feb 2020 13:54:08 -0800 Subject: s3: DFS: Remove is_msdfs_link_internal() - no longer used. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All DFS links are now read through the VFS and not via symlink calls. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Tue Feb 18 22:34:16 UTC 2020 on sn-devel-184 --- source3/smbd/msdfs.c | 74 ---------------------------------------------------- 1 file changed, 74 deletions(-) diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 6a6ee3fd5f2..cc32ebc9d29 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -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. **********************************************************************/ -- cgit v1.2.1