[PATCH v2 4/4] services: cuirass: Ensure correct ownership of directory trees.

  • Open
  • quality assurance status badge
Details
One participant
  • Brice Waegeneire
Owner
unassigned
Submitted by
Brice Waegeneire
Severity
normal
Merged with
B
B
Brice Waegeneire wrote on 21 Dec 2021 20:36
(address . guix-patches@gnu.org)
20211221193646.16849-4-brice@waegenei.re
* gnu/services/cuirass.scm (cuirass-activation): Replace 'chown'
calls by 'lchown-recursive'.
---
gnu/services/cuirass.scm | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)

Toggle diff (55 lines)
diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm
index 96f28a9670..41e45604dd 100644
--- a/gnu/services/cuirass.scm
+++ b/gnu/services/cuirass.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -24,6 +25,7 @@
(define-module (gnu services cuirass)
#:use-module (guix channels)
#:use-module (guix gexp)
+ #:use-module (guix modules)
#:use-module (guix records)
#:use-module (guix store)
#:use-module (guix utils)
@@ -278,9 +280,11 @@ (define (cuirass-activation config)
(profile (string-append "/var/guix/profiles/per-user/" user))
(roots (string-append profile "/cuirass"))
(group (cuirass-configuration-group config)))
- (with-imported-modules '((guix build utils))
+ (with-imported-modules (source-module-closure
+ '((gnu build activation)))
#~(begin
- (use-modules (guix build utils))
+ (use-modules (guix build utils)
+ (gnu build activation))
(mkdir-p #$cache)
(mkdir-p #$log)
@@ -291,13 +295,13 @@ (define (cuirass-activation config)
(let ((uid (passwd:uid (getpw #$user)))
(gid (group:gid (getgr #$group))))
- (chown #$cache uid gid)
- (chown #$log uid gid)
- (chown #$roots uid gid)
- (chown #$profile uid gid)
+ (lchown-recursive #$cache uid gid)
+ (lchown-recursive #$log uid gid)
+ (lchown-recursive #$profile uid gid)
+ (lchown-recursive (passwd:dir (getpw #$user)) uid gid)
(when #$remote-cache
- (chown #$remote-cache uid gid)))))))
+ (lchown-recursive #$remote-cache uid gid)))))))
(define (cuirass-log-rotations config)
"Return the list of log rotations that corresponds to CONFIG."
--
2.34.0
B
B
Brice Waegeneire wrote on 21 Dec 2021 21:11
control message for bug #52712
(address . control@debbugs.gnu.org)
E1mzlTe-00083g-5l@debbugs.gnu.org
merge 52712 52454
quit
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 52712@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 52712
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch