From nobody@FreeBSD.org  Sun Feb  3 14:43:24 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 02CCF51E
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  3 Feb 2013 14:43:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id E7562A45
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  3 Feb 2013 14:43:23 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r13EhMQc072756
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 3 Feb 2013 14:43:22 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r13EhM1A072755;
	Sun, 3 Feb 2013 14:43:22 GMT
	(envelope-from nobody)
Message-Id: <201302031443.r13EhM1A072755@red.freebsd.org>
Date: Sun, 3 Feb 2013 14:43:22 GMT
From: Olivier Cochard-Labbe <olivier@cochard.me>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Adding more tools to be used by operator group members (reboot, apm, acpiconf)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         175799
>Category:       bin
>Synopsis:       [patch] Adding more tools to be used by operator group members (reboot, apm, acpiconf)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 03 14:50:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Mon Feb 04 20:54:19 UTC 2013
>Originator:     Olivier Cochard-Labbe
>Release:        -current
>Organization:
>Environment:
FreeBSD bigdev.bsdrp.net 10.0-CURRENT FreeBSD 10.0-CURRENT #3 r245977M: Sun Jan 27 13:56:05 CET 2013     root@bigdev.bsdrp.net:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
There are only 2 useable tools by "operator" group members:
shutdown (and its child: poweroff, halt, etc) and mksnap_ffs.

On my HAL-less laptop, I've put my user in the operator group that let
me reboot/power-off it with shutdown.
But I would to be able to suspend-resume it too with zzz (that call apm and acpiconf).
Here is the list of tool useable by operator group:
/sbin/reboot/
/usr/sbin/apm
/usr/sbin/acpiconf

Here is the thread on the -current mailing-list regarding this proposal:
http://lists.freebsd.org/pipermail/freebsd-current/2013-January/039198.html
>How-To-Repeat:

>Fix:
By applying the simple attached patch.

Patch attached with submission follows:

Index: sbin/reboot/Makefile
===================================================================
--- sbin/reboot/Makefile	(revision 245914)
+++ sbin/reboot/Makefile	(working copy)
@@ -14,6 +14,10 @@
 MLINKS+= boot_i386.8 boot.8
 .endif
 
+BINOWN= root
+BINGRP= operator
+BINMODE=4550
+
 LINKS=	${BINDIR}/reboot ${BINDIR}/halt ${BINDIR}/reboot ${BINDIR}/fastboot \
 	${BINDIR}/reboot ${BINDIR}/fasthalt
 
Index: sys/amd64/conf/GENERIC
===================================================================
--- sys/amd64/conf/GENERIC	(revision 245914)
+++ sys/amd64/conf/GENERIC	(working copy)
@@ -80,11 +80,11 @@
 options 	DDB			# Support DDB.
 options 	GDB			# Support remote GDB.
 options 	DEADLKRES		# Enable the deadlock resolver
-options 	INVARIANTS		# Enable calls of extra sanity checking
-options 	INVARIANT_SUPPORT	# Extra sanity checks of internal structures, required by INVARIANTS
-options 	WITNESS			# Enable checks to detect deadlocks and cycles
-options 	WITNESS_SKIPSPIN	# Don't run witness on spinlocks for speed
-options 	MALLOC_DEBUG_MAXZONES=8	# Separate malloc(9) zones
+#options 	INVARIANTS		# Enable calls of extra sanity checking
+#options 	INVARIANT_SUPPORT	# Extra sanity checks of internal structures, required by INVARIANTS
+#options 	WITNESS			# Enable checks to detect deadlocks and cycles
+#options 	WITNESS_SKIPSPIN	# Don't run witness on spinlocks for speed
+#options 	MALLOC_DEBUG_MAXZONES=8	# Separate malloc(9) zones
 
 # Make an SMP-capable kernel by default
 options 	SMP			# Symmetric MultiProcessor Kernel
Index: usr.sbin/acpi/acpiconf/Makefile
===================================================================
--- usr.sbin/acpi/acpiconf/Makefile	(revision 245914)
+++ usr.sbin/acpi/acpiconf/Makefile	(working copy)
@@ -4,4 +4,8 @@
 PROG=	acpiconf
 MAN=	acpiconf.8
 
