Bug#1107992: drop Rules-Requires-Root

Fabian Grünbichler <[email protected]>
Newsgroups gmane.linux.debian.ports.hurd
Message-ID <162f5ad7-5274-4494-ac3d-b2ff4946a25b__22921.173511871$1750259610$gmane$org@app.fastmail.com>
Source: hurd
Version: 1:0.9.git20250420-1
Severity: wishlist
Tags: patch
X-Debbugs-Cc: [email protected]

Hi!

while looking through the archive for unrelated reasons, I noticed src:hurd is
the only package using Rules-Requires-Root: debhelper/upstream-make-install

the resulting wrapping of `make install` under fakeroot has no real effect, and
anything requiring root (like setting certain executables setuid) needs to be 
done once more afterwards by d/rules or debhelper anyway.

attached is a small patch that makes it possible to drop R³ and make the whole
build rootless, with bit-by-bit identical binary package output (including
udebs) according to my test build on the porterbox.

full debdiff dropping R³ attachted as well.

this has the advantage that new root-requiring steps in `make install` added
in future versions are not silently ignored (which would be the case currently),
but should actually fail the build.

I also noticed that the setuid binaries are not setuid in the udebs, which
might be worthy of a separate fix - but I don't know anything about hurd, so
I'll leave that to you :)

thanks for your consideration,
Fabian

-- System Information:
Debian Release: 13.0
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.30-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
debdiff (application/octet-stream, 2.2 KB) - not displayed
fix-rootless-build.patch (text/x-diff, 970 B)
Description: fix rootless build
Instead of setting the owner and setuid bit during `make install` which
requires (fake) root, only set it in debian/rules via chown u+s

Author: Fabian Grünbichler <[email protected]>

---
Last-Update: 2025-06-18

--- hurd-0.9.git20250420.orig/daemons/Makefile
+++ hurd-0.9.git20250420/daemons/Makefile
@@ -31,8 +31,6 @@ HURDLIBS = fshelp ports shouldbeinlibc
 OBJS = $(SRCS:.c=.o)
 getty-LDLIBS = -lutil
 
-INSTALL-mail.local-ops = -o root -m 4755
-
 include ../Makeconf
 
 rc: rc.sh
--- hurd-0.9.git20250420.orig/utils/Makefile
+++ hurd-0.9.git20250420/utils/Makefile
@@ -42,11 +42,6 @@ setauth-LDLIBS = $(and $(HAVE_LIBCRYPT),
 mount-LDLIBS = $(libblkid_LIBS)
 mount-CPPFLAGS = $(libblkid_CFLAGS)
 
-INSTALL-login-ops = -o root -m 4755
-INSTALL-ids-ops = -o root -m 4755
-INSTALL-ps-ops = -o root -m 4755
-INSTALL-w-ops = -o root -m 4755
-
 include ../Makeconf
 
 ps addauth rmauth setauth unsu msgport: parse.o pids.o
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.