> Understand increases, thanks. I guess it would be "better" if, somehow,
> /tmp
> could refer to a different filesystem or directory for each individual
> user.
> UNIX on OS/390 does have something like this. A different kind of symlink
> which is dependant on the userid.  Or perhaps, setup /tmp/$USER for every
> valid use and don't have /tmp be world-writable.   ...

Yeah ... I've been doing that for years,  something akin to:

                TMP=/tmp/$LOGNAME
                mkdir -p $TMP
                export TMP

(and also TMPDIR and/or TEMP as required)

The "1" in 'chmod 1777 /tmp' means that anyone can write to /tmp
but they can only remove things they put there themselves.   This is
a significant bit for such a shared resource.   Doesn't eliminate all
the problems,  but helps.   Access to files or directories in /tmp is
then the responsibility of the creator of each such file or directory.

> I wonder why Linux doesn't
> do that? It should be easy to change the scripts that use /tmp to use
> /tmp/$USER and to change the useradd program to create /tmp/$USER when it
> creates /home/$USER and make it have the correct permissions. Or even
> create
> /home/$USER/tmp and symlink it to /tmp/$USER. Just some weird thoughts from
> a "legacy" sysprog. I may well be all wet.

Just damp.   ;-)
/tmp is not wide open as some would think.

Changing the scripts is a does-not-scale-well kind of problem.
Better would be to set TMP (and/or other such variables) in the
global profiling  (stuff that gets sourced before $HOME/.profile).
But not everything honors that.   But it is a good first step.

-- R;

Reply via email to