From 145ab107b2670b3d645c6757d0a3930eaff6c4d0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 17 Jan 2008 17:48:33 +0100 Subject: 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) --- source3/smbd/trans2.c | 9 ++------- 1 file 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); -- cgit