# New Ticket Created by Christopher Bottoms
# Please include the string: [perl #128062]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=128062 >
# This is on 64-bit CentOS 7, but I have also observed this behavior on
# CentOS 6.7. User is "test" and has its own group called "test". It should
# therefore be possible possible to use "chdir" in Perl6 to change to a
# directory that has full privileges for its home group "test".
# First we see that "chdir" works when permissions are liberal
# The user "test" is not the user owner, but its group does own it.
[test@localhost tests]$ ls -ld path
drwxrwxr-x. 2 foo test 22 May 3 10:13 path
[test@localhost tests]$ perl6
To exit type 'exit' or '^D'
> chdir 'path'
"/home/test/tests/path".IO
> chdir '..'
"/home/test/tests".IO
# "chdir" doesn't work after removing "other" read/execute privileges
> shell('sudo chmod o-rx path');
...
> chdir 'path'
Failed to change the working directory to '/home/test/tests/path': did not pass
'd r' test
in block <unit> at <unknown file> line 1
> exit
# But the "test" user does belong to its own "test" group
[test@localhost tests]$ groups
test
# This is using Rakudo-Star 2016.04 on MoarVM 2016.04
[test@localhost tests]$ perl6 -v
This is Rakudo version 2016.04 built on MoarVM version 2016.04
implementing Perl 6.c.