Earlier today I ran a script I had tested for plan9port's rc, and instead of the intended behavior it deleted everything my user had perms to delete.
The issue is illustrated here in it's initial context:
euclaise@thinkpad fort $ rc ./build.9rc git
rc: /root: Permission denied
rc: /work: No such file or directory
/bin /boot /dev /etc /home /lib /lib64 /lost+found /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var
/bin /boot /dev /etc /home /lib /lib64 /lost+found /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var
euclaise@thinkpad fort $ 9 rc ./build.9rc git
/home/euclaise/Projects/fort/work/*
/home/euclaise/Projects/fort/root/*
euclaise@thinkpad fort $ cat build.9rc git
# This is a script for the Plan 9 'rc' shell.
# It is contained in the plan9port or 9base packages.
# Alternatively, it is sometimes available alone, such as in the AUR as 'rc'
root=`{pwd}/root
work=`{pwd}/work
echo $work/*
echo $root/*
exit
Details
The issue appears to be that plan9port's rc implicitly concatenates the `{pwd} and /root together, while this one doesn't:
euclaise@thinkpad fort $ rc git
; root=`{pwd}/root
rc: /root: Permission denied
euclaise@thinkpad fort $ 9 rc git
% root=`{pwd}/root
%
Background
Earlier today I ran a script I had tested for plan9port's rc, and instead of the intended behavior it deleted everything my user had perms to delete.
The issue is illustrated here in it's initial context:
Details
The issue appears to be that plan9port's rc implicitly concatenates the `
{pwd}
and/root
together, while this one doesn't: