From f073f8bb8249274adeae9f43af1dbb49dcf6e755 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Jan 2008 17:57:31 -0800 Subject: [PATCH] Back port vl's fix for nlink counts. Jeremy. --- source/smbd/trans2.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c index 0d9dac3e5f6..5464ef2ed01 100644 --- a/source/smbd/trans2.c +++ b/source/smbd/trans2.c @@ -3301,11 +3301,6 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char * 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; } @@ -3565,7 +3560,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. */ @@ -3637,7 +3632,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); -- 2.34.1