[sysadmin-bin] SSSd group membership is buggy :(
- From: Olav Vitters <ovitters src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] SSSd group membership is buggy :(
- Date: Sat, 2 Apr 2011 15:21:38 +0000 (UTC)
commit ebaf4be97b3b60579ce786f6d965e5d1f1b53bda
Author: Olav Vitters <olav vitters nl>
Date: Sat Apr 2 17:21:32 2011 +0200
SSSd group membership is buggy :(
create-auth | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/create-auth b/create-auth
index f2e5165..da7d09c 100755
--- a/create-auth
+++ b/create-auth
@@ -132,15 +132,18 @@ def get_uids_from_wheel():
return set(filter (lambda x: x != 'root', people))
_cache_group = {}
-def get_uids_from_group(group):
+def get_uids_from_group(group, force_ldap=False):
if group in _cache_group:
return _cache_group[group]
- try:
- people = set(grp.getgrnam (group)[3])
- except KeyError:
- # Server doesn't have an LDAP connection -- probably the label server
+ if force_ldap:
people = _get_group_from_ldap(group)
+ else:
+ try:
+ people = set(grp.getgrnam (group)[3])
+ except KeyError:
+ # Server doesn't have an LDAP connection -- probably the label server
+ people = _get_group_from_ldap(group)
people.discard('root')
people.discard('sysadmin')
@@ -169,13 +172,13 @@ def build_user_hash(group_list, restrict=None):
users.update(wheel)
users.update(sysadmin)
for group in group_list:
- users.update(get_uids_from_group(group))
+ users.update(get_uids_from_group(group, force_ldap=True))
if restrict in ('gnomegit', 'gnomegit-i18n', 'mango'):
- gnomevcs_users = (get_uids_from_group('gnomecvs') | get_uids_from_group('gnomevcs')) - users
+ 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 == 'rrsync':
- gnomevcs_users = get_uids_from_group('ftpbasic') - users
+ 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]