Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/include/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ nss_module_register (const char *name, unsigned int *size, \

#define OSLOGIN_PASSWD_CACHE_PATH "/usr/local/etc/oslogin_passwd.cache"
#define OSLOGIN_GROUP_CACHE_PATH "/usr/local/etc/oslogin_group.cache"
#define PASSWD_PATH "/usr/local/etc/passwd"

#define K_DEFAULT_PFILE_PATH "/usr/local/etc/oslogin_passwd.cache"
#define K_DEFAULT_BACKUP_PFILE_PATH "/usr/local/etc/oslogin_passwd.cache.bak"
Expand All @@ -56,7 +55,6 @@ nss_module_register (const char *name, unsigned int *size, \

#define OSLOGIN_PASSWD_CACHE_PATH "/etc/oslogin_passwd.cache"
#define OSLOGIN_GROUP_CACHE_PATH "/etc/oslogin_group.cache"
#define PASSWD_PATH "/etc/passwd"

#define K_DEFAULT_PFILE_PATH "/etc/oslogin_passwd.cache"
#define K_DEFAULT_BACKUP_PFILE_PATH "/etc/oslogin_passwd.cache.bak"
Expand Down
6 changes: 1 addition & 5 deletions src/nss/nss_oslogin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,10 @@ enum nss_status _nss_oslogin_initgroups_dyn(const char *user, gid_t skipgroup,
gid_t **groupsp, long int limit,
int *errnop) {
// check if user exists in local passwd DB
FILE *p_file = fopen(PASSWD_PATH, "r");
if (p_file == NULL)
return NSS_STATUS_NOTFOUND;
struct passwd *userp;
while ((userp = fgetpwent(p_file)) != NULL)
while ((userp = getpwent()) != NULL)
if (strcmp(userp->pw_name, user) == 0)
return NSS_STATUS_NOTFOUND;
fclose(p_file);

std::vector<Group> grouplist;
if (!GetGroupsForUser(string(user), &grouplist, errnop)) {
Expand Down