From 6a83ae102dc21ea93745ba74b5ea1bb693fedaa1 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Sat, 19 Oct 2024 00:07:31 +0200 Subject: [PATCH] Set current user as an owner for parent directories The problem happens in a Docker container with mounted case-sensitive APFS when running `miniperl_top "-I../../lib" -MExtUtils::Command -e 'mkpath' -- ../../lib/auto/lib as !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Can't create '../../lib/auto' Do not have write permissions on '../../lib/auto' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! where ../../lib/auto has root as an owner instead of the current user. The PR should fix the issue by setting the owner for all created directories. --- lib/File/Path.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 3f7545f..1818d94 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -94,6 +94,7 @@ sub mkpath { $paths = [$paths] unless UNIVERSAL::isa( $paths, 'ARRAY' ); $data->{verbose} = $verbose; $data->{mode} = defined $mode ? $mode : oct '777'; + $data->{owner} = $<; } else { my %args_permitted = map { $_ => 1 } ( qw|