diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-04-08 18:29:13 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-04-08 11:05:40 +0000 |
| commit | 8217fbf4bd45fa829fde33bc0b0cfabf34eac50b (patch) | |
| tree | 0c281e71e76dbcc499fd2ec777d2f290b2158ea5 /lib | |
| parent | 76efed65bd905c68c6b3f34d304a30359afae433 (diff) | |
[ruby/tmpdir] Display the offending parent path in the exception
https://github.com/ruby/tmpdir/commit/7751b12e97
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/tmpdir.rb | 5 |
1 files 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 |
