diff mbox series

[3/6] rootfspostcommands.py: Cleanup subid backup files generated by shadow-utils

Message ID 20220823235624.2488133-3-andrei@gherzan.com
State Accepted, archived
Commit 4e4ea5adea8a00b4a78ffbe7cc60931deb74c161
Headers show
Series [1/6] shadow: Enable subid support | expand

Commit Message

Andrei Gherzan Aug. 23, 2022, 11:56 p.m. UTC
From: Andrei Gherzan <andrei.gherzan@huawei.com>

When creating users, shadow-utils might create backup files for
subordinate ID files (subid, subgid). Make sure we clean them up
similarly to the other backup files shadow-utils creates.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
 meta/lib/rootfspostcommands.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/rootfspostcommands.py b/meta/lib/rootfspostcommands.py
index e344ae2efc..5386eea409 100644
--- a/meta/lib/rootfspostcommands.py
+++ b/meta/lib/rootfspostcommands.py
@@ -73,6 +73,8 @@  def remove_shadowutils_backup_files(sysconfdir):
             'gshadow',
             'passwd',
             'shadow',
+            'subgid',
+            'subuid',
         ):
         filepath = os.path.join(sysconfdir, filename)
         remove_shadowutils_backup_file(filepath)