GNU bug report logs - #72342
[PATCH] services: syncthing: incorrect guessing of HOME variable

Previous Next

Package: guix-patches;

Reported by: Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>

Date: Sun, 28 Jul 2024 17:21:01 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72342 in the body.
You can then email your comments to 72342 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#72342; Package guix-patches. (Sun, 28 Jul 2024 17:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 28 Jul 2024 17:21:02 GMT) Full text and rfc822 format available.

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

From: Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>
To: guix-patches <at> gnu.org
Cc: Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>
Subject: [PATCH] services: syncthing: incorrect guessing of HOME variable
Date: Sun, 28 Jul 2024 19:09:41 +0200
Fixed the issue described here:
https://lists.gnu.org/archive/html/help-guix/2024-01/msg00034.html

Fix `syncthing-shepherd-service` failing to guess the correct `HOME`
environment variable when it's `<syncthing-configuration>` does not have a
value for the `home` or `user` fields.

Change-Id: I102bfe5feba1ebb349a0cde1c987c0c10ebbab7a
---
Hello.

Ludo asked[1] to send a patch to fix `home-syncthing-service-type` not guessing the correct value
for the `HOME` environment variable. Since the discussions seems stalled, here you
have the patch.

[1]https://lists.gnu.org/archive/html/help-guix/2024-01/msg00050.html

Have a great day!
Sergio.

 gnu/services/syncthing.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/services/syncthing.scm b/gnu/services/syncthing.scm
index 9bb623186b..a7a9c6aadd 100644
--- a/gnu/services/syncthing.scm
+++ b/gnu/services/syncthing.scm
@@ -73,7 +73,15 @@ (define syncthing-shepherd-service
                 #:user #$(and (not home-service?) user)
                 #:group #$(and (not home-service?) group)
                 #:environment-variables
-                (append (list (string-append "HOME=" (or #$home (passwd:dir (getpw #$user))))
+                (append
+                 (list
+                  (string-append "HOME="
+                                 (or #$home
+                                     (passwd:dir
+                                      (getpw (if (and #$home-service?
+                                                      (not #$user))
+                                                 (getuid)
+                                                 #$user)))))
                               "SSL_CERT_DIR=/etc/ssl/certs"
                               "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")
                         (filter (negate       ;XXX: 'remove' is not in (guile)

base-commit: fdc6274de5b1d617fcabb3f3af9d2c0dd2a6520d
-- 
2.45.2





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 21 Aug 2024 17:06:02 GMT) Full text and rfc822 format available.

Notification sent to Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>:
bug acknowledged by developer. (Wed, 21 Aug 2024 17:06:02 GMT) Full text and rfc822 format available.

Message #10 received at 72342-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es>
Cc: 72342-done <at> debbugs.gnu.org
Subject: Re: [bug#72342] [PATCH] services: syncthing: incorrect guessing of
 HOME variable
Date: Wed, 21 Aug 2024 19:04:12 +0200
Sergio Pastor Pérez <sergio.pastorperez <at> outlook.es> skribis:

> Fixed the issue described here:
> https://lists.gnu.org/archive/html/help-guix/2024-01/msg00034.html
>
> Fix `syncthing-shepherd-service` failing to guess the correct `HOME`
> environment variable when it's `<syncthing-configuration>` does not have a
> value for the `home` or `user` fields.
>
> Change-Id: I102bfe5feba1ebb349a0cde1c987c0c10ebbab7a

I adjusted the commit log and applied it, thanks!

Ludo'.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 19 Sep 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 273 days ago.

Previous Next


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