Bug 15408 - smbclient + showacls leaks open file descriptors in smbd
Summary: smbclient + showacls leaks open file descriptors in smbd
Status: RESOLVED DUPLICATE of bug 15391
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.18.3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
Depends on:
Reported: 2023-06-29 13:35 UTC by Peter Eriksson
Modified: 2023-06-29 14:08 UTC (History)
0 users

See Also:

Patch to fix fd leak with smbclient + showacls (307 bytes, patch)
2023-06-29 13:56 UTC, Peter Eriksson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Eriksson 2023-06-29 13:35:04 UTC
Checking with "lsof" on the smbd process I noticed that every time I retrieve an ACL (vfs_zfsacl) it seems to leak a file descriptor for each access.


smbclient -k //filur00/peter86

Checking with lsof -p on the smbd process associated the first three "dir" just opens the cwd directory and things look OK.

But after enabling "showacls" it leaks 22 files per "dir" (there are 22 visible files/dirs in that directory).

I've had a quick look at the source3/modules/vfs_zfsacl.c code but I can't really find why/where it leaks the file descriptors which is kind of annoying...

Tested on FreeBSD 12.4 and 13.2 (13.2 with other patches needed to get it to work).
Comment 1 Peter Eriksson 2023-06-29 13:46:03 UTC
Hmm... I can't seem to reproduce it from Windows. Could it be a bug in smbclient perhaps? Will investigate a bit more...
Comment 2 Peter Eriksson 2023-06-29 13:56:49 UTC
Created attachment 17965 [details]
Patch to fix fd leak with smbclient + showacls

The enclosed patch seems to solve it (was a missing cli_close() call)
Comment 3 Ralph Böhme 2023-06-29 14:08:25 UTC
Looks like Volker was quicker then you to fix this one. :)


*** This bug has been marked as a duplicate of bug 15391 ***