]> gitweb.michael.orlitzky.com - apply-default-acl.git/commitdiff
Naively ignore hard links to avoid security mishaps.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 22 Feb 2018 23:00:11 +0000 (18:00 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 23 Feb 2018 00:07:36 +0000 (19:07 -0500)
If an attacker can introduce a hard link into a directory with a
default ACL, then he may be able to trick the user into applying that
default ACL to the target of the hard link which lives somewhere else
entirely. That can be exploited to gain access to the user's files,
and is hard to detect.

To avoid that problem entirely, great care must be taken. For now, a
naive check of the target path is implemented to ensure that (at the
start of the routine) it has only one name on the filesystem. This
still admits a race condition, but is an improvement.

The new behavior is now documented in the man page, and a test has
been added to ensure that pre-existing hard links are ignored.


No differences found