Subject: bug#50191: Dired's G, O, T should not follow symlinks

From: Paul Eggert <[email-masked]>
Date: Tue, 24 Aug 2021 11:23:23 -0700

This follows up from Bug#11912.

The Dired commands G (dired-do-chgrp), O (dired-do-chown) and T 
(dired-do-touch) currently follow symbolic links. They should instead 
act on the symlinks themselves, as dired-do-chmod does; this better 
matches the visual experience of Dired.

Not all platforms support modifying these symlink attributes but many 
do, and Dired should support the ones that do, as it already does for 
symlink permissions and the M command.

Fixing this bug will also fix some security-relevant race-condition 
bugs, where an attacker with write access to a shared nonsticky 
directory can cause a Dired-using victim to chgrp, chown, and/or touch 
arbitrary files accessible to the victim.