More robust way of choosing a non-existant uid (faster, too).
This commit is contained in:
parent
037b2205e8
commit
6308d510e9
|
@ -59,10 +59,10 @@ except KeyError:
|
|||
else:
|
||||
print 'fakename', fakename, 'did not except pwd.getpwnam()'
|
||||
|
||||
uids = byuids.keys()
|
||||
uids.sort()
|
||||
uids.reverse()
|
||||
fakeuid = uids[0] + 1
|
||||
# Choose a non-existant uid.
|
||||
fakeuid = 4127
|
||||
while byuids.has_key(fakeuid):
|
||||
print 'fakeuid =', fakeuid
|
||||
|
||||
try:
|
||||
pwd.getpwuid(fakeuid)
|
||||
|
|
Loading…
Reference in New Issue