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

Re: Braindump: Can we get rid of the font-cache-group question?



On Thu, Jun 01, 2006 at 16:39 +0200, Ralf Stubner wrote:
> I think creating a link named like the file that is to be created won't
> work,

Actually, it would work if it points to a file where the attacked has
write but no read permissions. I am not sure how likely this case is,
nor how to get around this problem.

> but the name of the intermediate temporary file can be easily
> guessed: 
> 
> 
> # Install the TFM file carefully, since others may be working simultaneously.
> # Use cp when mv fails, since DOS will fail mv for deeply-nested directories.
> mv $TFMNAME "$TFMDESTDIR/tfm$$.tmp" 2>/dev/null \
>   || cp $TFMNAME "$TFMDESTDIR/tfm$$.tmp" || exit 1
> cd "$TFMDESTDIR" || exit 1
> chmod `kpsestat -xst,go-w .` tfm$$.tmp
> test -r $TFMNAME || mv tfm$$.tmp $TFMNAME || exit 1
> 
> 
> (similar things occur in mktexpk)
> In patch-deb we allready patch mktexlsr to use tempfile. Maybe we should
> do this here, too.

Actually, I am wondering why this temporary file is used at all. What's
wrong with


chmod `kpsestat -xst,go-w "$TFMDESTDIR"` $TFMNAME
test -r "$TFMDESTDIR/$TFMNAME" || mv $TFMNAME "$TFMDESTDIR" || exit 1


? (ignoring DOS and its problems with mv for the moment)

cheerio
ralf



Reply to: