From 8e6390a1604da9e34f1f6823399687bf38cd7380 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 29 Dec 2006 20:39:53 +0000 Subject: r20411: Fix originally from SATOH Fumiyasu (slightly modified). Ensure "hide unXXX" parameters don't hide MSDFS links. Bug #3319. Jeremy. (This used to be commit e5466fffc286a99fafe0fcfbf70e903e33baa7f9) --- source3/smbd/dir.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/smbd/dir.c') diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 1c77630ee7..5a6b9713e5 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1011,6 +1011,18 @@ BOOL is_visible_file(connection_struct *conn, const char *dir_path, const char * if (asprintf(&entry, "%s/%s", dir_path, name) == -1) { return False; } + + /* If it's a dfs symlink, ignore _hide xxxx_ options */ + if (lp_host_msdfs() && + lp_msdfs_root(SNUM(conn)) && + /* We get away with NULL talloc ctx here as + we're not interested in the link contents + so we have nothing to free. */ + is_msdfs_link(NULL, conn, entry, NULL, NULL, NULL)) { + SAFE_FREE(entry); + return True; + } + /* Honour _hide unreadable_ option */ if (hide_unreadable && !user_can_read_file(conn, entry, pst)) { DEBUG(10,("is_visible_file: file %s is unreadable.\n", entry )); -- cgit