In perl.git, the branch tonyc/127663-safe-inplace-in-do_close has been created
<http://perl5.git.perl.org/perl.git/commitdiff/1b4d0d79ac05894f255d23ca3d1b46c2455a10a8?hp=0000000000000000000000000000000000000000> at 1b4d0d79ac05894f255d23ca3d1b46c2455a10a8 (commit) - Log ----------------------------------------------------------------- commit 1b4d0d79ac05894f255d23ca3d1b46c2455a10a8 Author: Tony Cook <[email protected]> Date: Wed Aug 16 09:17:25 2017 +1000 (perl #127663) fallback to looking for work file if st_ino unusable M doio.c M pod/perldiag.pod M t/run/switches.t commit bb0824179b2cc1b8d5204758c2c93cf1e727e372 Author: Tony Cook <[email protected]> Date: Wed Jul 12 14:25:32 2017 +1000 (perl #127663) reject a changed directory for relative in-place filenames based in the inode/device numbers when we don't have the *at() functions. M doio.c M t/run/switches.t commit dddabd868f302c06fa886c29538b8d43b890e554 Author: Tony Cook <[email protected]> Date: Thu Jan 12 13:52:04 2017 +1100 (perl #127663) test we fail if the work file can't be renamed and ensure we (attempt to) clean up the work file M doio.c M t/run/switches.t commit 83419aa9e098e2540d02ab10d5923186289189ef Author: Tony Cook <[email protected]> Date: Thu Jan 12 13:51:01 2017 +1100 (perl #127663) test we fail if the backup rename fails and that we clean up the temp file M doio.c M t/run/switches.t commit 5a39f542c649762dfe5caedbe1643bdb8a6b3d84 Author: Tony Cook <[email protected]> Date: Thu Jan 12 11:02:52 2017 +1100 (perl #127663) clean up any files left behind The rename work file test will leave the work file, if the other tests fail for some reason they might also leave files. M t/run/switches.t commit 05df5c8807ed986f7d3be4c2eb576840ce65df58 Author: Tony Cook <[email protected]> Date: Thu Jan 12 10:58:58 2017 +1100 (perl #127663) don't do inplace renaming etc in child processes This avoids trying to rename the work file over the original multiple times, which could make the implicit (or explicit) close fail. This is an incompatibility with the pre-workfile version of in-place editing, since you could previously fork a child to do process a given file, but hopefully this is a rare case. M doio.c M t/run/switches.t commit 8ab93df006894c4c166b3684129c3180b5febe48 Author: Tony Cook <[email protected]> Date: Thu Jan 12 10:26:47 2017 +1100 (perl #127663) don't do inplace renaming etc in child threads This also avoids double closedir()ing the directory handle. M doio.c M t/run/switches.t commit 977bd6d625ba53702249ae8c80cede962e6402b5 Author: Tony Cook <[email protected]> Date: Mon Jan 9 17:02:38 2017 +1100 (perl #127663) test chdir() within an in-place edit loop M t/run/switches.t commit 733612e0500c5f8f8dfedaa93a56d04d4f9c1930 Author: Tony Cook <[email protected]> Date: Tue Dec 13 09:03:08 2016 +1100 (perl #127663) use *at() functions to handle perl code that chdirs Unfortunately this means systems that don't have the *at() functions aren't protected from code that chdir()s in the middle of in-place editing a file. M doio.c commit d226c0a2bfaa78c245a5573af5c0f2681f925c8c Author: Tony Cook <[email protected]> Date: Mon Dec 12 14:26:30 2016 +1100 add probes for openat, unlinkat, renameat, linkat and fchmodat M Configure M Cross/config.sh-arm-linux M NetWare/config.wc M Porting/Glossary M Porting/config.sh M config_h.SH M configure.com M plan9/config_sh.sample M symbian/config.sh M uconfig.h M uconfig.sh M uconfig64.sh M win32/config.ce M win32/config.gc M win32/config.vc commit d62950713a9b1969a52015f065537f4a2cc224f3 Author: Tony Cook <[email protected]> Date: Thu Dec 8 09:38:55 2016 +1100 (perl #127663) provide limited control for the internal drand48() perl can be built without PERL_INTERNAL_RAND_SEED support to reduce it's attack surface. M INSTALL M perl.c M pod/perlrun.pod commit 929344c06d753c7727ddb290d2b5b2dd62462cc5 Author: Tony Cook <[email protected]> Date: Tue Aug 2 16:05:22 2016 +1000 (perl #127663) test that die/exit leave the original file M t/run/switches.t commit d0405818f46877449351dc98447c7db655c75597 Author: Tony Cook <[email protected]> Date: Wed Aug 3 14:43:59 2016 +1000 (perl #127663) discard any output if not closed properly It can be closed by either iterating to the next file, or by an explicit close(ARGVOUT); M doio.c commit 5f92e2042d317ac58236f40ee36010e2f16eec03 Author: Tony Cook <[email protected]> Date: Tue May 24 09:06:18 2016 +1000 (perl #127663) add more in-place edit tests test that setuid is preserved with nested in-place editing, which fails previously. M t/io/nargv.t M t/run/switches.t commit 67ba8be6f9246c5a224a6f514360d48b605c44f5 Author: Tony Cook <[email protected]> Date: Thu May 19 15:22:32 2016 +1000 (perl #127663) all platforms no longer require a backup file Platforms that disallow deleting an open file, like Win32, Cygwin, previously required a backup extension (defaulted for Cygwin), but since we now write to a work file that's no longer necessary (but might still be desirable.) M perl.c commit e0d4aead3c87ba953fb1d70678a77a45e0c9f111 Author: Tony Cook <[email protected]> Date: Wed Jan 11 14:49:53 2017 +1100 (perl #127663) safer in-place editing Previously in-place editing opened the file then immediately *replaced* the file, so if an error occurs while writing the output, such as running out of space, the content of the original file is lost. This changes in-place editing to write to a work file which is renamed over the original only once the output file is successfully closed. It also fixes an issue with setting setuid/setgid file modes for recursive in-place editing. M doio.c M embed.fnc M embed.h M mg.c M pod/perldiag.pod M proto.h commit c683db79063638b79d9620ad4dcd5bd14552bc6b Author: Tony Cook <[email protected]> Date: Thu Aug 4 14:34:21 2016 +1000 (perl #127663) only test renaming directories with rename() available. Perl's rename implementation falls back to link() to rename when rename() isn't available, which is either disallowed or dangerous. M t/io/fs.t commit e48855bdd2fc57fc51156f5e4b8dee6b544456c8 Author: Tony Cook <[email protected]> Date: Thu Aug 4 14:30:13 2016 +1000 (perl #127663) add our own mkstemp() implementation Needed to generate temp files for safer in-place editing. Not based on any particular implementation, the BSD implementations tend to be wrappers around a megafunction that also does a few variations of mkstemp() and mkdtemp(), which we don't need (yet.) This might also be useful as a replacement for broken mkstemp() implementations that use a mode of 0666 when creating the file, though we'd need to add Configure probing for that. M embed.fnc M proto.h M util.c M util.h commit f26b33bdaa1e41fbaf65c649a3208f081fa7571b Author: Tony Cook <[email protected]> Date: Wed May 18 15:03:14 2016 +1000 (perl #127663) create a separate random source for internal use and use it to initialize hash randomization and to innoculate against quadratic behaviour in pp_sort M embedvar.h M intrpvar.h M perl.c M pp_sort.c M util.c M util.h ----------------------------------------------------------------------- -- Perl5 Master Repository
