]> granicus.if.org Git - shadow/commitdiff
Make sure that the prefix is the name of a directory (not only the
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 17 Nov 2007 21:24:06 +0000 (21:24 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 17 Nov 2007 21:24:06 +0000 (21:24 +0000)
beginning of a directory).
Openwall patch shadow-4.0.4.1-owl-userdel-path_prefix.diff.

ChangeLog
src/userdel.c

index 43e04ecce158854c310f1442665ded941b516b19..a884f4dd94fa1aa002d6d4c20b3486a9b193ea05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-17  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/userdel.c (path_prefix): Make sure that the prefix is the
+       name of a directory (not only the beginning of a directory).
+       Openwall patch shadow-4.0.4.1-owl-userdel-path_prefix.diff.
+
 2007-11-17  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/newgrp.c: Do not give an indication that the group has no
index 44935aa2b5b9d34c7a77a6e443c7d02869c3120a..9abaa2835f4bc6c9f5adfdd992df2bd70dcbd7c4 100644 (file)
@@ -542,7 +542,8 @@ static void user_cancel (const char *user)
 #ifdef EXTRA_CHECK_HOME_DIR
 static int path_prefix (const char *s1, const char *s2)
 {
-       return (strncmp (s2, s1, strlen (s1)) == 0);
+       return (strncmp (s2, s1, strlen (s1)) == 0 &&
+               (s2[strlen (s1)] == '\0' || s2[strlen (s1)] == '/'));
 }
 #endif