GNU bug report logs - #72920
[PATCH 0/3] Clean out /run upon boot

Previous Next

Package: guix-patches;

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

Date: Sat, 31 Aug 2024 19:44:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Hilton Chain <hako <at> ultrarare.space>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 72920 <at> debbugs.gnu.org
Subject: [bug#72920] [PATCH 2/3] services: cleanup: Create directories with the right mode upfront.
Date: Sat, 21 Sep 2024 09:11:32 +0800
Hi Ludo,

On Sun, 01 Sep 2024 03:47:23 +0800,
Ludovic Courtès wrote:
>
> * gnu/services.scm (cleanup-gexp): Pass mode as second argument to
> ‘mkdir’; remove ‘chmod’ calls.
>
> Change-Id: I8ac2dde0ca5d9bd6b2ef104d77141d8463d8b3fa
> ---
>  gnu/services.scm | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/services.scm b/gnu/services.scm
> index ce13c087ce..4a8e2b3b15 100644
> --- a/gnu/services.scm
> +++ b/gnu/services.scm
> @@ -660,10 +660,8 @@ (define (cleanup-gexp _)
>             (delete-file-recursively "/tmp")
>             (delete-file-recursively "/var/run")
>
> -           (mkdir "/tmp")
> -           (chmod "/tmp" #o1777)
> -           (mkdir "/var/run")
> -           (chmod "/var/run" #o755)
> +           (mkdir "/tmp" #o1777)
> +           (mkdir "/var/run" #o755)
>             (delete-file-recursively "/run/udev/watch.old"))))))
>
>  (define cleanup-service-type

It seems that the mode is not applied correctly:

--8<---------------cut here---------------start------------->8---
$ guile -c '(mkdir "/tmp/test" #o1777)' && stat /tmp/test
[...]
Access: (1755/drwxr-xr-t)  Uid: ( 1000/    hako)   Gid: (  998/   users)
[...]
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ guile -c '(and (mkdir "/tmp/test2") (chmod "/tmp/test2" #o1777))' && stat /tmp/test2
[...]
Access: (1777/drwxrwxrwt)  Uid: ( 1000/    hako)   Gid: (  998/   users)
[...]
--8<---------------cut here---------------end--------------->8---

Thanks

This bug report was last modified 294 days ago.

Previous Next


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