GNU bug report logs - #52452
Guix related downloads from ftp.gnu.org are slow over IPv6

Previous Next

Package: guix;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sun, 12 Dec 2021 15:17:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Maxime Devos <maximedevos <at> telenet.be>
To: 52452 <at> debbugs.gnu.org
Subject: bug#52452: PATCH v2 2/4] activation: Add 'lchown-recursive'.
Date: Wed, 22 Dec 2021 19:14:14 +0000
>+(define (lchown-recursive file owner group)
>+  "As 'lchown' but recursively, change ownership of FILE to the
>integer values
>+OWNER and GROUP without dereferencing symbolic links it encounter."
>+  (nftw file
>+        (lambda (filename statinfo flag base level)
>+          (catch 'system-error
>+            (lambda ()
>+              (when (member flag '(regular directory symlink))
>+                (lchown filename owner group)))
>+            (lambda args
>+              (format (current-error-port)
>+                      "warning: failed to chown ~s: ~a~%"
>+                      filename
>+                      (strerror (system-error-errno args)))))
>+          #t)
>+        'physical))

This is racy (compare with mkdir-p/perms for example).
This race can be resolved by using 'openat' & 'chownat' &
'AT_SYMLINK_NOFOLLOW' from
<https://lists.gnu.org/archive/html/guile-devel/2021-11/msg00005.html>.

Greetings,
Maxime.





This bug report was last modified 3 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.