Hi Dirk, * Dirk Eddelbuettel <[EMAIL PROTECTED]> [2008-08-25 13:06]: > On 25 August 2008 at 04:11, Nico Golde wrote: > | * Dirk Eddelbuettel <[EMAIL PROTECTED]> [2008-08-25 03:07]: [...] > | > Right before /tmp/A.* are being used, they are being wiped. No symlink > | > attack. > | > > | > Unless I hear objections, I plan to close this one. > | > | Please don't. There is still a race condition here. The > | chance is not that high but it's still possible in theory to > | create the symlink after the unlink. Using mktemp shouldn't > | be a big effort but solve this problem. > > Right. Stephen said so too. Trouble is that we then accumulate yet another > Debian-only patch... Oh well.
That shouldn't be really a problem.
> So something like
>
> # test functionality of the compiler
> javac_works='not present'
> if test -n "$JAVAC"; then
> javac_works='not functional'
> #rm -rf /tmp/A.java /tmp/A.class
> tempdir=`mktemp -d`
> echo "public class A { }" > ${tempdir}/A.java
> if test -e ${tempdir}/A.java; then
> if "${JAVAC}" ${tempdir}/A.java >/dev/null; then
> if test -e ${tempdir}/A.class; then
> javac_works=yes
> fi
> fi
> fi
> #rm -rf /tmp/A.java /tmp/A.class
> rm -rf ${tempdir}
> fi
>
> should do, right?
Looks correct to me!
Cheers
Nico
--
Nico Golde - http://www.ngolde.de - [EMAIL PROTECTED] - GPG: 0x73647CFF
For security reasons, all text in this mail is double-rot13 encrypted.
pgpeoQ2vFWUP7.pgp
Description: PGP signature

