Remove comment line in generated passwd file
The man page for the password file (man 5 passwd) does not mention any provisions for comment line other than comment field Bug: 109748241 Test: Build and check generated file Change-Id: I2912d0844cf3f077184129d1a0121b50b09ef1e3
This commit is contained in:
@@ -1216,10 +1216,6 @@ class OEMAidGen(BaseGenerator):
|
|||||||
class PasswdGen(BaseGenerator):
|
class PasswdGen(BaseGenerator):
|
||||||
"""Generates the /etc/passwd file per man (5) passwd."""
|
"""Generates the /etc/passwd file per man (5) passwd."""
|
||||||
|
|
||||||
_GENERATED = ('#\n# THIS IS AN AUTOGENERATED FILE! DO NOT MODIFY!\n#')
|
|
||||||
|
|
||||||
_FILE_COMMENT = '# Defined in file: \"%s\"'
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
self._old_file = None
|
self._old_file = None
|
||||||
@@ -1254,8 +1250,6 @@ class PasswdGen(BaseGenerator):
|
|||||||
if len(aids) == 0:
|
if len(aids) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
print PasswdGen._GENERATED
|
|
||||||
|
|
||||||
for aid in aids:
|
for aid in aids:
|
||||||
if required_prefix is None or aid.friendly.startswith(required_prefix):
|
if required_prefix is None or aid.friendly.startswith(required_prefix):
|
||||||
self._print_formatted_line(aid)
|
self._print_formatted_line(aid)
|
||||||
@@ -1280,7 +1274,6 @@ class PasswdGen(BaseGenerator):
|
|||||||
"""
|
"""
|
||||||
if self._old_file != aid.found:
|
if self._old_file != aid.found:
|
||||||
self._old_file = aid.found
|
self._old_file = aid.found
|
||||||
print PasswdGen._FILE_COMMENT % aid.found
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
logon, uid = Utils.get_login_and_uid_cleansed(aid)
|
logon, uid = Utils.get_login_and_uid_cleansed(aid)
|
||||||
@@ -1306,7 +1299,6 @@ class GroupGen(PasswdGen):
|
|||||||
"""
|
"""
|
||||||
if self._old_file != aid.found:
|
if self._old_file != aid.found:
|
||||||
self._old_file = aid.found
|
self._old_file = aid.found
|
||||||
print PasswdGen._FILE_COMMENT % aid.found
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
logon, uid = Utils.get_login_and_uid_cleansed(aid)
|
logon, uid = Utils.get_login_and_uid_cleansed(aid)
|
||||||
|
Reference in New Issue
Block a user