Skip to contentSkip to conversation

fs: fix fakeroot issue with SElinux contexts

PATCH New Yann E. MORIN 2 participants 5 messages Oct 29, 2016 – Nov 3, 2016 VFS

lore
Share & tools
lore
#0 lore raw

cover fs: fix fakeroot issue with SElinux contexts

Hello All!

This series is an attempt at fixing fakeroot, which has issues with SElinux contexts (in extended attributes), as reported as one of our bug report, but also reported in Fedora Core and Debian:

    https://bugzilla.redhat.com/show_bug.cgi?id=1238802
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=799858

Since there has been absolutely no activity on the upstream (== Debian) report since it was filled more than a year ago, follow the path suggested in the FC report, and switch to using pseudo as a replacement for fakeroot.

This can probably go in right now. If there are issues, we can still revert this before the end of the stabilisation month.

Regards,
Yann E. MORIN.

The following changes since commit 566858f6a1d65dda466942e4c84e40e3ce95e06f

package/libglob: fix license typo (2016-10-28 15:17:43 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to d21df0f20a6f45cf718263e40037bedb390064bf

fs: use pseudo instead of fakeroot (2016-10-29 10:19:35 +0200)

----------------------------------------------------------------
Yann E. MORIN (2):
package/pseudo: new package
fs: use pseudo instead of fakeroot

 fs/common.mk               |  4 ++--
 package/pseudo/pseudo.hash |  2 ++
 package/pseudo/pseudo.mk   | 15 +++++++++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 package/pseudo/pseudo.hash
 create mode 100644 package/pseudo/pseudo.mk
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/2 package/pseudo: new package

Pseudo is a program that can either be used directly or as an LD_PRELOAD, which allows these operations to succeed as if the user did have system administrator privileges even though they are an ordinary user.

Pseudo has a lot of similarities to fakeroot but is a new implementation that improves on the problems seen using fakeroot.

Cc Andrey Yurovsky <[email protected]>
Cc Gustavo Zacarias <[email protected]>
---
 package/pseudo/pseudo.hash |  2 ++
 package/pseudo/pseudo.mk   | 15 +++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 package/pseudo/pseudo.hash
 create mode 100644 package/pseudo/pseudo.mk
package/pseudo/pseudo.hash new file +2 -0
new file mode 100644
index 0000000..5822d0e
@@ -0,0 +1,2 @@
+# Locally computed
+sha256  d7767c9a73b0df4f1f26952cf5eca4c6ff6fc4bc5ef15a904ea3839c70161936  pseudo-7abc9396731149df5eaf43c84fed4f3053b64de6.tar.gz
package/pseudo/pseudo.mk new file +15 -0
new file mode 100644
index 0000000..314fa82
@@ -0,0 +1,15 @@
+################################################################################
+#
+# pseudo
+#
+################################################################################
+
+PSEUDO_VERSION = 7abc9396731149df5eaf43c84fed4f3053b64de6
+PSEUDO_SITE = https://git.yoctoproject.org/git/pseudo
+PSEUDO_SITE_METHOD = git
+
+# No "or later" clause.
+PSEUDO_LICENSE = LGPLv2.1
+PSEUDO_LICENSE_FILES = COPYING
+
+$(eval $(host-autotools-package))
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/2 package/pseudo: new package

Hello,

Quoted 11 lines · Yann E. MORIN

Pseudo is a program that can either be used directly or as an LD_PRELOAD, which allows these operations to succeed as if the user did have system administrator privileges even though they are an ordinary user.

Pseudo has a lot of similarities to fakeroot but is a new implementation that improves on the problems seen using fakeroot.

Cc Andrey Yurovsky <[email protected]>
Cc Gustavo Zacarias <[email protected]>
Quoted 6 lines
---
 package/pseudo/pseudo.hash |  2 ++
 package/pseudo/pseudo.mk   | 15 +++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 package/pseudo/pseudo.hash
 create mode 100644 package/pseudo/pseudo.mk

Both patches applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/2 fs: use pseudo instead of fakeroot

In reply to Yann E. MORIN

fakeroot misbhaves when there are SElinux contexts, as reported in #9386, and further detailed in https://bugzilla.redhat.com/show_bug.cgi?id=1238802

A proposal in the FC bug is to use pseudo instead of fakeroot. Pseudo is a from-scratch re-implementation of fakeroot; it is used in Poky/OE instead of fakeroot.

Fixes #9386.

---
 fs/common.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/common.mk +2 -2
index 2b31e12..2dbef4d 100644
@@ -43,7 +43,7 @@ ROOTFS_USERS_TABLES = $(call qstrip,$(BR2_ROOTFS_USERS_TABLES))
 define ROOTFS_TARGET_INTERNAL
 
 # extra deps
-ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \
+ROOTFS_$(2)_DEPENDENCIES += host-pseudo host-makedevs \
 	$$(if $$(PACKAGES_USERS)$$(ROOTFS_USERS_TABLES),host-mkpasswd)
 
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y)
@@ -97,7 +97,7 @@ endif
 		echo $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep))
 	$$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT)
 	chmod a+x $$(FAKEROOT_SCRIPT)
-	PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/fakeroot -- $$(FAKEROOT_SCRIPT)
+	PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/pseudo -- $$(FAKEROOT_SCRIPT)
 	$$(INSTALL) -m 0644 support/misc/target-dir-warning.txt $$(TARGET_DIR_WARNING_FILE)
 	- at rm -f $$(FAKEROOT_SCRIPT) $$(FULL_DEVICE_TABLE)
 ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),)
Signature · 1 line
2.7.4
#4 lore raw

cover fs: fix fakeroot issue with SElinux contexts

In reply to Yann E. MORIN

Hello,

Quoted 6 lines · Yann E. MORIN

This series is an attempt at fixing fakeroot, which has issues with SElinux contexts (in extended attributes), as reported as one of our bug report, but also reported in Fedora Core and Debian:

    https://bugzilla.redhat.com/show_bug.cgi?id=1238802
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=799858
Quoted 7 lines

Since there has been absolutely no activity on the upstream (== Debian) report since it was filled more than a year ago, follow the path suggested in the FC report, and switch to using pseudo as a replacement for fakeroot.

This can probably go in right now. If there are issues, we can still revert this before the end of the stabilisation month.

There are lots of other references to fakeroot all over the place, both in fs/common.mk, but also the relatively new option we have to call a script within the fakeroot context.

Do we keep them as-is, or do we rename everything to "pseudo" ? I find the name "pseudo" very confusing, while "fakeroot" is a lot clearer, so perhaps it is OK to keep everything named fakeroot even though in practice we're using pseudo.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com