Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Dirk Engling <erdgeist@xxxxxxxxxxxx>
- Date: Tue, 16 Jan 2007 03:17:10 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Colin Percival wrote:
No. `cp -f` unlinks the existing file and creates a new file, but will
still follow a symlink if one is created between the "unlink" syscall and
the "open" syscall.
/* remove existing destination file name,
* create a new file */
(void)unlink(to.p_path);
if (!lflag)
to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
fs->st_mode & ~(S_ISUID | S_ISGID));
You are right. Atomically in binary is not atomical enough.
mv in its rename()-form will do the job, so we need to create a file in
. by mktemp and mv it to the real name when filled.
Regards
erdgeist
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFFrDWmImmQdUyYEgkRAgSgAJ0c5mcaM4LByBUE0LC1Iqdj8ZFSAACdF9qM
fFETX4I+Fvue0u+343bBG8c=
=MkSh
-----END PGP SIGNATURE-----
_______________________________________________
freebsd-security@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-security
To unsubscribe, send any mail to "freebsd-security-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Bruce Evans
- Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- References:
- FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: FreeBSD Security Advisories
- HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Colin Percival
- Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Pawel Jakub Dawidek
- Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Dirk Engling
- Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Pawel Jakub Dawidek
- Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Dirk Engling
- Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Pawel Jakub Dawidek
- Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Dirk Engling
- Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- From: Colin Percival
- FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- Prev by Date: Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- Next by Date: Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- Previous by thread: Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- Next by thread: Re: HEADS UP: Re: FreeBSD Security Advisory FreeBSD-SA-07:01.jail
- Index(es):
Relevant Pages
|
|