All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][PATCH] image-oci-umoci: preserve file modes in rootfs
@ 2025-01-07  8:40 Florian Wickert
  2025-01-07 22:18 ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Wickert @ 2025-01-07  8:40 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Florian Wickert

cp does not preserve file modes by default.
This will break sudo (among others) which needs the suid flag to do its
work.

This patch adds the --preserve=mode flag to the cp call to fix this.

Signed-off-by: Florian Wickert <FlorianWickert@gmail.com>
---
 classes/image-oci-umoci.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/classes/image-oci-umoci.inc b/classes/image-oci-umoci.inc
index c77750fb..bbea2add 100644
--- a/classes/image-oci-umoci.inc
+++ b/classes/image-oci-umoci.inc
@@ -49,8 +49,8 @@ IMAGE_CMD:oci() {
     fi
 
     bbdebug 1 "OCI: populating rootfs"
-    bbdebug 1 "OCI: cp -r ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs/"
-    cp -r ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs
+    bbdebug 1 "OCI: cp -r --preserve=mode ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs/"
+    cp -r --preserve=mode ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs
 
     bbdebug 1 "OCI: umoci repack --image $image_name:${OCI_IMAGE_TAG} $image_bundle_name"
     umoci repack --image $image_name:${OCI_IMAGE_TAG} $image_bundle_name
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-17 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07  8:40 [meta-virtualization][PATCH] image-oci-umoci: preserve file modes in rootfs Florian Wickert
2025-01-07 22:18 ` Bruce Ashfield
2025-01-08  8:59   ` [PATCH] " Florian Wickert
2025-01-17 19:09     ` [meta-virtualization] " Bruce Ashfield

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.