[sysadmin-bin] Add an extra entry for the nagios user, specifically for check_by_ssh to work properly.



commit afd1582a41c8e5e7944a3c0181da761ca09b8a1e
Author: Andrea Veri <av gnome org>
Date:   Tue Feb 26 19:12:54 2013 +0100

    Add an extra entry for the nagios user, specifically for check_by_ssh to work properly.

 create-auth |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/create-auth b/create-auth
index 9fc3406..6eeacfe 100755
--- a/create-auth
+++ b/create-auth
@@ -42,7 +42,9 @@ RESTRICTS = {
     'rrsync':
         'command="/home/admin/bin/run-rrsync-or-special-cmd 
/ftp/scratch",no-user-rc,no-pty,no-port-forwarding ',
     'gnomegit':
-        'command="/home/admin/bin/run-git-or-special-cmd",no-pty,no-port-forwarding '
+        'command="/home/admin/bin/run-git-or-special-cmd",no-pty,no-port-forwarding ',
+    'nagios':
+        'command="sudo /sbin/service httpd restart",no-pty,no-port-forwarding ',
 }
 LDAP_GROUP_BASE='ou=groups,dc=gnome,dc=org'
 LDAP_USER_BASE='ou=people,dc=gnome,dc=org'
@@ -319,11 +321,13 @@ def build_user_hash(group_list, restrict=None):
         gnomevcs_users = (get_uids_from_group('gnomecvs', force_ldap=True) | get_uids_from_group('gnomevcs', 
force_ldap=True)) - users
         if restrict == 'gnomegit+i18n':
             gnomevcs_users.update(['translations'])
+    elif restrict == 'nagios':
+       gnomevcs_users = get_uids_from_group('nagios', force_ldap=True) - users
     elif restrict == 'rrsync':
         gnomevcs_users = get_uids_from_group('ftpbasic', force_ldap=True) - users
 
     # look up their keys (if we have them)
-    user_data = lookup_user_info(users | gnomevcs_users)
+    user_data = lookup_user_info(users | gnomevcs_users | nagios_user)
 
     for uid in gnomevcs_users:
         if uid not in user_data:
@@ -425,7 +429,7 @@ if __name__ == '__main__':
     parser = OptionParser()
     parser.add_option("--restrict",
                       action="store", dest="restrict", default=None,
-                      choices=['gnomegit', 'mango', 'rrsync', 'gnomegit-i18n'],
+                      choices=['gnomegit', 'mango', 'rrsync', 'gnomegit-i18n', 'nagios'],
                       help="What type of restricted access to setup")
 
     parser.add_option("--gnomegit",
@@ -434,6 +438,8 @@ if __name__ == '__main__':
                       action="store_const", dest="restrict", const="rrsync")
     parser.add_option("--mango",
                       action="store_const", dest="restrict", const="mango")
+    parser.add_option("--nagios",
+                      action="store_const", dest="restrict", const="nagios")
     parser.add_option("--translation-user",
                       action="store_const", dest="restrict", const="gnomegit-i18n")
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]