(Closes: #527765)
- do permissions checks with a perl script instead of non-portable
readlink GNUisms
+ - bail on permissions check if we hit the home directory (helpful on
+ Mac OS and other systems with loose /home or /Users (closes MS #675)
-- Daniel Kahn Gillmor <dkg@fifthhorseman.net> Sat, 01 Aug 2009 13:21:43 -0400
return sprintf("improper other writability on '%s'", $path);
}
+ # see the rationalization in secure_filename() in auth.c in the
+ # OpenSSH sources for an explanation of this bailout (see also
+ # monkeysphere #675):
+ if ($path eq $user->dir) {
+ debug("stopping at the %s's home directory '%s'\n", $user->name, $path);
+ return undef;
+ }
+
my $nextlevel = dirname($path);
if ($path eq $nextlevel) { # we bottom out at the root (/ in UNIX)
return undef;