Re: enhance security via private TMP/TMPDIR by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mattdm@xxxxxxxxxx (Matthew Miller) writes:

> Just a thought:
>
>
> /etc/profile.d/tmpdir.sh:

FWIW... I use

| #! /bin/bash
| 
| T=/var/tmp/sessiondir-$USER
| 
| dir=
| for i in $T.*; do
|     test -d "$i" -a -O "$i" -a ! -L "$i" -a "$i" -nt /.autofsck || continue
|     dir="$i"
| done
| 
| test -n "$dir" || {
|     dir=$(mktemp -d "$T.$(date +%s).XXXXXX") && \
|     mkdir -p $dir/{tmp,redhat/{SOURCES,RPMS/{i{3,4,5,6}86,noarch,x86_64},SPECS,SRPMS,BUILD}} \
|              $dir/cvsextras && \
|     ln -s ../SRPMS $dir/redhat/RPMS/
| } || {
|     echo "Failed to create tempdir" >&2
|     exit 1
| }
|     
| tmp="export ENSC_SESSIONDIR=$dir"
| eval $tmp
| echo "$tmp"

to create a session directory. It assigns one temporary directory per
machine cycle (detected by age of /.autofsck). So, e.g. two parallel ssh
logins will have the same sessiondir. Adding the date to its name make
'ls -l ...' show the recent directory last.




Enrico

Attachment: pgppUY2Sf6FVh.pgp
Description: PGP signature

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
http://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux