gnu: udevil: Fix loading of setuid-programs.
* gnu/packages/disk.scm (udevil)[arguments]<#:configure-flags>: Add "--with-mount-prog", "--with-umount-prog", "--with-losetup-prog", "--with-setfacl-prog". [arguments]<#:phases>[patch-udevil-reference]: New phase. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>master
parent
3e2d65aecb
commit
8546f4da5b
|
@ -103,16 +103,34 @@
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:configure-flags
|
`(#:configure-flags
|
||||||
(list "--disable-systemd"
|
(list
|
||||||
(string-append "--sysconfdir="
|
"--disable-systemd"
|
||||||
(assoc-ref %outputs "out")
|
(string-append "--sysconfdir="
|
||||||
"/etc"))
|
(assoc-ref %outputs "out")
|
||||||
|
"/etc")
|
||||||
|
;; udevil expects these programs to be run with uid set as root.
|
||||||
|
;; user has to manually add these programs to setuid-programs.
|
||||||
|
;; mount and umount are default setuid-programs in guix system.
|
||||||
|
"--with-mount-prog=/run/setuid-programs/mount"
|
||||||
|
"--with-umount-prog=/run/setuid-programs/umount"
|
||||||
|
"--with-losetup-prog=/run/setuid-programs/losetup"
|
||||||
|
"--with-setfacl-prog=/run/setuid-programs/setfacl")
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(add-after 'unpack 'remove-root-reference
|
(add-after 'unpack 'remove-root-reference
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "src/Makefile.in"
|
(substitute* "src/Makefile.in"
|
||||||
(("-o root -g root") ""))
|
(("-o root -g root") ""))
|
||||||
|
#t))
|
||||||
|
(add-after 'unpack 'patch-udevil-reference
|
||||||
|
;; udevil expects itself to be run with uid set as root.
|
||||||
|
;; devmon also expects udevil to be run with uid set as root.
|
||||||
|
;; user has to manually add udevil to setuid-programs.
|
||||||
|
(lambda _
|
||||||
|
(substitute* "src/udevil.c"
|
||||||
|
(("/usr/bin/udevil") "/run/setuid-programs/udevil"))
|
||||||
|
(substitute* "src/devmon"
|
||||||
|
(("`which udevil 2>/dev/null`") "/run/setuid-programs/udevil"))
|
||||||
#t)))))
|
#t)))))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("intltool" ,intltool)
|
`(("intltool" ,intltool)
|
||||||
|
|
Reference in New Issue