Jake Champlin wrote:
> - readscores(1);
> penalty = loot = 0;
> initscr();
> + if (unveil(scorepath, "rwc") == -1)
> + err(1, "unveil");
> +#ifdef LOGGING
> + if (unveil(logpath, "rwc") == -1)
> + err(1, "unveil");
> + logfile = fopen(logpath, "a");
> +#endif
> + readscores(1);
>
> if (pledge("stdio tty", NULL) == -1)
> err(1, "pledge");
We're unveiling the same file we're going to immediately open. And then we
never open it later, as proved by pledge without rpath. There doesn't seem to
be any benefit in this case.
If we needed to reopen these files at some later point, this would be the
right thing.