1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-02 07:15:53 +02:00

services: setuid: More configurable setuid support.

New record <setuid-program> with fields for setting the specific user
and group, as well as specifically selecting the setuid and setgid bits,
for a program within the setuid-program-service.

* gnu/services.scm (setuid-program-file-like-deprecated): New function.
  (setuid-program-service-type): Make use of
  setuid-program->activation-gexp.  Adjust the extend property to handle
  <setuid-program>.
* gnu/build/activation.scm (activate-setuid-programs): Update to expect a
  <setuid-record> list for each program entry.
* gnu/system.scm: (operating-system-setuid-programs): Renamed to
  %operating-system-setuid-programs and replace it with new procedure.
  (operating-system-default-essential-services,
  hurd-default-essential-services): Replace
  operating-system-setuid-programs with
  %operating-system-setuid-programs.
* gnu/system/setuid.scm: New file.
* doc/guix.texi (Setuid Programs): Document <setuid-program>.

Co-authored-by: Brice Waegeneire <brice@waegenei.re>
This commit is contained in:
Chris Lemmer-Webber
2021-07-06 22:03:19 +02:00
committed by Christopher Lemmer Webber
parent 5a1ce6cf70
commit a7ac19851b
4 changed files with 104 additions and 19 deletions
+25 -1
View File
@@ -46,7 +46,7 @@ Copyright @copyright{} 2017 Federico Beffa@*
Copyright @copyright{} 2017, 2018 Carlo Zancanaro@*
Copyright @copyright{} 2017 Thomas Danckaert@*
Copyright @copyright{} 2017 humanitiesNerd@*
Copyright @copyright{} 2017, 2021 Christopher Lemmer Webber@*
Copyright @copyright{} 2017, 2021 Christine Lemmer-Webber@*
Copyright @copyright{} 2017, 2018, 2019, 2020 Marius Bakke@*
Copyright @copyright{} 2017, 2019, 2020 Hartmut Goebel@*
Copyright @copyright{} 2017, 2019, 2020, 2021 Maxim Cournoyer@*
@@ -32398,6 +32398,30 @@ package, can be designated by this G-expression (@pxref{G-Expressions}):
#~(string-append #$shadow "/bin/passwd")
@end example
@deftp {Data Type} setuid-program
This data type represents a program with a setuid or setgid bit set.
@table @asis
@item @code{program}
A file-like object having its setuid and/or setgid bit set.
@item @code{setuid?} (default: @code{#t})
Whether to set user setuid bit.
@item @code{setgid?} (default: @code{#f})
Whether to set group setgid bit.
@item @code{user} (default: @code{0})
UID (integer) or user name (string) for the user owner of the program,
defaults to root.
@item @code{group} (default: @code{0})
GID (integer) goup name (string) for the group owner of the program,
defaults to root.
@end table
@end deftp
A default set of setuid programs is defined by the
@code{%setuid-programs} variable of the @code{(gnu system)} module.