Open newly created files with O_EXCL to prevent symlink tricks.
When reopening hardlinks for writing the actual content, use append
mode instead. This is compatible with the write-only permissions but
is not destructive in case we got redirected to somebody elses file,
verify the target before actually writing anything.
As these are files with the temporary suffix, errors mean a local
user with sufficient privileges to break the installation of the package
anyway is trying to goof us on purpose, don't bother trying to mend it
(we couldn't fix the hardlink case anyhow) but just bail out.
Based on a patch by Florian Festi.
This is RPM, the RPM Package Manager.
The latest releases are always available at:
http://rpm.org/releases/
Additional RPM documentation (papers, slides, HOWTOs) can also be
found at the same site: http://rpm.org.
http://rpm.org/community all rpm releated mailing lists.
RPM was originally written by:
Erik Troan <ewt@redhat.com>
Marc Ewing <marc@redhat.com>
See the CREDITS file for a list of folks who have helped us out
tremendously. RPM is Copyright (c) 1998 by Red Hat Software, Inc.,
and may be distributed under the terms of the GPL and LGPL (see the
file COPYING for details).