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
fstat will not help: disklabel /dev/tty
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
> 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.
>
>
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
> 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.
>
>
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