Subject: [bug#72337] Add /etc/subuid and /etc/subgid support

From: paul <[email-masked]>
Date: Sat, 7 Sep 2024 22:44:19 +0200

Hi Ludo’ ,

I'm sending an updated v4 patchset that should address most your 
comments. One point I'm not sure about is still how to use newuidmap. 
I've added a smoke test checking the content of /proc/self/uid_map 
inside a podman unshare command. I'm not sure that is sufficient but for 
a full Guile implementation I would wait for another issue if you agree. 
I still have to find a reliable smoke test. This is something I've been 
trying, without success so far :( .

(use-modules (ice-9 popen)
              ;(ice-9 rdelim)
              )

(define pid (primitive-fork))

(if (= 0 pid)
     (let ((port (pk 'port (open-output-pipe "bash"))))
       (sleep 1)
       (display "whoami\n" port)
       (display "cat /proc/self/uid_map\n" port)
       (display "cat /proc/self/gid_map\n" port)
       (if (not (eqv? 0 (status:exit-val (close-pipe port))))
           (error "Cannot run command")))
     (begin
       (system* "newuidmap" (number->string pid) "paul" "165536" "65536")))

Thank you for all your help in polishing this service,

giacomo