From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6621153044585250816 X-Received: by 2002:a50:ad3c:: with SMTP id y57-v6mr194344edc.7.1541609350515; Wed, 07 Nov 2018 08:49:10 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:1903:: with SMTP id a3-v6ls5118961eje.3.gmail; Wed, 07 Nov 2018 08:49:10 -0800 (PST) X-Google-Smtp-Source: AJdET5ehCxJidyWEdXXEtuRgcVuXqf5IFIF30QQJXsHtnW4bakTIIXcdypZo0apFX2fyA9GsfYK5 X-Received: by 2002:a17:906:4f95:: with SMTP id o21-v6mr182743eju.6.1541609350132; Wed, 07 Nov 2018 08:49:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541609350; cv=none; d=google.com; s=arc-20160816; b=L18p4OPLT3YxHzgskQfsYltg7CdMhXTkO3nLe1SgMWq4Ylw4PxJYxkJEZ1+7kHNBrD A8K/kTas+bAkdZsS5XD1Von8eoJKmpmSvu9bh6poB7Sd+9Pctz0OCjeTgh9u5srGfNsL Z/gdtIR7BYV9dcezQuwdxAmNfSMeScJyOdeFNqHEr6sTll1OsqTY3vaep3zVFIRcAZrt wjorEIFG+uUDUcj4jX3tFSg45OyVw9T6/SJinV0mPkTrEZ9/xiwOzRJkOeqlcpiMbzG7 Nzy3LUatKZRE0x0EGzz3XIuny/ifM4QNstGVo1cwfCu+e1kunqV4TSrV3DfO67RXhpne /2kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=p1mXUmR8qzbjyvo1RsU0kd7TKlW0uiutaIAIHou2GMs=; b=DaYRmwtprtZ5qMEYsXSWDRPCUhbL2c9JOQ4HfwwW+GisfBCDDj25Fkk7BvSZiStFYi HscDg2V3F4HAJ7f4CPSgUouYM9wT/QkopPx0Y7bVLo7x9+G1jMgG54oi8YQDSMMiAT9s 8aObLJzj1i6FqRZXcELAMF16mVF8kMB8B5UkXc56Fi5RZa+fcpcan5S95kjZLfz/dH1C /e7Vc96BNFsVRJgWU+Jmk9jdgPbUOP6O0Qd1N+AFQb+kbP27cghM5jqiow+stWKErHFI o7qiZ7ygefqjdBSobxRZX2xDw1MxBawbmCeV3ZBxUVWSzol61/JeH+EkAhD6JaSf8tm9 1cYA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id o10-v6si59535ejc.0.2018.11.07.08.49.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 08:49:10 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id wA7Gn9vi007695 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 7 Nov 2018 17:49:09 +0100 Received: from md1za8fc.ad001.siemens.net ([139.25.69.189]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id wA7Gn9Qv031192; Wed, 7 Nov 2018 17:49:09 +0100 From: Henning Schild To: isar-users Cc: Adriaan Schmidt , Jan Kiszka , Henning Schild Subject: [PATCH v2] meta/dpkg-raw: fix raw package file ownership Date: Wed, 7 Nov 2018 17:49:06 +0100 Message-Id: <20181107164906.17219-1-henning.schild@siemens.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: h9g12yN6LcYP 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 Signed-off-by: Henning Schild --- 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