]> 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:48:08 +0000 (11:48 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/login.c

index f5896dae8d4c9bf9df25b193ded181c572b41f6f..5e5010c6bc16bf63fea2ea0bc36fda28e6f667ed 100644 (file)
@@ -518,7 +518,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