# $Header: /global/src/etc/cl-manage-scripts/patches/RCS/P-sudoers-xene,v 1.2 2025/03/21 15:19:26 mas90 Exp $
# patch-file matches : cl-asuser
# Process using /usr/bin/cl-patch-file unless matching the above
--- /etc/sudoers	2007-01-06 23:41:10.000000000 +0000
+++ /etc/sudoers	2008-03-02 18:47:55.000000000 +0000
@@ -21,4 +21,7 @@
 
 
+# cl.cam.ac.uk - commands such as asuser need the user groups preserved
+# cl.cam.ac.uk - (the default used to be to do it by default, for root only)
+Defaults preserve_groups
 ## Command Aliases
 ## These are groups of related commands...
@@ -82,4 +89,9 @@
 ## Allows people in group wheel to run all commands
 # %wheel	ALL=(ALL)	ALL
+# cl.cam.ac.uk - Note the order is important - the *LAST* match wins,
+# cl.cam.ac.uk - so to allow staff to be "users" as well, this comes FIRST.
+# cl.cam.ac.uk - allow members of group staff to run any cmd (using root pw)
+%sysadmin,%wheel,%staff ALL=(ALL) ALL
+%sysadmin,%wheel,%staff ALL=NOPASSWD: /opt/xensource/bin/xe
 
 ## Same thing without a password
@@ -92,3 +104,5 @@
 ## Allows members of the users group to shutdown this system
 # %users  localhost=/sbin/shutdown -h now
+# cl.cam.ac.uk - "user" of machine can do some extra things
+ALL	ALL=NOPASSWD: /usr/bin/cl-asuser
 
