(address . guix-patches@gnu.org)
* 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