GNU bug report logs - #70165
D-Bus system service breaks reconfiguration when /var/run/dbus is present + /run and /var/run are on separate file systems.

Previous Next

Package: guix;

Reported by: Hilton Chain <hako <at> ultrarare.space>

Date: Wed, 3 Apr 2024 16:39:03 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: Hilton Chain <hako <at> ultrarare.space>, Vivien Kraus <vivien <at> planete-kraus.eu>, 70165 <at> debbugs.gnu.org
Subject: bug#70165: D-Bus system service breaks reconfiguration when /var/run/dbus is present + /run and /var/run are on separate file systems.
Date: Thu, 23 May 2024 11:10:06 +0200
Liliana Marie Prikler <liliana.prikler <at> gmail.com> skribis:

> Am Freitag, dem 05.04.2024 um 09:53 +0800 schrieb Hilton Chain:

[...]

>>            0 (rename-file "/tmp/tmp.9wyzRfQ28l/test" "/tmp/test")
>> 
>> ERROR: In procedure rename-file:
>> In procedure rename-file: Invalid cross-device link
>> --8<---------------cut here---------------end--------------->8---
> If I understand this reproducer correctly, there aren't even symbolic
> links involved, are there?
>
> Adding Ludo to CC, because this looks like a Guile bug to me.

‘rename-file’ merely wraps rename(2), which errors out with EXDEV
(“Invalid cross-link device”) when the source and targets are on
different file systems.

So the case above is behaving as expected.

What that means is that probably we shouldn’t be using ‘rename-file’
directly in cases where the source and target might be on different file
systems, and instead do something like:

  (define (rename-file* old new)
    ;; Like rename-file, but handle the case when OLD and NEW are on
    ;; different file systems.
    (catch 'system-error
      (lambda ()
        (rename-file old new))
      (lambda args
        (if (= EXDEV (system-error-errno args))
            (begin
              (copy-file old new)
              (delete-file old))
            (apply throw args)))))

(Untested.)

HTH!

Ludo’.




This bug report was last modified 1 year and 57 days ago.

Previous Next


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