summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-17 17:48:33 +0100
committerJeremy Allison <jra@samba.org>2008-01-18 17:37:04 -0800
commit145ab107b2670b3d645c6757d0a3930eaff6c4d0 (patch)
tree93c0fb775610270c54409912f43ec471a15ac414 /source3/smbd
parent805caafd44cbc5fff49711b1a15fb64cc99f3ad3 (diff)
downloadsamba-145ab107b2670b3d645c6757d0a3930eaff6c4d0.tar.gz
samba-145ab107b2670b3d645c6757d0a3930eaff6c4d0.tar.bz2
samba-145ab107b2670b3d645c6757d0a3930eaff6c4d0.zip
Always return nlink=1 for directories
I did not test it, but it should not affect cifsfs, there are special posix calls that also return the stat information unfiltered. (This used to be commit e96cf1309e45628f4c27d03f77a4eef5e00602df)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 23d6f12996..763b6480e3 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -3745,11 +3745,6 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
nlink = sbuf.st_nlink;
- if ((nlink > 0) && S_ISDIR(sbuf.st_mode)) {
- /* NTFS does not seem to count ".." */
- nlink -= 1;
- }
-
if ((nlink > 0) && delete_pending) {
nlink -= 1;
}
@@ -4018,7 +4013,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
data_size = 24;
SOFF_T(pdata,0,allocation_size);
SOFF_T(pdata,8,file_size);
- SIVAL(pdata,16,nlink);
+ SIVAL(pdata,16,(mode&aDIR)?1:nlink);
SCVAL(pdata,20,delete_pending?1:0);
SCVAL(pdata,21,(mode&aDIR)?1:0);
SSVAL(pdata,22,0); /* Padding. */
@@ -4096,7 +4091,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
pdata += 40;
SOFF_T(pdata,0,allocation_size);
SOFF_T(pdata,8,file_size);
- SIVAL(pdata,16,nlink);
+ SIVAL(pdata,16,(mode&aDIR)?1:nlink);
SCVAL(pdata,20,delete_pending);
SCVAL(pdata,21,(mode&aDIR)?1:0);
SSVAL(pdata,22,0);