Bug 33031 - smbd processes invoked by a user are using user limits for open file handles (1024)
smbd processes invoked by a user are using user limits for open file handles ...
Status: RESOLVED DUPLICATE of bug 32415
Product: UCS
Classification: Unclassified
Component: Samba
UCS 3.1
Other Linux
: P5 normal (vote)
: ---
Assigned To: Samba maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-31 09:55 CET by Tim Petersen
Modified: 2013-11-04 13:13 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Petersen univentionstaff 2013-10-31 09:55:18 CET
From Ticket #2013103021001753:
In UCS 2.4 a smbd process invoked by a user is running as ruid and euid 0 but uses the max open file limits from samba config (max_open_files).
In UCS 3.1 these processes are using the user scope default (1024).

Example:
1. Shell (root):
while true; do pgrep -f smbd | while read pid; do echo "$pid $(sed -ne 's/Max open files\s\+\([0-9]\+\)\s\+.*/\1/p' < /proc/$pid/limits) $(lsof -n -p $pid | wc -l)"; done; sleep 0.1; ps axo euid,ruid,cmd | grep smbd; done
2. Shell (Administrator):
smbclient -L localhost

UCS 3.1

1740 32828 97
1770 32828 97
24798 1024 121 (invoked by smbclient)
    0     0 /usr/sbin/smbd -D
    0     0 /usr/sbin/smbd -D
    0     0 /usr/sbin/smbd -D

.......

UCS 2.4

5229 16404 83
5235 16404 82
8780 16404 111 (invoked by smbclient)
    0     0 /usr/sbin/smbd -D
    0     0 /usr/sbin/smbd -D
    0     0 /usr/sbin/smbd -D

A workaround could be to increase the user scope limit by ucr:
security/limits/group/"Domain Users"/soft/nofile
security/limits/group/"Domain Users"/hard/nofile
Comment 1 Tim Petersen univentionstaff 2013-10-31 12:10:26 CET
(In reply to Tim Petersen from comment #0)

> A workaround could be to increase the user scope limit by ucr:
> security/limits/group/"Domain Users"/soft/nofile
> security/limits/group/"Domain Users"/hard/nofile

Even if the processes are running as euid and ruid 0, increasing the user scope limits will do the trick. I don't know why, but at least it works ;)
Comment 2 Arvid Requate univentionstaff 2013-11-04 13:13:47 CET
Thanks for the useful analysis, I guess this helps solving Bug 32415.

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