Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38190 - samba: sideeffect when TMP or TMPDIR set
Summary: samba: sideeffect when TMP or TMPDIR set
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High critical
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
Depends on: 48871
Blocks:
  Show dependency tree
 
Reported: 2004-01-14 10:57 UTC by Elan Ruusamäe
Modified: 2004-06-11 07:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elan Ruusamäe 2004-01-14 10:57:04 UTC
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)
Comment 1 Elan Ruusamäe 2004-01-19 13:29:31 UTC
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
Comment 2 Elan Ruusamäe 2004-03-20 12:36:23 UTC
even redhat (fedora core 1 actually) addresses this issue:

/etc/init.d/smb:

# Avoid using root's TMPDIR
unset TMPDIR
Comment 3 Donny Davies (RETIRED) gentoo-dev 2004-03-22 07:34:14 UTC
Ok, thanks for the report... will add it.
Comment 4 Christian Andreetta (RETIRED) gentoo-dev 2004-05-04 05:30:52 UTC
see bug 49463. samba-3.0.2a-r3.ebuild proposed, along with some minor init scripts tweak
Comment 5 Christian Andreetta (RETIRED) gentoo-dev 2004-06-11 07:13:57 UTC
fixed in bug 48871