855ab9ad01
Verify uid/gid on files, directories and symlinks Just output a msg when user/group is removed with no files json-parsing: Add functions for strictly dealing with ints passwd/json: Add simple scripts to convert passwd/group files to json data docs: Check-passwd/groups and ignore-remove-users/groups JSON config. entries
21 lines
471 B
Python
Executable File
21 lines
471 B
Python
Executable File
#! /usr/bin/python -tt
|
|
|
|
import os
|
|
import sys
|
|
|
|
out = """\
|
|
"check-groups": { "type": "data",\n\
|
|
"entries": { """
|
|
prefix_len = len(' "entries": { ')
|
|
done = False
|
|
for fname in sys.argv[1:]:
|
|
for line in open(fname):
|
|
(group,x,gid,x) = line.split(':', 3)
|
|
if done:
|
|
out += ',\n'
|
|
out += ' ' * prefix_len
|
|
done = True
|
|
out += '"%s": %s' % (group, gid)
|
|
out += ' } },'
|
|
print out
|