]> granicus.if.org Git - sudo/commitdiff
Use userpw_matches() to compare usernames, not strcmp(), since the latter
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 15 Nov 2004 14:59:03 +0000 (14:59 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 15 Nov 2004 14:59:03 +0000 (14:59 +0000)
checks for "#uid".

match.c

diff --git a/match.c b/match.c
index ca04a33c9d91110e48335e3a6e9ad4d05fd23e7d..3307ac4316cdc7162f31fadab6a97d631791696a 100644 (file)
--- a/match.c
+++ b/match.c
@@ -128,7 +128,7 @@ user_matches(pw, list)
                    matched = !m->negated;
                break;
            case WORD:
-               if (strcmp(m->name, pw->pw_name) == 0)
+               if (userpw_matches(m->name, pw->pw_name, pw))
                    matched = !m->negated;
                break;
        }
@@ -147,7 +147,7 @@ runas_matches(pw, list)
     struct member *list;
 {
     if (list == NULL)
-       return(strcmp(pw->pw_name, def_runas_default) == 0);
+       return(userpw_matches(def_runas_default, pw->pw_name, pw));
     return(user_matches(pw, list));
 }