guix_mirror_bot pushed a commit to branch master
in repository guix.

commit f677066fbe404f4214f5ad1f1438cebceaf00cb1
Author: Arjan Adriaanse <[email protected]>
AuthorDate: Sun Jul 19 20:19:34 2026 +0200

    services: vfs-mapping: Handle nonexistant source users and groups.
    
    * gnu/services/linux.scm (vfs-mapping-shepherd-services):
      Implement error handling for resolving source user and group names.
    
    Merges: https://codeberg.org/guix/guix/pulls/10053
    Signed-off-by: Nguyễn Gia Phong <[email protected]>
---
 gnu/services/linux.scm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm
index 1281148004..8902c59148 100644
--- a/gnu/services/linux.scm
+++ b/gnu/services/linux.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2025 Edouard Klein <[email protected]>
 ;;; Copyright © 2026 Giacomo Leidi <[email protected]>
 ;;; Copyright © 2026 Joan Vilardaga Castro <[email protected]>
+;;; Copyright © 2026 Arjan Adriaanse <[email protected]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1311,8 +1312,16 @@ placed in a udev rules file."
               (let* ((stat (stat #$source))
                      (uid (stat:uid stat))
                      (gid (stat:gid stat))
-                     (source-user (passwd:name (getpwuid uid)))
-                     (source-group (group:name (getgrgid gid))))
+                     (source-user
+                      (catch #t
+                        (lambda () (passwd:name (getpwuid uid)))
+                        ;; In case user does not exist failover to plain uid.
+                        (const (number->string uid))))
+                     (source-group
+                      (catch #t
+                        (lambda () (group:name (getgrgid gid)))
+                        ;; In case group does not exist failover to plain gid.
+                        (const (number->string gid)))))
                 (match (quote #$policy)
                   ('bind
                    (mount #$source #$destination

Reply via email to