]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sulogin: check result of the open() [coverity scan]
authorKarel Zak <kzak@redhat.com>
Thu, 17 Jul 2014 12:42:00 +0000 (14:42 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 17 Jul 2014 12:42:00 +0000 (14:42 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/sulogin.c

index 15fb28b6a6aa3ab034e37286b9bf9f25c1a2edaa..0eb61d54ef72e0f5fc242708915c87179b211726 100644 (file)
@@ -97,6 +97,8 @@ static int plymouth_command(const char* arg)
        pid = fork();
        if (!pid) {
                int fd = open("/dev/null", O_RDWR);
+               if (fd < 0)
+                       exit(127);
                dup2(fd, 0);
                dup2(fd, 1);
                dup2(fd, 2);