summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei.gherzan@huawei.com>2022-08-25 18:30:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-03 13:09:49 +0100
commitc917d00ea33b90109ca38ebc964f9b9cce5cf2b5 (patch)
tree025fd702c307f3d7f4801adafb164fcc82ec8660 /meta/lib
parent5ec20bf952a9f3ca4c6d9e00a4c6d584ac4726bd (diff)
downloadpoky-c917d00ea33b90109ca38ebc964f9b9cce5cf2b5.tar.gz
rootfspostcommands.py: Cleanup subid backup files generated by shadow-utils
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. This is a backport from master that brings in only the cleanup of the subid backup files without the code restructure. (From OE-Core rev: 84b2e9a6c17278cbcc08020aa78759004a7b60bf) Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/rootfspostcommands.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/lib/rootfspostcommands.py b/meta/lib/rootfspostcommands.py
index fdb9f5b850..12f66d2ce2 100644
--- a/meta/lib/rootfspostcommands.py
+++ b/meta/lib/rootfspostcommands.py
@@ -58,3 +58,10 @@ def sort_passwd(sysconfdir):
58 remove_backup(filename) 58 remove_backup(filename)
59 if os.path.exists(filename): 59 if os.path.exists(filename):
60 sort_file(filename, mapping) 60 sort_file(filename, mapping)
61 # Drop other known backup shadow-utils.
62 for filename in (
63 'subgid',
64 'subuid',
65 ):
66 filepath = os.path.join(sysconfdir, filename)
67 remove_backup(filepath)