+BINOWN= root
+BINGRP= operator
+BINMODE=4550
+
 .include <bsd.prog.mk>
Index: usr.sbin/apm/Makefile
===================================================================
--- usr.sbin/apm/Makefile	(revision 245914)
+++ usr.sbin/apm/Makefile	(working copy)
@@ -5,4 +5,8 @@
 MLINKS=	apm.8 apmconf.8
 MANSUBDIR= /${MACHINE_CPUARCH}
 
+BINOWN= root
+BINGRP= operator
+BINMODE=4550
+
 .include <bsd.prog.mk>


>Release-Note:
>Audit-Trail:

From: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= <olivier@cochard.me>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/175799: Adding more tools to be used by operator group
 members (reboot, apm, acpiconf)
Date: Sun, 3 Feb 2013 15:54:53 +0100

 --bcaec5015f0913dbfc04d4d32a2e
 Content-Type: text/plain; charset=ISO-8859-1
 
 Oops, it was the wrong patch, here is the good one (that didn't touch
 the generic kernel config file).
 
 --bcaec5015f0913dbfc04d4d32a2e
 Content-Type: text/plain; charset=US-ASCII; name="More.use.of.operator.group.diff.txt"
 Content-Disposition: attachment; 
 	filename="More.use.of.operator.group.diff.txt"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_hcqbaojy0
 
 SW5kZXg6IHNiaW4vcmVib290L01ha2VmaWxlCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHNiaW4vcmVib290L01h
 a2VmaWxlCShyZXZpc2lvbiAyNDU5MTQpCisrKyBzYmluL3JlYm9vdC9NYWtlZmlsZQkod29ya2lu
 ZyBjb3B5KQpAQCAtMTQsNiArMTQsMTAgQEAKIE1MSU5LUys9IGJvb3RfaTM4Ni44IGJvb3QuOAog
 LmVuZGlmCiAKK0JJTk9XTj0gcm9vdAorQklOR1JQPSBvcGVyYXRvcgorQklOTU9ERT00NTUwCisK
 IExJTktTPQkke0JJTkRJUn0vcmVib290ICR7QklORElSfS9oYWx0ICR7QklORElSfS9yZWJvb3Qg
 JHtCSU5ESVJ9L2Zhc3Rib290IFwKIAkke0JJTkRJUn0vcmVib290ICR7QklORElSfS9mYXN0aGFs
 dAogCkluZGV4OiB1c3Iuc2Jpbi9hY3BpL2FjcGljb25mL01ha2VmaWxlCj09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0t
 IHVzci5zYmluL2FjcGkvYWNwaWNvbmYvTWFrZWZpbGUJKHJldmlzaW9uIDI0NTkxNCkKKysrIHVz
 ci5zYmluL2FjcGkvYWNwaWNvbmYvTWFrZWZpbGUJKHdvcmtpbmcgY29weSkKQEAgLTQsNCArNCw4
 IEBACiBQUk9HPQlhY3BpY29uZgogTUFOPQlhY3BpY29uZi44CiAKK0JJTk9XTj0gcm9vdAorQklO
 R1JQPSBvcGVyYXRvcgorQklOTU9ERT00NTUwCisKIC5pbmNsdWRlIDxic2QucHJvZy5taz4KSW5k
 ZXg6IHVzci5zYmluL2FwbS9NYWtlZmlsZQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSB1c3Iuc2Jpbi9hcG0vTWFr
 ZWZpbGUJKHJldmlzaW9uIDI0NTkxNCkKKysrIHVzci5zYmluL2FwbS9NYWtlZmlsZQkod29ya2lu
 ZyBjb3B5KQpAQCAtNSw0ICs1LDggQEAKIE1MSU5LUz0JYXBtLjggYXBtY29uZi44CiBNQU5TVUJE
 SVI9IC8ke01BQ0hJTkVfQ1BVQVJDSH0KIAorQklOT1dOPSByb290CitCSU5HUlA9IG9wZXJhdG9y
 CitCSU5NT0RFPTQ1NTAKKwogLmluY2x1ZGUgPGJzZC5wcm9nLm1rPgo=
 --bcaec5015f0913dbfc04d4d32a2e--
>Unformatted:
