i have regular user, whose TMP and TMPDIR env vars are set to ~/tmp. these are accessible only to that regular user. now i run 'sudo bash -l' to get root shell, after /etc/init.d/samba restart i fail to connect to samba server, snip from samba error log: [2004/01/14 17:58:14, 0] smbd/service.c:set_current_service(56) chdir (/home/glen/tmp) failed Reproducible: Always Steps to Reproduce: 20:51:04 root@wintersunset[0:91] portage# TMPDIR=/root TMP=/root /etc/init.d/samba restart * Stopping samba... [ ok ] * Starting samba... [ ok ] 20:57:18 root@wintersunset[0:92] portage# smbclient -L wintersunset Password: Sharename Type Comment --------- ---- ------- Error returning browse list: NT_STATUS_NETWORK_ACCESS_DENIED Server Comment --------- ------- Workgroup Master --------- ------- 20:57:23 root@wintersunset[0:93] portage# TMPDIR=/var/tmp TMP=/var/tmp/ /etc/init.d/samba restart * Stopping samba... [ ok ] * Starting samba... [ ok ] 20:57:28 root@wintersunset[0:94] portage# smbclient -L wintersunset Password: Sharename Type Comment --------- ---- ------- netlogon Disk Network Logon Service print$ Disk IPC$ IPC IPC Service (Samba Server 3.0.1) ADMIN$ IPC IPC Service (Samba Server 3.0.1) Server Comment --------- ------- WINTERSUNSET Samba Server 3.0.1 Workgroup Master --------- ------- XXXXX using samba-3.0.1-r1 (probably same for other versions too)
this patch fixes the issue (unaccessible TMP/TMPDIR) --- samba~ 2004-01-14 21:36:33.000000000 +0200 +++ samba 2004-01-14 22:00:39.000000000 +0200 @@ -12,6 +12,7 @@ start() { ebegin "Starting samba" + unset TMP TMPDIR start-stop-daemon --start --quiet --exec /usr/sbin/smbd result=$? start-stop-daemon --start --quiet --exec /usr/sbin/nmbd
even redhat (fedora core 1 actually) addresses this issue: /etc/init.d/smb: # Avoid using root's TMPDIR unset TMPDIR
Ok, thanks for the report... will add it.
see bug 49463. samba-3.0.2a-r3.ebuild proposed, along with some minor init scripts tweak
fixed in bug 48871