summaryrefslogtreecommitdiff
path: root/modules/pam_loginuid/pam_loginuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_loginuid/pam_loginuid.c')
-rw-r--r--modules/pam_loginuid/pam_loginuid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/pam_loginuid/pam_loginuid.c b/modules/pam_loginuid/pam_loginuid.c
index 62dd3d59..6f5a6380 100644
--- a/modules/pam_loginuid/pam_loginuid.c
+++ b/modules/pam_loginuid/pam_loginuid.c
@@ -65,7 +65,7 @@ static int set_loginuid(pam_handle_t *pamh, uid_t uid)
fd = open("/proc/self/uid_map", O_RDONLY);
if (fd >= 0) {
count = pam_modutil_read(fd, uid_map, sizeof(uid_map));
- if (strncmp(uid_map, host_uid_map, count) != 0)
+ if (count <= 0 || strncmp(uid_map, host_uid_map, count) != 0)
rc = PAM_IGNORE;
close(fd);
}