summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-07-03 21:07:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:10 -0500
commit192062c4a60d107cd762183b937249bffd9edde7 (patch)
tree69a4c193470521f8e6d2abd0b922fb8eed6df63d /source3/smbd/trans2.c
parent26c0b81d757d711646239fc55ed326fa3b0180cc (diff)
downloadsamba-192062c4a60d107cd762183b937249bffd9edde7.tar.gz
samba-192062c4a60d107cd762183b937249bffd9edde7.tar.bz2
samba-192062c4a60d107cd762183b937249bffd9edde7.zip
r16789: Fix bug #3909, when using ea's getting a directory tries to
read ea's from an msdfs link. Stop it from doing that. Jerry please merge to 3.0.23. Jeremy. (This used to be commit 95e5ace6b4f348a3244b6a3ea0fd8badf55271f5)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 27fd62be7f..9030737b1b 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1091,6 +1091,8 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
while (!found) {
BOOL got_match;
+ BOOL ms_dfs_link = False;
+
/* Needed if we run out of space */
long curr_dirpos = prev_dirpos = dptr_TellDir(conn->dirptr);
dname = dptr_ReadDirName(conn->dirptr,&curr_dirpos,&sbuf);
@@ -1154,8 +1156,7 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
if(lp_host_msdfs() &&
lp_msdfs_root(SNUM(conn)) &&
- is_msdfs_link(NULL,conn, pathreal, NULL, NULL,
- &sbuf)) {
+ ((ms_dfs_link = is_msdfs_link(NULL,conn, pathreal, NULL, NULL, &sbuf)) == True)) {
DEBUG(5,("get_lanman2_dir_entry: Masquerading msdfs link %s as a directory\n", pathreal));
sbuf.st_mode = (sbuf.st_mode & 0xFFF) | S_IFDIR;
@@ -1168,7 +1169,11 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
}
}
- mode = dos_mode(conn,pathreal,&sbuf);
+ if (ms_dfs_link) {
+ mode = dos_mode_msdfs(conn,pathreal,&sbuf);
+ } else {
+ mode = dos_mode(conn,pathreal,&sbuf);
+ }
if (!dir_check_ftype(conn,mode,dirtype)) {
DEBUG(5,("[%s] attribs didn't match %x\n",fname,dirtype));