[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: '.' in path, summary



BGanesh forced the electrons to say:
> 
> questions (fm a newbie perspective) : what is the /tmp directory used
> for anyway? Who's got access to it ? drwxwxrwx ? Would eliminating the
> presence of any executable in the /tmp resolve this once and for all?

The /tmp directory is meant for precisely what its name implies - to
create temporary files. _Every_user_ on the system has got access to
it. But, if you did a ls -ld /tmp, you will notice that the perms are
drwxrwxrwt. The 't' at the end makes sure that even though everybody has
every kind of permissions to the directory, only those who actually own
the files can delete them.

You _cannot_ do anything to /tmp without compromising your system. Maybe
a check for really old files and their removal, but thats all. RedHat
supplies a program tmpwatch to do that. Many, many programs use /tmp for
various purposes. X11 uses /tmp to create its lockfile and unix domain
socket, gcc uses /tmp to store intermediate object and assembly code,
almost every mailer creates a file in /tmp on which it invokes sendmail
(unless it can talk SMTP directly - I believe netscape falls into the
second category; can someone clarify?), diald creates a fifo in /tmp so
that the user can communicate with it...

RedHat uses /tmp while its installation also. I am not sure of other
distros, though.

So far as I can recall, only the program gzexe creates executables in
/tmp, albeit not directly. Any other examples are welcome.

> To eliminate the executables in the /tmp directory you could simply run
> a cron job that checks the type of file for each file in the /tmp
> directory. Since this would be periodic, it might be better to run a
> background process that does a 'select' on the /tmp directory and cheks
> the files whenever it gets notifed of a change in the directory. Of
> course, since I don't know the purpose of the /tmp I might be wrong on
> this. pls clarify...

See  above.  If  you  are  sure  none of your users will be using
gzexe, you may do that. But, such a program is discouraged.

Regards,

Binand

- --------------------------------------------------------------------
For more information on Linux in India visit http://www.linux-india.org/

------------------------------

End of Linux India Digest V1 #84
********************************

--------------------------------------------------------------------
To unsubscribe send an email to majordomo@xxxxxxxxx with the word
'unsubscribe linux-india-digest' (without the quotes) in the body
of the email.