Skip to content

Commit 94ae59f

Browse files
committed
In passwd and group lookups, convert IDs to strings
Reported by Anders Kaseorg <andersk@mit.edu>
1 parent b25635b commit 94ae59f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎hesiod.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def __init__(self, name):
7777
Lookup.__init__(self, name, 'passwd')
7878

7979
def parseRecords(self):
80-
self.passwd = struct_passwd(self.results[0].split(':'))
80+
passwd_info = self.results[0].split(':')
81+
passwd_info[2] = int(passwd_info[2])
82+
passwd_info[3] = int(passwd_info[3])
83+
self.passwd = struct_passwd(passwd_info)
8184

8285
class UidLookup(PasswdLookup):
8386
def __init__(self, uid):
@@ -89,6 +92,7 @@ def __init__(self, group):
8992

9093
def parseRecords(self):
9194
group_info = self.results[0].split(':')
95+
group_info[2] = int(group_info[2])
9296
members = group_info[3]
9397
if members != '':
9498
members = members.split(',')

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="PyHesiod",
9-
version="0.2.6",
9+
version="0.2.7",
1010
description="PyHesiod - Python bindings for the Heisod naming library",
1111
author="Evan Broder",
1212
author_email="broder@mit.edu",

0 commit comments

Comments
 (0)