No netgroup support

Bug #179919 reported by Ryan Lovett
2
Affects Status Importance Assigned to Milestone
auth-client-config
Fix Released
Wishlist
Jamie Strandboge

Bug Description

The script does not handle

  netgroup: ldap

in /etc/nsswitch.conf via nss_netgroup.

Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote :

--- auth-client-config- 2007-08-15 09:58:26.000000000 -0700
+++ auth-client-config 2008-01-02 11:17:38.000000000 -0800
@@ -118,7 +118,7 @@
                lines = readFile(orig)
                for line in lines:
                        if t == "nss":
- for n in ['passwd', 'group', 'shadow']:
+ for n in ['passwd', 'group', 'shadow', 'netgroup']:
                                        pat = re.compile(r"^\s*" + n + ":")
                                        if pat.search(line):
                                                current["nss_" + n] = line + "\n"
@@ -626,7 +626,7 @@
        def findProfiles(self, lines):
                entries = {}
                for line in lines:
- for t in ['passwd', 'group', 'shadow']:
+ for t in ['passwd', 'group', 'shadow', 'netgroup']:
                                pat = re.compile(r"^\s*" + t + ":")
                                if pat.search(line):
                                        for x in self.inDatabase("nss_" + t, line):
@@ -696,6 +696,8 @@
                        raise accError("'nss_group' not found")
                if not self.updates.has_key('nss_shadow'):
                        raise accError("'nss_shadow' not found")
+ if not self.updates.has_key('nss_netgroup'):
+ raise accError("'nss_netgroup' not found")

                try:
                        fns = openFiles(self.config)
@@ -730,7 +732,7 @@
                                continue

                        wrote_line = False
- for t in ['passwd', 'group', 'shadow']:
+ for t in ['passwd', 'group', 'shadow', 'netgroup']:
                                pat = re.compile(r"^\s*" + t + ":")
                                if pat.search(line):
                                        if doComment:
@@ -756,7 +758,7 @@
                lines = readFile(fns['orig'])
                entries = {}
                for line in lines:
- for t in ['passwd', 'group', 'shadow']:
+ for t in ['passwd', 'group', 'shadow', 'netgroup']:
                                pat = re.compile(r"^\s*" + t + ":")
                                if pat.search(line):
                                        if entries.has_key(t):
@@ -770,7 +772,7 @@
                except:
                        raise

- for k in ['passwd', 'group', 'shadow']:
+ for k in ['passwd', 'group', 'shadow', 'netgroup']:
                        if not entries.has_key(k):
                                raise accError("'" + os.path.basename(file) + "' doesn't have an entry for '" + k + "'")

Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote :

Copy/paste into the form borked indentation.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thank you for taking the time to create this bug report and submit a patch. I am sorry that I didn't get to it sooner. Would you be able to attach the diff? Thanks!

Changed in auth-client-config:
status: New → In Progress
assignee: nobody → jamie-strandboge
importance: Undecided → Wishlist
Changed in auth-client-config:
status: In Progress → Incomplete
Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote :
Changed in auth-client-config:
status: Incomplete → In Progress
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thank you for your patch. A slightly reworked version has been committed.

Changed in auth-client-config:
status: In Progress → Fix Committed
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

 27. By Jamie Strandboge 1 hour ago

    add netgroup support based on patch from from Ryan Lovett (LP: #179919)
    updated tests for netgroup
    updated run_tests.sh ro be more informative
    update acc-default to have netgroup

Changed in auth-client-config:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.