All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Mandel <o.mandel@menlosystems.com>
To: bitbake-devel@lists.openembedded.org
Cc: Olaf Mandel <o.mandel@menlosystems.com>, Marek Vasut <marex@denx.de>
Subject: [PATCH] fetch2/git: canonicalize ids in generated tarballs
Date: Fri,  8 Apr 2022 16:50:12 +0200	[thread overview]
Message-ID: <20220408145012.2847490-1-o.mandel@menlosystems.com> (raw)
In-Reply-To: <20220328173618.960965-1-o.mandel@menlosystems.com>

Change the owner information in the mirror tarballs generated using
BB_GENERATE_MIRROR_TARBALLS="1". This is an extension of commit
0178ab83, which used the original pokybuild:user information, but failed
to clean up the numerical user and group ids. Now set the more canonical
values of oe:oe and 0:0.

Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com>
CC: Marek Vasut <marex@denx.de>
---
 lib/bb/fetch2/git.py  | 2 +-
 lib/bb/tests/fetch.py | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 4d06a571..b3eb8248 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -464,7 +464,7 @@ class Git(FetchMethod):
             with create_atomic(ud.fullmirror) as tfile:
                 mtime = runfetchcmd("git log --all -1 --format=%cD", d,
                         quiet=True, workdir=ud.clonedir)
-                runfetchcmd("tar -czf %s --owner pokybuild --group users --mtime \"%s\" ."
+                runfetchcmd("tar -czf %s --owner oe:0 --group oe:0 --mtime \"%s\" ."
                         % (tfile, mtime), d, workdir=ud.clonedir)
             runfetchcmd("touch %s.done" % ud.fullmirror, d)
 
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 233ecae7..1152e89c 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -653,8 +653,10 @@ class CleanTarballTest(FetcherTest):
         archive = tarfile.open(os.path.join(self.dldir, self.recipe_tarball))
         self.assertNotEqual(len(archive.members), 0)
         for member in archive.members:
-            self.assertEqual(member.uname, 'pokybuild')
-            self.assertEqual(member.gname, 'users')
+            self.assertEqual(member.uname, 'oe')
+            self.assertEqual(member.uid, 0)
+            self.assertEqual(member.gname, 'oe')
+            self.assertEqual(member.gid, 0)
             self.assertEqual(member.mtime, mtime)
 
 
-- 
2.25.1



      parent reply	other threads:[~2022-04-08 17:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 16:47 [PATCH] fetch2/git: stop generated tarballs from leaking info Olaf Mandel
2022-03-28 17:33 ` [PATCH v2] " Olaf Mandel
2022-03-28 17:36 ` [PATCH v3] " Olaf Mandel
2022-04-05 11:38   ` Olaf Mandel
2022-04-05 13:19     ` [bitbake-devel] " Alexandre Belloni
2022-04-05 14:29     ` Richard Purdie
2022-04-08 14:50   ` Olaf Mandel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220408145012.2847490-1-o.mandel@menlosystems.com \
    --to=o.mandel@menlosystems.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=marex@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.