From 2083baf13b9629668a516f4932a2433102bce45e Mon Sep 17 00:00:00 2001 From: jung Date: Mon, 3 Aug 2015 19:14:56 +0000 Subject: [PATCH] remove sudo as run dependency and switch to doas in readme and scripts ok sthen deraadt --- emulators/qemu/Makefile | 6 ++---- emulators/qemu/files/qemu-ifdown | 2 +- emulators/qemu/files/qemu-ifup | 2 +- emulators/qemu/pkg/README | 21 +++++++++++---------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile index 76a6d50af3b..ebc937f294e 100644 --- a/emulators/qemu/Makefile +++ b/emulators/qemu/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.125 2015/07/28 09:51:20 sthen Exp $ +# $OpenBSD: Makefile,v 1.126 2015/08/03 19:14:56 jung Exp $ ONLY_FOR_ARCHS= amd64 i386 powerpc sparc64 COMMENT= multi system emulator DISTNAME= qemu-2.2.1 -REVISION= 1 +REVISION= 2 CATEGORIES= emulators MASTER_SITES= http://wiki.qemu.org/download/ EXTRACT_SUFX= .tar.bz2 @@ -38,8 +38,6 @@ LIB_DEPENDS= devel/dtc>=1.3.0 \ security/libssh2 \ x11/gtk+2 -RUN_DEPENDS= security/sudo - MODPY_RUNDEP= No MAKE_ENV= V=1 diff --git a/emulators/qemu/files/qemu-ifdown b/emulators/qemu/files/qemu-ifdown index 24be8f5dd82..44f589daea9 100644 --- a/emulators/qemu/files/qemu-ifdown +++ b/emulators/qemu/files/qemu-ifdown @@ -8,7 +8,7 @@ _BRIDGE=bridge0 [ "$ETHER" ] || ETHER=${_ETHER} if test `id -u` -ne 0; then - SUDO=sudo + SUDO=doas fi $SUDO ifconfig $BRIDGE del $1 > /dev/null 2>&1 diff --git a/emulators/qemu/files/qemu-ifup b/emulators/qemu/files/qemu-ifup index f89ce2b8f4f..f09a3b1f485 100644 --- a/emulators/qemu/files/qemu-ifup +++ b/emulators/qemu/files/qemu-ifup @@ -9,7 +9,7 @@ _BRIDGE=bridge0 [ "$ETHER" ] || ETHER=${_ETHER} if test `id -u` -ne 0; then - SUDO=sudo + SUDO=doas fi echo -n " {$1 ($BRIDGE <-> $ETHER)" diff --git a/emulators/qemu/pkg/README b/emulators/qemu/pkg/README index ac5fb2b935a..5aaf0376f01 100644 --- a/emulators/qemu/pkg/README +++ b/emulators/qemu/pkg/README @@ -1,4 +1,4 @@ -$OpenBSD: README,v 1.10 2013/01/03 08:30:54 brad Exp $ +$OpenBSD: README,v 1.11 2015/08/03 19:14:56 jung Exp $ +----------------------------------------------------------------------- | Running ${FULLPKGNAME} on OpenBSD @@ -96,27 +96,28 @@ $OpenBSD: README,v 1.10 2013/01/03 08:30:54 brad Exp $ descriptor to QEMU. The tun(4) interface should preferrably be configured before starting QEMU: - $ sudo ifconfig tun0 192.168.0.254 link0 + $ doas ifconfig tun0 192.168.0.254 link0 The interface can also be configured as part of a bridge(4), in which case the ip address can be omitted: - $ sudo ifconfig tun0 link0 - $ sudo ifconfig bridge0 add tun0 add em0 up + $ doas ifconfig tun0 link0 + $ doas ifconfig bridge0 add tun0 add em0 up The tunnel and bridge interfaces can also be configured at system startup by editing /etc/hostname.tunN and /etc/hostname.bridgeN, respectively (see hostname.if(5)). - After configuring the virtual network we can use sudo to let - root open the tunnel device and then use sudo again to drop + After configuring the virtual network we can use doas to let + root open the tunnel device and then use doas again to drop privileges and start QEMU: - $ sudo sh -c "sudo -u $USER qemu-system-i386 -nographic -net nic \ + $ doas sh -c "doas -u $USER qemu-system-i386 -nographic -net nic \ -net tap,fd=3 -no-fd-bootchk -hda virtual.img 3<>/dev/tun0" - NOTE: sudo calls closefrom(2). In order to have more than one - fd passed tap interface, a line to sudoers akin to: + NOTE: if you use sudo instead of doas, remember that sudo calls + closefrom(2). In order to have more than one fd passed tap + interface, a line to sudoers akin to: Defaults closefrom_override @@ -250,7 +251,7 @@ $OpenBSD: README,v 1.10 2013/01/03 08:30:54 brad Exp $ ifconfig tun0 link0 ifconfig bridge101 add trunk101 add tun0 up - sh -c "sudo -u $USER \ + sh -c "doas -u $USER \ ${TRUEPREFIX}/bin/qemu-system-i386 \ -daemonize \ -nographic \