GNU bug report logs -
#52452
Guix related downloads from ftp.gnu.org are slow over IPv6
Previous Next
Full log
Message #8 received at 52452 <at> debbugs.gnu.org (full text, mbox):
>+(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.