]> granicus.if.org Git - sudo/commitdiff
Do not fail if ttyname() cannot determine the tty but sudo can.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 11 Sep 2013 17:20:05 +0000 (11:20 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 11 Sep 2013 17:20:05 +0000 (11:20 -0600)
Should fix problems with running "make check" under pbuilder.

src/regress/ttyname/check_ttyname.c

index 43bdb7bce96343d8b505147c8952efef27743397..be381dd4dcf32342a194f65878946fae50f72377 100644 (file)
@@ -67,7 +67,9 @@ main(int argc, char *argv[])
     if ((tty_sudo = get_process_ttyname()) == NULL)
        tty_sudo = estrdup("none");
 
-    if (strcmp(tty_libc, tty_sudo) == 0) {
+    if (strcmp(tty_libc, "none") == 0) {
+       printf("%s: SKIP (%s)\n", getprogname(), tty_sudo);
+    } else if (strcmp(tty_libc, tty_sudo) == 0) {
        printf("%s: OK (%s)\n", getprogname(), tty_sudo);
     } else {
        printf("%s: FAIL %s (sudo) vs. %s (libc)\n", getprogname(),