1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

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 e96cf1309e)
This commit is contained in:
Volker Lendecke 2008-01-17 17:48:33 +01:00 committed by Jeremy Allison
parent 805caafd44
commit 145ab107b2

View File

@ -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);