Re: yacc + unveil

2018-10-07 Thread Michael Mikonos
Hello, Forwarding a newer patch that I came up with. This time unveil()s are done before pledge() so no subsequent pledge() is needed to remove the unveil promise. * temporary files are created & unlinked in /tmp, so unveil the directory * output_file_name is either -o PATH or the default of

Re: yacc + unveil

2018-09-25 Thread Michael Mikonos
On Tue, Sep 25, 2018 at 11:42:26PM +0800, Michael Mikonos wrote: > On Tue, Sep 25, 2018 at 05:25:54PM +0200, Sebastien Marie wrote: > > On Tue, Sep 25, 2018 at 11:15:43PM +0800, Michael Mikonos wrote: > > > On Tue, Sep 25, 2018 at 03:22:38PM +0100, Ricardo Mestre wrote: > > > > This is an example

Re: yacc + unveil

2018-09-25 Thread Michael Mikonos
On Tue, Sep 25, 2018 at 05:25:54PM +0200, Sebastien Marie wrote: > On Tue, Sep 25, 2018 at 11:15:43PM +0800, Michael Mikonos wrote: > > On Tue, Sep 25, 2018 at 03:22:38PM +0100, Ricardo Mestre wrote: > > > This is an example of better to start at just hoisting the code that > > > opens the many

Re: yacc + unveil

2018-09-25 Thread Sebastien Marie
On Tue, Sep 25, 2018 at 11:15:43PM +0800, Michael Mikonos wrote: > On Tue, Sep 25, 2018 at 03:22:38PM +0100, Ricardo Mestre wrote: > > This is an example of better to start at just hoisting the code that > > opens the many fds and put them all inside open_files(). After that it's > > just a matter

Re: yacc + unveil

2018-09-25 Thread Michael Mikonos
On Tue, Sep 25, 2018 at 03:22:38PM +0100, Ricardo Mestre wrote: > This is an example of better to start at just hoisting the code that > opens the many fds and put them all inside open_files(). After that it's > just a matter of calling pledge("stdio") and we are done. > > Of course that after

Re: yacc + unveil

2018-09-25 Thread Ricardo Mestre
This is an example of better to start at just hoisting the code that opens the many fds and put them all inside open_files(). After that it's just a matter of calling pledge("stdio") and we are done. Of course that after this is done we can still make a list of all the files we need to open and

Re: yacc + unveil

2018-09-25 Thread Theo de Raadt
Theo de Raadt wrote: > Michael Mikonos wrote: > > > On Mon, Sep 24, 2018 at 10:53:47PM -0600, Theo de Raadt wrote: > > > Ugh. A diff which doens't check error returns. Averting my gaze > > > is similar to "no way". Hope you have another quarter, because you > > > need to try again > > > >

Re: yacc + unveil

2018-09-25 Thread Theo de Raadt
Michael Mikonos wrote: > On Mon, Sep 24, 2018 at 10:53:47PM -0600, Theo de Raadt wrote: > > Ugh. A diff which doens't check error returns. Averting my gaze > > is similar to "no way". Hope you have another quarter, because you > > need to try again > > Oops... new coin inserted. I decided to

Re: yacc + unveil

2018-09-24 Thread Michael Mikonos
On Mon, Sep 24, 2018 at 10:53:47PM -0600, Theo de Raadt wrote: > Ugh. A diff which doens't check error returns. Averting my gaze > is similar to "no way". Hope you have another quarter, because you > need to try again Oops... new coin inserted. I decided to create a fatal_perror() function

Re: yacc + unveil

2018-09-24 Thread Theo de Raadt
Ugh. A diff which doens't check error returns. Averting my gaze is similar to "no way". Hope you have another quarter, because you need to try again Michael Mikonos wrote: > Hello, > > I haven't tried using unveil() before but yacc cleanly annotates > all the files it needs in open_files().

yacc + unveil

2018-09-24 Thread Michael Mikonos
Hello, I haven't tried using unveil() before but yacc cleanly annotates all the files it needs in open_files(). The options -d -r -v each cause an extra file to be written. unveil() is only needed for the input file if not reading from stdin. Temporary files are always under /tmp because TMPDIR