aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2024-05-27 22:37:13 -0700
committerZac Medico <zmedico@gentoo.org>2024-05-27 22:37:13 -0700
commit120b2ec988eebf6cd90365d5b50a1a718eebb116 (patch)
tree0e6617eeae7a12a5d27af64fd59cec57d67d3982 /lib/portage/util/locale.py
parentatomic_ofstream: Use mkstemp rather than getpid (pid namespace safety) (diff)
downloadportage-master.tar.gz
portage-master.tar.bz2
portage-master.zip
atomic_ofstream: fix follow_symlinks fallback and default file modeHEADmaster
Handle OSError from mkstemp for (default) follow_symlinks mode, not following the symlink if necessary (the target's parent may not exist or may be readonly). This restores the fallback behavior that existed before the introduction of mkstemp in commit de19f3a7215d. Handle missing _file and _tmp_name attributes during close. Also set the default file mode respecting umask if a previous file does not exist, which fixes the mode of CONTENTS files since mkstemp. Fixes: de19f3a7215d ("atomic_ofstream: Use mkstemp rather than getpid (pid namespace safety)") Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/portage/util/locale.py')
0 files changed, 0 insertions, 0 deletions