Re: Attempt to simplify file(1)

2017-06-27 Thread Bryan Steele
On Tue, Jun 27, 2017 at 11:40:49PM +0100, Nicholas Marriott wrote: > Thanks. Comments inline. > > > [..] > > One member per line in structs please. Also you could reduce the amount > of space here now to one tab. > > > [..] > > magic_load (which parses the magic file) is now before pledge and > pr

Re: Attempt to simplify file(1)

2017-06-27 Thread Nicholas Marriott
Thanks. Comments inline. On Tue, Jun 27, 2017 at 06:28:57AM -0400, Bryan Steele wrote: > On Tue, Jun 27, 2017 at 01:20:59AM -0400, Bryan Steele wrote: > > On Tue, Jun 27, 2017 at 12:26:08AM -0400, Bryan Steele wrote: > > Some unintentional changes crept in, here's another diff.. > > Sorry, last d

Re: Attempt to simplify file(1)

2017-06-27 Thread Theo de Raadt
> OpenBSD's file(1) implementation was written by nicm@, first introduced > in 5.8, the inital design included a privileged parent process which > forked an unprivileged child which would handle potentially unsafe > file parsing. > > It also had 'sandboxing' using systrace(4), which required compl

Re: Attempt to simplify file(1)

2017-06-27 Thread Ted Unangst
Bryan Steele wrote: > OpenBSD's file(1) implementation was written by nicm@, first introduced > in 5.8, the inital design included a privileged parent process which > forked an unprivileged child which would handle potentially unsafe > file parsing. > > It also had 'sandboxing' using systrace(4),

Re: Attempt to simplify file(1)

2017-06-27 Thread Bryan Steele
On Tue, Jun 27, 2017 at 01:20:59AM -0400, Bryan Steele wrote: > On Tue, Jun 27, 2017 at 12:26:08AM -0400, Bryan Steele wrote: > Some unintentional changes crept in, here's another diff.. Sorry, last diff broke width calculation.. 3rd times the charm. Index: Makefile ==

Re: Attempt to simplify file(1)

2017-06-26 Thread Bryan Steele
On Tue, Jun 27, 2017 at 12:26:08AM -0400, Bryan Steele wrote: > OpenBSD's file(1) implementation was written by nicm@, first introduced > in 5.8, the inital design included a privileged parent process which > forked an unprivileged child which would handle potentially unsafe > file parsing. > > It

Attempt to simplify file(1)

2017-06-26 Thread Bryan Steele
OpenBSD's file(1) implementation was written by nicm@, first introduced in 5.8, the inital design included a privileged parent process which forked an unprivileged child which would handle potentially unsafe file parsing. It also had 'sandboxing' using systrace(4), which required complex parent/ch