Index | Thread | Search

From:
Philip Guenther <guenther@gmail.com>
Subject:
Re: tty(1): return status 2 if unveil(2) or pledge(2) fail
To:
Scott Cheloha <scottcheloha@gmail.com>
Cc:
tech@openbsd.org
Date:
Sun, 5 May 2024 19:12:01 -0700

Download raw body.

Thread
ok guenther@

On Sun, May 5, 2024 at 1:38 PM Scott Cheloha <scottcheloha@gmail.com> wrote:

> On error, tty(1) returns >1, not 1.
>
> ok?
>
> Index: tty.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/tty/tty.c,v
> diff -u -p -r1.13 tty.c
> --- tty.c       4 Dec 2022 23:50:50 -0000       1.13
> +++ tty.c       5 May 2024 20:24:48 -0000
> @@ -57,9 +57,9 @@ main(int argc, char *argv[])
>         }
>
>         if (unveil(_PATH_DEVDB, "r") == -1)
> -               err(1, "unveil %s", _PATH_DEVDB);
> +               err(2, "unveil %s", _PATH_DEVDB);
>         if (pledge("stdio rpath", NULL) == -1)
> -               err(1, "pledge");
> +               err(2, "pledge");
>
>         t = ttyname(STDIN_FILENO);
>         if (!sflag)
>
>