From 8217fbf4bd45fa829fde33bc0b0cfabf34eac50b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 8 Apr 2024 18:29:13 +0900 Subject: [PATCH] [ruby/tmpdir] Display the offending parent path in the exception https://github.com/ruby/tmpdir/commit/7751b12e97 --- lib/tmpdir.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb index 65c86e9b90..fe3e0e19d1 100644 --- a/lib/tmpdir.rb +++ b/lib/tmpdir.rb @@ -107,9 +107,10 @@ class Dir yield path.dup ensure unless base - stat = File.stat(File.dirname(path)) + base = File.dirname(path) + stat = File.stat(base) if stat.world_writable? and !stat.sticky? - raise ArgumentError, "parent directory is world writable but not sticky" + raise ArgumentError, "parent directory is world writable but not sticky: #{base}" end end FileUtils.remove_entry path