GNU bug report logs - #77201
[PATCH] guix: substitute-key-authorization: Fix case when acl symlink is broken

Previous Next

Package: guix-patches;

Reported by: Rutherther <rutherther <at> ditigal.xyz>

Date: Sun, 23 Mar 2025 09:49:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 77201 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> chbouib.org>
To: Ian Eure <ian <at> retrospec.tv>
Cc: Rutherther <rutherther <at> ditigal.xyz>, 77201 <at> debbugs.gnu.org
Subject: Re: [bug#77201] [PATCH] guix: substitute-key-authorization: Fix
 case when acl symlink is broken
Date: Tue, 15 Apr 2025 13:30:20 +0200
Hello,

Ian Eure <ian <at> retrospec.tv> writes:

>> -        (if (file-exists? acl-file)
>> +        (if (or (file-exists? acl-file) (symbolic-link? acl-file))
>
> Guile semantics are unhelpful here: `file-exists?' returns #f for a
> broken symlink, but `symbolic-link?' raises an exception if given a
> nonexistent path.

I would go back to the fundamentals:

  (match (and=> (false-if-exception (lstat acl-file)) stat:type)
    (#f ;file does not exist
     …)
    ('symlink
     …)
    (_
     …))

HTH!

Ludo’.




This bug report was last modified 18 days ago.

Previous Next


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