if (status != NSS_STATUS_SUCCESS)
return status;
+ if (strcmp(name, grp->gr_name) != 0) {
+ syslog(LOG_ERR, "nss_nonlocal: discarding group %s from lookup for group %s\n", grp->gr_name, name);
+ return NSS_STATUS_NOTFOUND;
+ }
+
return check_nonlocal_gid(name, grp->gr_gid, errnop);
}
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;
#include <string.h>
#include <dlfcn.h>
#include <stdio.h>
+#include <syslog.h>
#include <errno.h>
#include <shadow.h>
#include <nss.h>
if (status == NSS_STATUS_TRYAGAIN && *errnop == ERANGE)
break;
} while (__nss_next(&nip, fct_name, &fct.ptr, status, 0) == 0);
- return status;
+ if (status != NSS_STATUS_SUCCESS)
+ return status;
+
+ if (strcmp(name, pwd->sp_namp) != 0) {
+ syslog(LOG_ERR, "nss_nonlocal: discarding shadow %s from lookup for shadow %s\n", pwd->sp_namp, name);
+ return NSS_STATUS_NOTFOUND;
+ }
+
+ return NSS_STATUS_SUCCESS;
}