On Mon, Jan 21, 2019 at 09:27:57PM +0100, Landry Breuil wrote:
> Hi,
>
Hi,
> now that the 'video' promise is in, looking for okays to pledge
> video(1).
>
> with help & hints from semarie@.
One comment in-line.
>
> Index: video.c
> ===================================================================
> RCS file: /cvs/xenocara/app/video/video.c,v
> retrieving revision 1.25
> diff -u -r1.25 video.c
> --- video.c 9 Apr 2018 18:16:44 -0000 1.25
> +++ video.c 30 Dec 2018 09:39:27 -0000
> @@ -1961,6 +1961,8 @@
> argv += optind;
>
> if (vid.mode & M_QUERY) {
> + if (pledge("stdio rpath wpath video", NULL) == -1)
> + err(1, "pledge");
> dev_dump_query(&vid);
> cleanup(&vid, 0);
> }
> @@ -1970,6 +1972,14 @@
>
> if (!setup(&vid))
> cleanup(&vid, 1);
> +
> + if (vid.mode & M_IN_FILE) {
> + if (pledge("stdio", NULL) == -1)
Like people have found out the hard way recently, X libs need "rpath"
in case the X error handler needs to be called.
> + err(1, "pledge");
> + } else {
> + if (pledge("stdio rpath video", NULL) == -1)
> + err(1, "pledge");
> + }
>
> if (!stream(&vid))
> cleanup(&vid, 1);
--
Matthieu Herrb