diff options
author | Daniel Joseph Barnhart Clark <dclark@pobox.com> | 2007-07-03 02:40:17 +0000 |
---|---|---|
committer | Daniel Joseph Barnhart Clark <dclark@pobox.com> | 2007-07-03 02:40:17 +0000 |
commit | 02190b66aa42d44362a57ba7de27b511a8aa50ef (patch) | |
tree | c50c210b3ad7995be518a2e3c982e8aff1680639 /src/lib/Client | |
parent | de27e45e23d98a37b192803521d35fb39e8420c8 (diff) | |
download | bcfg2-02190b66aa42d44362a57ba7de27b511a8aa50ef.tar.gz bcfg2-02190b66aa42d44362a57ba7de27b511a8aa50ef.tar.bz2 bcfg2-02190b66aa42d44362a57ba7de27b511a8aa50ef.zip |
More work for ticket #458: fix verification
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3411 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r-- | src/lib/Client/Tools/POSIX.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py index 6dcece8e2..965227845 100644 --- a/src/lib/Client/Tools/POSIX.py +++ b/src/lib/Client/Tools/POSIX.py @@ -112,8 +112,8 @@ class POSIX(Bcfg2.Client.Tools.Tool): (entry.tag, entry.get('name'))) return False try: - owner = pwd.getpwuid(ondisk[ST_UID])[0] - group = grp.getgrgid(ondisk[ST_GID])[0] + owner = str(ondisk[ST_UID]) + group = str(ondisk[ST_GID]) except (OSError, KeyError): self.logger.error('User/Group resolution failed for path %s' % (entry.get('name'))) owner = 'root' @@ -124,20 +124,20 @@ class POSIX(Bcfg2.Client.Tools.Tool): mtime = str(finfo[ST_MTIME]) else: mtime = '-1' - if ((owner == entry.get('owner')) and - (group == entry.get('group')) and + if ((owner == str(normUid(entry))) and + (group == str(normGid(entry))) and (perms == entry.get('perms')) and (mtime == entry.get('mtime', '-1'))): return True else: - if owner != entry.get('owner'): + if owner != str(normUid(entry)): entry.set('current_owner', owner) self.logger.debug("%s %s ownership wrong" % (entry.tag, entry.get('name'))) nqtext = entry.get('qtext', '') + '\n' nqtext += "%s owner wrong. is %s should be %s" % \ (entry.get('name'), owner, entry.get('owner')) entry.set('qtext', nqtext) - if group != entry.get('group'): + if group != str(normGid(entry)): entry.set('current_group', group) self.logger.debug("%s %s group wrong" % (entry.tag, entry.get('name'))) nqtext = entry.get('qtext', '') + '\n' |