Fix work with corrupted /etc/group

master3.3
Mike Hiretsky 11 years ago
parent 1b3cecbdd3
commit 250d7b570e

@ -4988,7 +4988,7 @@ gettext -d cl_template "$*"
passwdFile = os.path.join(self._baseDir,'etc/passwd')
if os.path.exists(passwdFile):
mapUid = dict(
filter(lambda x:x[0] and x[1],
filter(lambda x:x and len(x)>1 and x[0] and x[1],
map(lambda x:x.split(':')[0:3:2],
filter(lambda x:not x.startswith('#'),
open(passwdFile,'r')))))
@ -5001,7 +5001,7 @@ gettext -d cl_template "$*"
groupFile = os.path.join(self._baseDir,'etc/group')
if os.path.exists(groupFile):
mapGid = dict(
filter(lambda x:x[0] and x[1],
filter(lambda x:x and len(x)>1 and x[0] and x[1],
map(lambda x:x.split(':')[0:3:2],
filter(lambda x:not x.startswith('#'),
open(groupFile,'r')))))

Loading…
Cancel
Save