berdav / CVE-2021-4034

CVE-2021-4034 1day
MIT License
1.94k stars 508 forks source link

Makefile: Force `cp` to overwrite the existing one #19

Closed owl4ce closed 2 years ago

owl4ce commented 2 years ago
This fixes when the permissions of `true` on some Linux systems doesn't
have write privileges, while the permissions are fully preserved by cp.

On my Gentoo system, coreutils uses multicall, where the content of /bin/true is just a shebang with arguments and no write permissions. This only applies if wants to make again without cleaning it first (one-liner).

$ file /bin/true
/bin/true: a /usr/bin/coreutils --coreutils-prog-shebang=true script, ASCII text executable
$ getfacl /bin/true
getfacl: Removing leading '/' from absolute path names
# file: bin/true
# owner: root
# group: root
user::r-x
group::r-x
other::r-x
berdav commented 2 years ago

Hi, thank you, seems fine to me.

cp -f is POSIX compatible, so i don't think it will generate problems with any distro.

Merged.