]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
login: check lastlog lseek return code [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 12 Dec 2012 10:48:08 +0000 (11:48 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 12 Dec 2012 10:49:46 +0000 (11:49 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/login.c

index 534da4250706d306bee394ae8b2e3be4564b6018..a17083b5f8b30c3377bccddc514fc11eef3fa661 100644 (file)
@@ -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