[Server-devel] [PATCH] postproces.py: tighter homedir pattern matching
martin.langhoff at gmail.com
martin.langhoff at gmail.com
Mon Jun 30 15:11:49 EDT 2008
From: Martin Langhoff <martin at laptop.org>
using startswith is tighter, less ambiguous than
a RE. Thanks to Michael Stone <mstone at laptop.org>
for the idea.
---
server/postprocess.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/server/postprocess.py b/server/postprocess.py
index b6d91bc..9556655 100755
--- a/server/postprocess.py
+++ b/server/postprocess.py
@@ -45,7 +45,7 @@ if not re.match('\w+$', fname):
# if the user is not found
user = pwd.getpwnam(fname)
# match with /library/users
-if not re.match(homebasepath, user[5]):
+if not user[5].startswith(homebasepath):
exit(1)
# user uid must match file owner uid
if not (user[3] == os.stat(fpath)[4]):
--
1.5.6.dirty
More information about the Server-devel
mailing list