summaryrefslogtreecommitdiffstats
path: root/login-utils/login.c
diff options
context:
space:
mode:
authorKarel Zak2012-12-12 11:48:08 +0100
committerKarel Zak2012-12-12 11:49:46 +0100
commit83d02ed2931feecb3e13e86ce710c8e422193d45 (patch)
treee56d67e0a1fee1215f09a27ad831e550a310df99 /login-utils/login.c
parentchsh: use return rather than exit in main, clean up man page (diff)
downloadkernel-qcow2-util-linux-83d02ed2931feecb3e13e86ce710c8e422193d45.tar.gz
kernel-qcow2-util-linux-83d02ed2931feecb3e13e86ce710c8e422193d45.tar.xz
kernel-qcow2-util-linux-83d02ed2931feecb3e13e86ce710c8e422193d45.zip
login: check lastlog lseek return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils/login.c')
-rw-r--r--login-utils/login.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/login-utils/login.c b/login-utils/login.c
index 534da4250..a17083b5f 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -506,7 +506,8 @@ static void log_lastlog(struct login_context *cxt)
if (fd < 0)
return;
- lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET);
+ if (lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET) == -1)
+ return;
/*
* Print last log message