Bug 9432 - smbstatus: keep losing output if executed as "non root" user
Summary: smbstatus: keep losing output if executed as "non root" user
Status: RESOLVED DUPLICATE of bug 10127
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.6.9
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
Depends on:
Reported: 2012-11-26 15:40 UTC by Giulio
Modified: 2013-09-05 14:16 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Giulio 2012-11-26 15:40:14 UTC
Linux RHEL5, using sernet 3.6.x rpm packages.

Starting in 3.6.8, smbstatus won't print the "Locked files" section anymore, unless you run is as root. Using "-d 2" or stracing reveals it's trying to read serverid.tdb (which it's a new thing in 3.6.8 it seems):
    open("/var/lib/samba/serverid.tdb", O_RDWR|O_CREAT|O_LARGEFILE, 0644) = -1
    EACCES (Permission denied)

    tdb(/var/lib/samba/serverid.tdb): tdb_open_ex: could not open file /var/lib/samba/serverid.tdb: Permission denied

Was this done intentionally? The smbstatus man page of 3.6.7 is the same of 3.6.8, so this is not clear.
Could the file be opened read-only instead of RW since the serverid.tdb file is 644?


Also, in the recent past another change caused the smbstatus section
"PID     Username      Group         Machine"
to also be filled only if you run smbstatus as root due to opening /var/lib/samba/sessionid.tdb RW.


Are you supposed to always run smbstatus as root?


smb.conf I used during tests:
workgroup = WORKGROUP
guest account = ftp
preferred master = no
os level = 1
map to guest = bad user
path = /tmp/smb
guest ok = yes
writeable = yes
Comment 1 Andreas Schneider 2013-09-05 14:16:07 UTC

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