Hi, Below is a patch to rhncfgcli_verify.py to make it handle orphaned GID's the same way as orphaned UID's are handled. I recently found out the current implementation raises a KeyError exception if an orphaned GID is encountered. This happens when rhncfg_client verify is run on a system on which one of the deployed configuration files is owned by a group that doesn't exist (anymore).
Patch is basically an adaptation of the code that handles UID's in the same file, about ten lines up. I usually spend my time being an sysadmin, so I hope I'm doing this 'sending patch' stuff the right way ;-) Hope this helps. Maxim Burgerhout [email protected] ---------------- GPG Fingerprint 1CC2 A9B2 FE2E 799D 01DB 8A89 0AE8 B60A ACA3 4452 diff --git a/client/tools/rhncfg/config_client/rhncfgcli_verify.py b/client/tools/rhncfg/config_client/rhncfgcli_verify.py index 8240d2b..03d2716 100644 --- a/client/tools/rhncfg/config_client/rhncfgcli_verify.py +++ b/client/tools/rhncfg/config_client/rhncfgcli_verify.py @@ -152,7 +152,11 @@ class Handler(handler_base.HandlerBase): if not stat_err: #check for group differences dst_gid = dst_stat[stat.ST_GID] - dst_group = grp.getgrgid(dst_gid)[0] + try: + dst_group = grp.getgrgid(dst_gid)[0] + except KeyError: + # Orphan GID with no name,return unknown + dst_group = "unknown(GID %d)" % (dst_gid,) else: dst_group = "missing" _______________________________________________ Spacewalk-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/spacewalk-devel
