ifconfig cannot be pledged because of its overwhelming amount of
authorflorian <florian@openbsd.org>
Wed, 8 Aug 2018 17:26:52 +0000 (17:26 +0000)
committerflorian <florian@openbsd.org>
Wed, 8 Aug 2018 17:26:52 +0000 (17:26 +0000)
commit25d1f99723f7b8169756c46419aefeb884c7c2f3
tree3f0ef0a0ad786a0cfa422db365543b5559e4c591
parent17f6cadc95492e12a7f9bad51d22d139b3795110
ifconfig cannot be pledged because of its overwhelming amount of
used ioctls. Furthermore due to the way the command line parser is
written it is difficult to apply the traditional first initialize then
pledge pattern.

unveil(2) gives us a different approach:
By veiling everything with unveil("/", "") and then locking down
unveil with unveil(NULL, NULL) we remove all filesystem access from
ifconfig kind of like giving a regular user a chroot without any
files.

OK deraadt
sbin/ifconfig/ifconfig.c