diff options
author | Jeremy Allison <jra@samba.org> | 2003-08-14 23:47:12 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-08-14 23:47:12 +0000 |
commit | 5a8c2f5a442de7979a60a7b716801be85c2e434f (patch) | |
tree | a1e9cc303c07ad1882b13d25eaa788858b82fdee /source3/smbd/trans2.c | |
parent | 6a0c1d0baf2f185e0a8bf739af20c54472626678 (diff) | |
download | samba-5a8c2f5a442de7979a60a7b716801be85c2e434f.tar.gz samba-5a8c2f5a442de7979a60a7b716801be85c2e434f.tar.bz2 samba-5a8c2f5a442de7979a60a7b716801be85c2e434f.zip |
nlink field should decrement when delete pending is set.
Found by Samba4.
Jeremy.
(This used to be commit fbdf276e36b66e9ae65cb3f127ed80cfe9a43cac)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r-- | source3/smbd/trans2.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index feb78e512f..b1658032f3 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1986,7 +1986,10 @@ static int call_trans2qfilepathinfo(connection_struct *conn, data_size = 24; SOFF_T(pdata,0,allocation_size); SOFF_T(pdata,8,file_size); - SIVAL(pdata,16,sbuf.st_nlink); + if (delete_pending & sbuf.st_nlink) + SIVAL(pdata,16,sbuf.st_nlink - 1); + else + SIVAL(pdata,16,sbuf.st_nlink); SCVAL(pdata,20,0); SCVAL(pdata,21,(mode&aDIR)?1:0); break; @@ -2044,7 +2047,10 @@ static int call_trans2qfilepathinfo(connection_struct *conn, pdata += 40; SOFF_T(pdata,0,allocation_size); SOFF_T(pdata,8,file_size); - SIVAL(pdata,16,sbuf.st_nlink); + if (delete_pending && sbuf.st_nlink) + SIVAL(pdata,16,sbuf.st_nlink - 1); + else + SIVAL(pdata,16,sbuf.st_nlink); SCVAL(pdata,20,delete_pending); SCVAL(pdata,21,(mode&aDIR)?1:0); pdata += 24; |