Re: Pledge failure in disklabel(8)

2016-05-28 Thread Bob Beck
On Sat, May 28, 2016 at 10:02:27AM -0600, Theo de Raadt wrote: > fstat will not help: disklabel /dev/tty > Ok, apply against current and this does help. I've moved the readlabel() call before the pledge. ok? Index: disklabel.c

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Theo de Raadt
fstat will not help: disklabel /dev/tty

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Anthony Coulter
Oops, I did not check the return value of fstat. Good catch. But when I tested my change without yours, disklabel did not abort. Why then does opendev need to occur before the pledge? Is there another usage of disklabel that causes a different failure pattern? On 05/28/2016 11:31 AM, Theo

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Theo de Raadt
> If you try to run disklabel(8) on a file that is not a device, it aborts > aborts for want of pledge("ioctl"). This diff prints an error message > and exits cleanly. I return exit code 1 but note that sometimes > disklabel returns 4; the man page doesn't explain the distinction > anywhere. > >

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Bob Beck
On Sat, May 28, 2016 at 09:27:09AM -0600, Theo de Raadt wrote: > > If you try to run disklabel(8) on a file that is not a device, it aborts > > aborts for want of pledge("ioctl"). This diff prints an error message > > and exits cleanly. I return exit code 1 but note that sometimes > > disklabel

Re: Pledge failure in disklabel(8)

2016-05-28 Thread Theo de Raadt
> If you try to run disklabel(8) on a file that is not a device, it aborts > aborts for want of pledge("ioctl"). This diff prints an error message > and exits cleanly. I return exit code 1 but note that sometimes > disklabel returns 4; the man page doesn't explain the distinction > anywhere. > >

Pledge failure in disklabel(8)

2016-05-28 Thread Anthony Coulter
If you try to run disklabel(8) on a file that is not a device, it aborts aborts for want of pledge("ioctl"). This diff prints an error message and exits cleanly. I return exit code 1 but note that sometimes disklabel returns 4; the man page doesn't explain the distinction anywhere. $ disklabel