Tested on a recent x86-64 and older i586 Porteus:
System Porteus 5.0rc2
cp V 8.32
My cp is aliased to
Code: Select all
guest@porteus:~$ alias cp
alias cp='/bin/cp -pi'
Code: Select all
same as --preserve=mode,ownership,timestamps
to a folder on an ext3 partition guest can write to:-rwxr-xr-x 1 root root 363 Dec 27 12:27 /usr/bin/ffplay-hide_banner
Code: Select all
guest@porteus:~$ cp /usr/bin/ffplay-hide_banner /mnt/ext3/porteus/debug/5.0xxx/
guest@porteus:~$ ls -l /usr/bin/ffplay-hide_banner /mnt/ext3/porteus/debug/5.0xxx/ffplay-hide_banner
-rwxr-xr-x 1 guest users 363 Dec 27 12:27 /mnt/ext3/porteus/debug/5.0xxx/ffplay-hide_banner
-rwxr-xr-x 1 root root 363 Dec 27 12:27 /usr/bin/ffplay-hide_banner
cp V 8.29
Code: Select all
guest@porteus:/mnt/sda3/tmp$ ls -ld .
drwxr-xr-t 5 guest users 4096 Dec 25 21:53 .
guest@porteus:/mnt/sda3/tmp$ alias cp
alias cp='cp -pi'
guest@porteus:/mnt/sda3/tmp$ ls -l /usr/local/bin/aliasset
-rw-r--r-- 1 root root 7256 Jan 30 2018 /usr/local/bin/aliasset
guest@porteus:/mnt/sda3/tmp$ cp /usr/local/bin/aliasset .
guest@porteus:/mnt/sda3/tmp$ ls -l aliasset
-rw-r--r-- 1 guest users 7256 Jan 30 2018 aliasset
guest@porteus:/mnt/sda3/tmp$ cp --version
cp (GNU coreutils) 8.29
[…]
According to cp --help at least the ownership should have been preserved.
Why is cp acting against what its explicitly told?