Re: [Linuxcommand-discuss] more change
Brought to you by:
bshotts
|
From: Tomi O. <Tom...@so...> - 2000-06-19 06:18:05
|
Sunday Jun 18 14:08:41 -0400 2000 root <ro...@te...> wrote:
>
> blah... slow day at work today... sorry for all the spam :)
>
> a fix for the security issue brought up with 'new_script' in regards to
> the tmp file race conditions that exist...
>
> if a temp file is needed...
>
> function temp_dir
> {
> #####
> # create a secure temp file thus avoiding
> # race conditions that may exist on a multi-
> # user system
> #####
>
> TEMP=`ls | grep tteemmpp | awk {'print $1'}`
> if [ "$TEMP" != "" ]; then
> mkdir ~/tteemmpp/
> fi
> }
>
> then, for the TEMP_FILE variable, set it as such:
> ~/tteemmpp/$PROGNAME
How about:
TEMPDIR=~/tteemmpp/; [ ! -d $TEMPDIR ] && mkdir $TEMPDIR
... and maybe utilizing $$ (the pid) in tmp file names.
> | Systems Administrator . technolust.cx irc.spamnet.org 6667 |
Tomi
|