aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2022 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu system privilege)
  #:use-module (guix records)
  #:export (privileged-program
            privileged-program?
            privileged-program-program
            privileged-program-setuid?
            privileged-program-setgid?
            privileged-program-user
            privileged-program-group
            privileged-program-capabilities

            file-like->setuid-program))

;;; Commentary:
;;;
;;; Data structures representing privileged programs: binaries with additional
;;; permissions such as setuid/setgid, or POSIX capabilities.  This is meant to
;;; be used both on the host side and at run time--e.g., in activation snippets.
;;;
;;; Code:

(define-record-type* <privileged-program>
  privileged-program make-privileged-program
  privileged-program?
  ;; File name of the program to assign elevated privileges.
  (program       privileged-program-program) ;file-like
  ;; Whether to set the setuid (‘set user ID’) bit.
  (setuid?       privileged-program-setuid? ;boolean
                 (default #f))
  ;; Whether to set the setgid (‘set group ID’) bit.
  (setgid?       privileged-program-setgid? ;boolean
                 (default #f))
  ;; The user name or ID this should be set to (defaults to root's).
  (user          privileged-program-user ;integer or string
                 (default 0))
  ;; The group name or ID we want to set this to (defaults to root's).
  (group         privileged-program-group ;integer or string
                 (default 0))
  ;; POSIX capabilities in cap_from_text(3) form (defaults to #f: none).
  (capabilities  privileged-program-capabilities ;string or #f
                 (default #f)))

(define (file-like->setuid-program program)
  "Simple wrapper to facilitate MAPping over a list of file-like objects and
make them setuid, a pattern just common enough to justify a special helper."
  (privileged-program (program program)
                      (setuid? #t)))
n>Alexandr Vityazev 2021-07-27gnu: emacs-elpher: Update to 2.10.3....* gnu/packages/emacs-xyz.scm (emacs-elpher): Update to 2.10.3. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Simon South 2021-07-27gnu: emacs-typit: Update to 0.2.1-2.fa125bf....* gnu/packages/emacs-xyz.scm (emacs-typit): Update to 0.2.1-2.fa125bf. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Morgan Smith 2021-07-27gnu: emacs-typit: Fix dictionary location....Move the dictionary directory to be next to the lisp files, where it is expected to be. * gnu/packages/emacs-xyz.scm (emacs-typit)[arguments] <#:phases>: Remove install-dictionaries phase. <#:include>: Include dictionaries. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Morgan Smith 2021-07-27gnu: emacs-org-roam-bibtex: Update to 0.6.0....* gnu/packages/emacs-xyz.scm (emacs-org-roam-bibtex): Update to 0.6.0. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Vinicius Monego 2021-07-27gnu: emacs-org-roam: Update to 2.0.0....* gnu/packages/emacs-xyz.scm (emacs-org-roam): Update to 2.0.0. [propagated-inputs]: Add emacs-magit. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Vinicius Monego 2021-07-27gnu: Add emacs-org-cv....* gnu/packages/emacs-xyz.scm (emacs-org-cv): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Vinicius Monego 2021-07-25gnu: emacs-ebuild-mode: Update to 1.53....* gnu/packages/emacs-xyz.scm (emacs-ebuild-mode): Update to 1.53. Nicolas Goaziou 2021-07-25gnu: emacs-counsel-etags: Update to 1.9.17....* gnu/packages/emacs-xyz.scm (emacs-counsel-etags): Update to 1.9.17. [arguments]: Disable tests. Nicolas Goaziou 2021-07-25gnu: emacs-corfu: Update to 0.10....* gnu/packages/emacs-xyz.scm (emacs-corfu): Update to 0.10. Nicolas Goaziou 2021-07-25gnu: emacs-modus-themes: Update to 1.5.0....* gnu/packages/emacs-xyz.scm (emacs-modus-themes): Update to 1.5.0. Nicolas Goaziou 2021-07-25gnu: emacs-flycheck-grammalecte: Update to 2.0....* gnu/packages/emacs-xyz.scm (emacs-flycheck-grammalecte): Update to 2.0. Nicolas Goaziou 2021-07-25gnu: emacs-aggressive-indent: Update to 1.10.0....* gnu/packages/emacs-xyz.scm (emacs-aggressive-indent): Update to 1.10.0. Nicolas Goaziou 2021-07-25gnu: emacs-pyim: Update to 3.9.3....* gnu/packages/emacs-xyz.scm (emacs-pyim): Update to 3.9.3. Nicolas Goaziou 2021-07-25gnu: emacs-ebdb: Update to 0.7....* gnu/packages/emacs-xyz.scm (emacs-ebdb): Update to 0.7. Nicolas Goaziou 2021-07-25gnu: Add emacs-ob-async....* gnu/packages/emacs-xyz.scm (emacs-ob-async): New variable. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Vinicius Monego 2021-07-25gnu: emacs-nov-el: Update to 0.3.4....* gnu/packages/emacs-xyz.scm (emacs-nov-el): Update to 0.3.4. [arguments]<#:emacs>: Use emacs for libxml. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Morgan Smith 2021-07-22gnu: Add emacs-seeing-is-believing....* gnu/packages/emacs-xyz.scm (emacs-seeing-is-believing): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Joseph LaFreniere 2021-07-19gnu: Add emacs-jupyter....* gnu/packages/emacs-xyz.scm (emacs-jupyter): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Vinicius Monego 2021-07-19gnu: Add emacs-zmq....* gnu/packages/emacs-xyz.scm (emacs-zmq): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Vinicius Monego 2021-07-18gnu: emacs-pyim: Update to 3.9.2....* gnu/packages/emacs-xyz.scm (emacs-pyim): Update to 3.9.2. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Xinglu Chen 2021-07-09gnu: emacs-dash: Update to 2.19.0....* gnu/packages/emacs-xyz.scm (emacs-dash): Update to 2.19.0. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Andrew Tropin 2021-07-09gnu: emacs-telega: Fix 'patch-source' phase....* gnu/packages/emacs-xyz.scm (emacs-telega)[#:phases]<patch-sources>: Add missing slash in ‘/bin’ when patching general commands. Also patch telega-vvnote.el. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Zhu Zihao 2021-07-09gnu: emacs-xyz: Fix indentation....* gnu/packages/emacs-xyz.scm: Delete trailing newline. (emacs-purescript-mode): Delete trailing space. Leo Prikler 2021-07-09gnu: emacs-telega-server: Update to 0.7.025....* gnu/packages/emacs-xyz.scm (emacs-telega-server): Update to 0.7.025. Leo Prikler 2021-07-09gnu: emacs-telega-contrib: Update to 0.7.024....* gnu/packages/emacs-xyz.scm(emacs-telega-contrib): Update to 0.7.024. [arguments]<#:phases>: Back to root directory of build before phase 'install-license-files' to properly install licenses. [propagated-inputs]: Add emacs-dashboard, emacs-transient. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Zhu Zihao 2021-07-09gnu: emacs-telega: Update to 0.7.024....* gnu/packages/emacs-xyz.scm (emacs-telega): Update to 0.7.024. [build-system] Use emacs-build-system. [arguments] Add #:emacs. Drop outdated phases. Update ‘patch-sources’ phase to find new occurences of ffmpeg to patch. Add new ‘configure’ and ‘install-share-files’ phases. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Zhu Zihao 2021-07-09gnu: Add emacs-telega-server....* gnu/packages/emacs-xyz.scm (emacs-telega-server): New variable. * gnu/packages/patches/emacs-telega-path-placeholder.patch: New file. * gnu/package/patches/emacs-telega-patch-server-functions.patch: Remove stale patch. * gnu/local.mk (dist_patch_DATA): Update accordingly. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Zhu Zihao 2021-07-08gnu: emacs-chronometrist: Update to 0.9.0....* gnu/packages/emacs-xyz.scm (emacs-chronometrist): Update to 0.9.0. [source]: Update upstream URL. [inputs]: Add emacs-spark. Remove emacs-anaphora and emacs-literate-elisp. Nicolas Goaziou 2021-07-08gnu: Add emacs-consult-notmuch....* gnu/packages/emacs-xyz.scm (emacs-consult-notmuch): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Andrew Tropin 2021-07-08gnu: emacs-deadgrep: Add missing input....* gnu/packages/emacs-xyz.scm (emacs-deadgrep)[inputs]: Add ripgrep. [arguments]: Add configure phase to set deadgrep-executable to absolute path. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Matthew James Kraai 2021-07-07gnu: emacs-pyim: Update to 3.9.0....* gnu/packages/emacs-xyz.scm (emacs-pyim): Update to 3.9.0. Nicolas Goaziou 2021-07-05gnu: emacs-transient: Update to 0.3.6....* gnu/packages/emacs-xyz.scm (emacs-transient): Update to 0.3.6. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Xinglu Chen 2021-07-05gnu: emacs-slime-volleyball: Update to 1.2.0....* gnu/packages/emacs-xyz.scm (emacs-slime-volleyball): Update to 1.2.0. Nicolas Goaziou 2021-07-05gnu: emacs-pyim: Update to 3.8.3....* gnu/packages/emacs-xyz.scm (emacs-pyim): Update to 3.8.3. Nicolas Goaziou 2021-07-04gnu: emacs-spinner: Fix source URL....* gnu/packages/emacs-xyz.scm (emacs-spinner)[source]: Fix URL. Nicolas Goaziou 2021-07-04gnu: emacs-spinner: Update to 1.7.4....* gnu/packages/emacs-xyz.scm (emacs-spinner): Update to 1.7.4. Nicolas Goaziou 2021-07-03gnu: Add emacs-seriestracker....* gnu/packages/emacs-xyz.scm (emacs-seriestracker): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Alexandr Vityazev 2021-07-03gnu: Add emacs-muse....* gnu/packages/emacs-xyz.scm (emacs-muse): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Morgan Smith 2021-07-03gnu: emacs-magit: Update to 3.1.1....* gnu/packages/emacs-xyz.scm (emacs-magit): Update to 3.1.1. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Matthew James Kraai 2021-07-02gnu: Add emacs-rmsbolt....* gnu/packages/emacs-xyz.scm (emacs-rmsbolt): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Alexandr Vityazev 2021-07-02gnu: emacs-multitran: Update to 0.4.11....* gnu/packages/emacs-xyz.scm (emacs-multitran): Update to 0.4.11. [description]: Add @url markup. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Alexandr Vityazev 2021-07-02gnu: Add emacs-saveplace-pdf-view....* gnu/packages/emacs-xyz.scm (emacs-saveplace-pdf-view): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Andrew Tropin 2021-07-02gnu: emacs-link-hint: Update to 0.1-2.ae73db6....* gnu/packages/emacs-xyz.scm (emacs-link-hint): Update to 0.1-2.ae73db6. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Alexandr Vityazev 2021-07-02gnu: Add emacs-ripgrep....* gnu/packages/emacs-xyz.scm (emacs-ripgrep): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Dhruvin Gandhi