You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cd builtin checks whether your user ID can read a directory, or whether your actual group ID can read a directory, or whether "others" can read a directory, but it doesn't check the other groups your ID may be a member of.
% id
uid=1001(lmc) gid=1001(lmc) groups=1001(lmc),27(sudo),998(vboxsf)
% ls -ld host
drwxrwx--- 1 root vboxsf 640 Sep 16 03:48 host/
% cd host
=> error 1
Rip out the body of interp.hasPermissionToDir and replace it with just a
call to unix.Access(path, unix.X_OK).
Update the function signature of hasPermissionToDir in os_notunix.go,
too.
Fixes#1033.
The
cd
builtin checks whether your user ID can read a directory, or whether your actual group ID can read a directory, or whether "others" can read a directory, but it doesn't check the other groups your ID may be a member of.It looks like you need to check user.User.GroupIds() (https://pkg.go.dev/os/user#User.GroupIds) too/instead.
The text was updated successfully, but these errors were encountered: