On Nov 30 14:36:37, [email protected] wrote:
> On Mon, Nov 30, 2015 at 02:26:38PM +0100, Jan Stary wrote:
> > On Nov 30 14:16:02, [email protected] wrote:
> > > On Nov 23 13:17:43, [email protected] wrote:
> > > > Declared usage() as __dead since it won't return, instructions() called
> > > > a handrolled pager (/bin/cat) using fork which I replaced for a simple
> > > > cicle of while(fgets) then fputs (greatly inspired, to not saying it was
> > > > bluntly copied, by a previous patch sent by tedu@ for another
> > > > application).
> > > > After instructions() function is run then fish(6) only needs pledge
> > > > "stdio".
> > >
> > > On Nov 30 01:42:03, [email protected] wrote:
> > > > slightly interesting pledge for fish:
> > > > start with "stdio rpath proc exec" since it pipes instructions to a
> > > > pager
> > > > afterwards "stdio" is enough
> > >
> > > - just put the six lines of instructions into the manpage where they
> > > belong
> > > - remove fish.instr, remove instructions()
> > > - make the pledge a straightforward "stdio"
> > >
> > > This is what we did with quiz(6) before,
> > > and what I'm gonna do next with wump(6) and every other game
> > > which forks a PAGER just to spit out a help message.
> > > http://marc.info/?l=openbsd-tech&m=144576581513053&w=2
>
> I disagreed with that change and I don't quite see the benefit of this
> patch.
Some games pledge "proc exec" just to display a help message;
in the case of fish(6), it's simply "type the card value, 2 to A",
besides repeating the content of the manpage.
To do that, we need to install an extra file,
we need a function to read and PAGE that file,
we need to fork a process to do that, and pathnames.h
What is the benefit of _doing_ that?
> The recent churn in games was about the setgid bits which means
> we can't maintain the score files in /var/games as before, but it's NOT
> about minimizing pledge calls at all cost.
This is unrelated to the setgid changes.
> There also is a point to be made that games should be
> reasonably self-contained. Note also that there is quite
> a bit of charm lost by reducing the text to the sober minimum.
Agreed.
> Let's try to treat the games with some respect.
I surely mean no disrespect to the fish(6) or The Wumpus
by reducing their exec() possibilities :-)
Jan