]> andersk Git - nss_nonlocal.git/blobdiff - nonlocal-passwd.c
Check that a nonlocal lookup by name returns the right name.
[nss_nonlocal.git] / nonlocal-passwd.c
index e915ea0a2fa15d4b1ffe22f1812e8781806a19f7..29e922be62c42d2828b65ad71dc89fd78727920c 100644 (file)
@@ -329,6 +329,11 @@ _nss_nonlocal_getpwnam_r(const char *name, struct passwd *pwd,
     if (status != NSS_STATUS_SUCCESS)
        return status;
 
+    if (strcmp(name, pwd->pw_name) != 0) {
+       syslog(LOG_ERR, "nss_nonlocal: discarding user %s from lookup for user %s\n", pwd->pw_name, name);
+       return NSS_STATUS_NOTFOUND;
+    }
+
     status = check_nonlocal_uid(name, pwd->pw_uid, errnop);
     if (status != NSS_STATUS_SUCCESS)
        return status;
This page took 0.041103 seconds and 4 git commands to generate.