aboutsummaryrefslogtreecommitdiffstats
path: root/key2root-lskeys.c
diff options
context:
space:
mode:
Diffstat (limited to 'key2root-lskeys.c')
-rw-r--r--key2root-lskeys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/key2root-lskeys.c b/key2root-lskeys.c
index 7dee003..69e6319 100644
--- a/key2root-lskeys.c
+++ b/key2root-lskeys.c
@@ -91,7 +91,7 @@ listkeys(int dir, const char *user)
}
}
r = read(fd, &data[whead], size - whead);
- if (r <= 0) {
+ if (r < 0) {
fprintf(stderr, "%s: read /etc/key2root/%s: %s\n", argv0, user, strerror(errno));
close(fd);
return 1;
@@ -102,8 +102,10 @@ listkeys(int dir, const char *user)
failed |= outputkey(data, whead, &rhead, &rhead2, &lineno, user);
}
- if (rhead != whead)
+ if (rhead != whead) {
fprintf(stderr, "%s: file truncated: /etc/key2root/%s\n", argv0, user);
+ failed = 1;
+ }
close(fd);
return failed;