From: Henning Schild <henning.schild@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Adriaan Schmidt <adriaan.schmidt@siemens.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Henning Schild <henning.schild@siemens.com>
Subject: [PATCH v2] meta/dpkg-raw: fix raw package file ownership
Date: Wed, 7 Nov 2018 17:49:06 +0100 [thread overview]
Message-ID: <20181107164906.17219-1-henning.schild@siemens.com> (raw)
Make sure the whole content of the package defaults to ownership
"root:root", deviations will have to be done in postinst.
Before the file ownership was coming from our build environment and
typically was "1000:1000". That was a security problem and the ids could
differ depending on how people build.
Reported-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
RECIPE-API-CHANGELOG.md | 5 +++++
doc/user_manual.md | 1 +
meta/classes/dpkg-raw.bbclass | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index c7b7552..9a65b44 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -6,6 +6,11 @@ Baseline: Release v0.5
Upcoming changes (v0.7)
-----------------------
+### dpkg-raw recipes chown all files to "root:root"
+
+if your recipes rely on any other ownership, you will have to change file
+ownership in the postinst script
+
### more consistent artifact names
multiconfig image artifacts are all placed in tmp/deploy/images. They include
diff --git a/doc/user_manual.md b/doc/user_manual.md
index 3b4ec48..5c46d5a 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -603,6 +603,7 @@ For the variables please have a look at the previous example, the following new
- `DEBIAN_DEPENDS` - Debian packages that the package depends on
Have a look at the `example-raw` recipe to get an idea how the `dpkg-raw` class can be used to customize your image.
+Note that all files you install will be owned by "root:root". If you want to change that, call chown in the postinst script.
## Isar Cross-compilation
diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index c848f3d..d662422 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -54,6 +54,6 @@ do_prepare_build() {
}
dpkg_runbuild() {
- sudo chown -R root:root ${D}/DEBIAN/
+ sudo chown -R root:root ${D}
sudo chroot ${BUILDCHROOT_DIR} dpkg-deb --build ${PP}/image ${PP}
}
--
2.19.1
next reply other threads:[~2018-11-07 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 16:49 Henning Schild [this message]
2018-11-07 16:51 ` Jan Kiszka
2018-11-12 9:25 ` Maxim Yu. Osipov
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=20181107164906.17219-1-henning.schild@siemens.com \
--to=henning.schild@siemens.com \
--cc=adriaan.schmidt@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox