I just had a major issue with Samba, I changed my /tmp permissions to something rather restrictive, and after this point I could not log in to samba from any windows client (I did not try a linux client, didn't have one on hand). (Changed permissions back to something less restrictive, all works fine again)

My question is, what exactly is samba using /tmp for?


1 Answer 1


You shouldn't do that.

There're plenty system calls that creates temp files and directories in /tmp, including:

  • Function: FILE * tmpfile (void)
  • Function: FILE * tmpfile64 (void)
  • Function: char * tmpnam (char *result)
  • Function: char * tmpnam_r (char *result)
  • Macro: int L_tmpnam
  • Macro: int TMP_MAX
  • Function: char * tempnam (const char *dir, const char *prefix)
  • SVID Macro: char * P_tmpdir
  • Function: char * mktemp (char *template)
  • Function: int mkstemp (char *template)
  • Function: char * mkdtemp (char *template)

Which is probably why samba crashes ...

  • Oh, interesting. I'm running a server though, I don't need very many things to function properly (mostly just samba to be honest)
    – Cestarian
    Commented Apr 12, 2016 at 8:00
  • perhaps so, but randomly changing and disabling things you don't understand is never a good idea. BTW, by "something less restrictive", i hope you meant "back to what it was, chmod 1777 /tmp".
    – cas
    Commented Apr 12, 2016 at 23:06
  • @cas Late answer, but my permission changes were done in the mount options (fstab) I never actually changed the directory permission directly (I was mounting tmpfs). Btw I accepted this answer, but only because it doesn't seem like I'll get another one (I.e. what exactly samba is using tmp for) it might very well be one or a couple of the functions on your provided list though.
    – Cestarian
    Commented May 2, 2016 at 12:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .