mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-10 21:11:15 -03:00
The main changes are: - disabling some checks related to POSIX file permissions when a filesystem is mounted with "noacl" (default on MSYS2) - disabling some checks related to symlinks when using fake ones (file copy) Windows with acl hasn't been tested because 1) Cygwin itself does not have any Rust package yet to compile fish, and 2) MSYS2 defaults to `noacl` Part of #12171
26 lines
865 B
Fish
26 lines
865 B
Fish
#RUN: fish=%fish %fish %s
|
|
|
|
# Set a XDG_CONFIG_HOME with both pre-existing and non-existing directories.
|
|
set -l dir (mktemp -d)
|
|
mkdir -m 0755 $dir/old
|
|
set -gx XDG_CONFIG_HOME $dir/old/new
|
|
|
|
# Launch fish so it will create all missing directories.
|
|
$fish -c ''
|
|
|
|
# Check that existing directories kept their permissions, and new directories
|
|
# have the right permissions according to the XDG Base Directory Specification.
|
|
# Use command ls and awk to strip off xattr or SELinux indicators.
|
|
command ls -ld $dir/old | awk '{print substr($1, 1, 10)}'
|
|
# CHECK: drwxr-xr-x
|
|
|
|
set -l ls_result "$(command ls -ld $dir/old/new $dir/old/new/fish | awk '{print substr($1, 1, 10)}')"
|
|
if cygwin_noacl $dir
|
|
# No permission support => fake the result
|
|
string replace -a drwxr-xr-x drwx------ $ls_result
|
|
else
|
|
printf "%s" "$ls_result"
|
|
end
|
|
# CHECK: drwx------
|
|
# CHECK: drwx------
|