guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Mathieu Othacehe
Date: Fri, 28 May 2021 05:25:46 -0400 (EDT)

branch: master
commit 65ae16b3c8bc5f7c062fd62b723fdca763b25e3b
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Fri May 28 11:23:36 2021 +0200

    Register GC roots belonging to the current user.
    
    * src/cuirass/base.scm (default-gc-root-directory): New procedure.
    (%gc-root-directory): Use it.
    * src/cuirass/scripts/remote-server.scm (remote-server): Reset the GC root
    directory once the user privileges have been gathered.
---
 src/cuirass/base.scm                  | 12 ++++++++----
 src/cuirass/scripts/remote-server.scm |  5 +++++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index b318623..db16420 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -62,6 +62,7 @@
   #:use-module (srfi srfi-35)
   #:use-module (rnrs bytevectors)
   #:export (;; Procedures.
+            default-gc-root-directory
             call-with-time-display
             register-gc-roots
             read-parameters
@@ -136,13 +137,16 @@
           (scm-error 'wrong-type-arg
                      "%package-cachedir" "Not a string: ~S" (list #f) #f)))))
 
+(define (default-gc-root-directory)
+  (string-append %state-directory
+                 "/gcroots/profiles/per-user/"
+                 (passwd:name (getpwuid (getuid)))
+                 "/cuirass"))
+
 (define %gc-root-directory
   ;; Directory where garbage collector roots are stored.  We register build
   ;; outputs there.
-  (make-parameter (string-append %state-directory
-                                 "/gcroots/profiles/per-user/"
-                                 (passwd:name (getpwuid (getuid)))
-                                 "/cuirass")))
+  (make-parameter (default-gc-root-directory)))
 
 (define %gc-root-ttl
   ;; The "time to live" (TTL) of GC roots.
diff --git a/src/cuirass/scripts/remote-server.scm 
b/src/cuirass/scripts/remote-server.scm
index 6e5f89e..7ffb1a5 100644
--- a/src/cuirass/scripts/remote-server.scm
+++ b/src/cuirass/scripts/remote-server.scm
@@ -506,6 +506,11 @@ exiting."
         (and parameters
              (read-parameters parameters))
 
+        ;; Reset the GC root directory now that we have gathered user
+        ;; privileges.
+        (%gc-root-directory
+         (default-gc-root-directory))
+
         (atomic-box-set!
          %publish-pid
          (publish-server publish-port



reply via email to

[Prev in Thread] Current Thread [Next in Thread]