]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: stat() returns precisely -1 to indicate error
authorderaadt@openbsd.org <deraadt@openbsd.org>
Thu, 4 Jul 2019 16:16:51 +0000 (16:16 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 5 Jul 2019 01:15:30 +0000 (11:15 +1000)
OpenBSD-Commit-ID: 668e8d022ed4ab847747214f64119e5865365fa1

sshpty.c

index 715035257c9e3d34a727d9eec5bdc4663c09d95e..a625e474ee04690ea92420eb43bf87f73941b9f1 100644 (file)
--- a/sshpty.c
+++ b/sshpty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshpty.c,v 1.32 2019/06/28 13:35:04 deraadt Exp $ */
+/* $OpenBSD: sshpty.c,v 1.33 2019/07/04 16:16:51 deraadt Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -179,7 +179,7 @@ pty_setowner(struct passwd *pw, const char *tty)
         * Warn but continue if filesystem is read-only and the uids match/
         * tty is owned by root.
         */
-       if (stat(tty, &st))
+       if (stat(tty, &st) == -1)
                fatal("stat(%.100s) failed: %.100s", tty,
                    strerror(errno));