From patchwork Wed Aug 31 14:39:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 12163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C92CFC54EE9 for ; Wed, 31 Aug 2022 14:40:21 +0000 (UTC) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mx.groups.io with SMTP id smtpd.web09.26487.1661956814516212220 for ; Wed, 31 Aug 2022 07:40:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20210112.gappssmtp.com header.s=20210112 header.b=c3IrN2eW; spf=softfail (domain: sakoman.com, ip: 209.85.215.171, mailfrom: steve@sakoman.com) Received: by mail-pg1-f171.google.com with SMTP id x80so10101085pgx.0 for ; Wed, 31 Aug 2022 07:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=U8IEDpwD15L01v58Lx3zRRecdDdF16USzb8D0wrRqdc=; b=c3IrN2eWnYSpA3kCwcZ6DHp5cVnCEbSBZM/P40ufWAT26mpOKsFF+oNN86resl+HR3 2WQ/aFXkA5852IxM0pLy4ctY8DgSecr/pXN6wMx73KJNZU9HNi08iPmM4ZBDMJu593fl MHiGpl6k1Z+LyZ7NBX6EsLpv+cpQhkTeVvJOGarK0OJX134IvsVMWzaiP4rLaVYr6Sl3 U/Rhp6VBzmjuB4hMEEgYtaZ45LgWE/2NzkjEvM3cV6H+qyRHe3vs89E5e6Y+UfB08PO/ nwt0UqdiDKexT1LhpNnNd/qpL/0jktsDN0DEfQcICh14JyxcH+cW/K+wjd/00jksbQDE x3rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=U8IEDpwD15L01v58Lx3zRRecdDdF16USzb8D0wrRqdc=; b=QNP11sj3OA/gKzU8QgOzMXS4OWIGTi47RsfgE3GMTFoUxHLxQOKeCvRj9/JOHX3ySu 0ZM4HqyVWFue+HPZ095HwIa/srbi6QGEt8WDzJOP6kJTbzFDpNIuGD6umzzBVo2ZzPvB fO3Rii/O+JKh6ZA6Ipz0WVWBJlxiyBLcDHi7NlzQfmuGv6o4lIx11VGYT+d4c79T++nZ Ap2FJJQPJtCS2lloV2SeCheshoWwtOU7i5DdimA9kLk7s2rnHlvcJuyTt41StjRrFcuR dzZ9i1xxyYFkQZEc0d5UtycyGORtls/3Bg7rQuoa5D+44c9vAX0FmEdj3gLYqoCBCvP5 O9Bg== X-Gm-Message-State: ACgBeo0GcS8LTfJx4wR7YWTBlYSZZrsO5zDZ1h88tci2LvlK5zO5CEnp Rp/OUvvzkC73R4Ys3wKnJVL4Ua0x9aZcPn8e X-Google-Smtp-Source: AA6agR76yPQj73gmi5X84OvfynJknL01uAbVBKUOk3AWCg9Ln9X63MRSnm9Jp++iFy2ZKfg4+o+ltw== X-Received: by 2002:a05:6a00:174b:b0:52f:c4d1:d130 with SMTP id j11-20020a056a00174b00b0052fc4d1d130mr26114473pfc.23.1661956813530; Wed, 31 Aug 2022 07:40:13 -0700 (PDT) Received: from hexa.router0800d9.com (dhcp-72-253-6-214.hawaiiantel.net. [72.253.6.214]) by smtp.gmail.com with ESMTPSA id g5-20020a170902d1c500b00174d715cb76sm6070780plb.2.2022.08.31.07.40.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 07:40:12 -0700 (PDT) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 10/19] rootfspostcommands.py: Cleanup subid backup files generated by shadow-utils Date: Wed, 31 Aug 2022 04:39:30 -1000 Message-Id: <84b2e9a6c17278cbcc08020aa78759004a7b60bf.1661956484.git.steve@sakoman.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 31 Aug 2022 14:40:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/170121 From: Andrei Gherzan 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. Signed-off-by: Andrei Gherzan Signed-off-by: Steve Sakoman --- meta/lib/rootfspostcommands.py | 7 +++++++ 1 file changed, 7 insertions(+) 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): remove_backup(filename) if os.path.exists(filename): sort_file(filename, mapping) + # Drop other known backup shadow-utils. + for filename in ( + 'subgid', + 'subuid', + ): + filepath = os.path.join(sysconfdir, filename) + remove_backup(filepath)