The Samba-Bugzilla – Attachment 5088 Details for
Bug 6875
trans2 FIND_FIRST2 response --> FIND_FIRST2 Data -> Fille Attributes are returned as 0x220 for LANMAN2.1 dialect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am format patch for 3.4.4 - second part of fix
0001-Second-part-of-fix-for-6875-trans2-FIND_FIRST2-res.patch (text/plain), 5.25 KB, created by
Jeremy Allison
on 2009-12-15 20:40:23 UTC
(
hide
)
Description:
git-am format patch for 3.4.4 - second part of fix
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2009-12-15 20:40:23 UTC
Size:
5.25 KB
patch
obsolete
>From 31fb9ad26d4bb01b9bf4cac9e36ce78ce8514d23 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Tue, 15 Dec 2009 18:36:36 -0800 >Subject: [PATCH] Second part of fix for 6875 - trans2 FIND_FIRST2 response --> FIND_FIRST2 Data -> Fille Attributes are returned as 0x220 for LANMAN2.1 dialect >MIME-Version: 1.0 >Content-Type: text/plain; charset=utf-8 >Content-Transfer-Encoding: 8bit > >Ensure dos_mode can return FILE_ATTRIBUTE_NORMAL, then filter the returned attributes by protocol level. >This makes us consistant in returning DOS attrs across all replies. Tested on OS/2 by Günter Kukkukk. >Jeremy. >--- > source3/smbd/dosmode.c | 28 ++++++++++++++++++++-------- > source3/smbd/trans2.c | 15 +++++---------- > 2 files changed, 25 insertions(+), 18 deletions(-) > >diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c >index 45ea74d..7b47fe6 100644 >--- a/source3/smbd/dosmode.c >+++ b/source3/smbd/dosmode.c >@@ -22,6 +22,18 @@ > > extern enum protocol_types Protocol; > >+static uint32_t filter_mode_by_protocol(uint32_t mode) >+{ >+ if (Protocol <= PROTOCOL_LANMAN2) { >+ DEBUG(10,("filter_mode_by_protocol: " >+ "filtering result 0x%x to 0x%x\n", >+ (unsigned int)mode, >+ (unsigned int)(mode & 0x3f) )); >+ mode &= 0x3f; >+ } >+ return mode; >+} >+ > static int set_sparse_flag(const SMB_STRUCT_STAT * const sbuf) > { > #if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE) >@@ -343,12 +355,12 @@ uint32 dos_mode_msdfs(connection_struct *conn, const char *path,SMB_STRUCT_STAT > result |= aHIDDEN; > } > >- if (Protocol <= PROTOCOL_LANMAN2) { >- DEBUG(10,("dos_mode_msdfs : filtering result 0x%x\n", >- (unsigned int)result )); >- result &= 0xff; >+ if (result == 0) { >+ result = FILE_ATTRIBUTE_NORMAL; > } > >+ result = filter_mode_by_protocol(result); >+ > DEBUG(8,("dos_mode_msdfs returning ")); > > if (result & aHIDDEN) DEBUG(8, ("h")); >@@ -526,12 +538,12 @@ uint32 dos_mode(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf) > result |= aHIDDEN; > } > >- if (Protocol <= PROTOCOL_LANMAN2) { >- DEBUG(10,("dos_mode : filtering result 0x%x\n", >- (unsigned int)result )); >- result &= 0xff; >+ if (result == 0) { >+ result = FILE_ATTRIBUTE_NORMAL; > } > >+ result = filter_mode_by_protocol(result); >+ > DEBUG(8,("dos_mode returning ")); > > if (result & aHIDDEN) DEBUG(8, ("h")); >diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c >index bf3808e..f665bfb 100644 >--- a/source3/smbd/trans2.c >+++ b/source3/smbd/trans2.c >@@ -1254,7 +1254,6 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx, > char *nameptr; > char *last_entry_ptr; > bool was_8_3; >- uint32 nt_extmode; /* Used for NT connections instead of mode */ > bool needslash = ( conn->dirpath[strlen(conn->dirpath) -1] != '/'); > bool check_mangled_names = lp_manglednames(conn->params); > char mangled_name[13]; /* mangled 8.3 name. */ >@@ -1456,8 +1455,6 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx, > p = pdata; > last_entry_ptr = p; > >- nt_extmode = mode ? mode : FILE_ATTRIBUTE_NORMAL; >- > switch (info_level) { > case SMB_FIND_INFO_STANDARD: > DEBUG(10,("get_lanman2_dir_entry: SMB_FIND_INFO_STANDARD\n")); >@@ -1604,7 +1601,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx, > put_long_date_timespec(conn->ts_res, p,mdate_ts); p += 8; > SOFF_T(p,0,file_size); p += 8; > SOFF_T(p,0,allocation_size); p += 8; >- SIVAL(p,0,nt_extmode); p += 4; >+ SIVAL(p,0,mode); p += 4; > q = p; p += 4; /* q is placeholder for name length. */ > { > unsigned int ea_size = estimate_ea_size(conn, NULL, pathreal); >@@ -1655,7 +1652,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx, > put_long_date_timespec(conn->ts_res, p,mdate_ts); p += 8; > SOFF_T(p,0,file_size); p += 8; > SOFF_T(p,0,allocation_size); p += 8; >- SIVAL(p,0,nt_extmode); p += 4; >+ SIVAL(p,0,mode); p += 4; > len = srvstr_push(base_data, flags2, > p + 4, fname, PTR_DIFF(end_data, p+4), > STR_TERMINATE_ASCII); >@@ -1678,7 +1675,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx, > put_long_date_timespec(conn->ts_res, p,mdate_ts); p += 8; > SOFF_T(p,0,file_size); p += 8; > SOFF_T(p,0,allocation_size); p += 8; >- SIVAL(p,0,nt_extmode); p += 4; >+ SIVAL(p,0,mode); p += 4; > q = p; p += 4; /* q is placeholder for name length. */ > { > unsigned int ea_size = estimate_ea_size(conn, NULL, pathreal); >@@ -1727,7 +1724,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx, > put_long_date_timespec(conn->ts_res, p,mdate_ts); p += 8; > SOFF_T(p,0,file_size); p += 8; > SOFF_T(p,0,allocation_size); p += 8; >- SIVAL(p,0,nt_extmode); p += 4; >+ SIVAL(p,0,mode); p += 4; > q = p; p += 4; /* q is placeholder for name length. */ > { > unsigned int ea_size = estimate_ea_size(conn, NULL, pathreal); >@@ -1760,7 +1757,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx, > put_long_date_timespec(conn->ts_res, p,mdate_ts); p += 8; > SOFF_T(p,0,file_size); p += 8; > SOFF_T(p,0,allocation_size); p += 8; >- SIVAL(p,0,nt_extmode); p += 4; >+ SIVAL(p,0,mode); p += 4; > q = p; p += 4; /* q is placeholder for name length */ > { > unsigned int ea_size = estimate_ea_size(conn, NULL, pathreal); >@@ -4083,8 +4080,6 @@ static void call_trans2qfilepathinfo(connection_struct *conn, > } else { > mode = dos_mode(conn,fname,&sbuf); > } >- if (!mode) >- mode = FILE_ATTRIBUTE_NORMAL; > > nlink = sbuf.st_nlink; > >-- >1.6.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
metze
:
review+
Actions:
View
Attachments on
bug 6875
:
4923
|
4924
| 5088 |
5089