GNU bug report logs - #72427
emacs-daemons: string handling error

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Christopher Howard <christopher@HIDDEN>; dated Fri, 2 Aug 2024 19:52:01 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Aug 2024 19:51:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 02 15:51:43 2024
Received: from localhost ([127.0.0.1]:53770 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sZyJT-0002d4-DY
	for submit <at> debbugs.gnu.org; Fri, 02 Aug 2024 15:51:43 -0400
Received: from lists.gnu.org ([209.51.188.17]:45404)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <christopher@HIDDEN>) id 1sZyJQ-0002cv-Qc
 for submit <at> debbugs.gnu.org; Fri, 02 Aug 2024 15:51:42 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <christopher@HIDDEN>)
 id 1sZyJ7-0007Io-TC
 for bug-guix@HIDDEN; Fri, 02 Aug 2024 15:51:21 -0400
Received: from mx.kolabnow.com ([212.103.80.155])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <christopher@HIDDEN>)
 id 1sZyJ5-0004nB-ME
 for bug-guix@HIDDEN; Fri, 02 Aug 2024 15:51:21 -0400
Received: from localhost (unknown [127.0.0.1])
 by mx.kolabnow.com (Postfix) with ESMTP id 8EBF43297AC3
 for <bug-guix@HIDDEN>; Fri,  2 Aug 2024 21:51:07 +0200 (CEST)
Authentication-Results: ext-mx-out013.mykolab.com (amavis);
 dkim=pass (2048-bit key) reason="pass (just generated, assumed good)"
 header.d=kolabnow.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h=
 content-transfer-encoding:content-type:content-type:mime-version
 :message-id:date:date:subject:subject:from:from:received
 :received:received; s=dkim20240523; t=1722628264; x=1724442665;
 bh=CIOZqsrNDufk7mlGvdAUeaYULjk/nNE8DiG7dUB0W9o=; b=b6bBiLwsLKL0
 K2yIOWZkuEaH8HYPvj3loxeDFjaIYn/xIs3pb0WKVa6dNh3si5RUVfagL15EVb7E
 8aKDtX3ZMsfyajII4RKfvpl2K24ZlHxZ9l6KEtbT9cArGXRHJF6LEj667YYkaIJd
 4K4GaZzG9hRtxmaM/oIXn4mfSrfnyi0R5MKlMn07dVkzyyuB4734HVKH8/Y9dFXu
 f0VpBVXH1wlQTnW2G7YRySa4W/esFiuBDCCn9bZ9lAAO9v8ZsikrvQEj3Qr1ndMs
 yfFlPz6yyHAvSYZECNoEj1fQFFyKMgP6pQU6JjXm2CnNzFYX3jiXfIsWuvQhTGcL
 y0+gL+X6eA==
X-Virus-Scanned: amavis at mykolab.com
X-Spam-Flag: NO
X-Spam-Score: -1
X-Spam-Level: 
X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1]
 autolearn=ham autolearn_force=no
Received: from mx.kolabnow.com ([127.0.0.1])
 by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024)
 with ESMTP id P4LU9iptXlHW for <bug-guix@HIDDEN>;
 Fri,  2 Aug 2024 21:51:04 +0200 (CEST)
Received: from int-mx011.mykolab.com (unknown [10.9.13.11])
 by mx.kolabnow.com (Postfix) with ESMTPS id 2E9FE30EC7EC
 for <bug-guix@HIDDEN>; Fri,  2 Aug 2024 21:51:03 +0200 (CEST)
Received: from ext-subm010.mykolab.com (unknown [10.9.6.10])
 by int-mx011.mykolab.com (Postfix) with ESMTPS id 69DD3307FF62
 for <bug-guix@HIDDEN>; Fri,  2 Aug 2024 21:51:03 +0200 (CEST)
From: Christopher Howard <christopher@HIDDEN>
To: bug-guix@HIDDEN
Subject: emacs-daemons: string handling error
Date: Fri, 02 Aug 2024 11:51:00 -0800
Message-ID: <871q36bt5n.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: none client-ip=212.103.80.155;
 envelope-from=christopher@HIDDEN; helo=mx.kolabnow.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001,
 SPF_NONE=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

The emacs-daemons we use, which is the melpa-stable version, is very old (a=
bout 6 years out of date), and has a bug caused by a string handling issue.=
 This occurs when "Daemons Always Sudo" is set to on, which is required if =
you want to view the system processes of shepherd, rather than your home pr=
ocesses.

Recipe:

1. Use "customize-group daemons" and set "Daemons Always Sudo" to "on". Sav=
e and set, or set for the session.
2. M-x daemons.

This will throw an error along the lines of

```
Operation on Daemons Always Sudo: 0
cd: No such directory: /sudo::/tmp/tmp.NyPiPKi1eL

```

If you look into this, you'll discover that function "daemons--sudo" does n=
ot trim the newline off the end of the result when it calls "daemons--shell=
-command-to-string". A slightly modified version like so will work (the sam=
e, but with string-trim inserted):

```
(with-eval-after-load 'daemons
  (defun daemons--sudo ()
    "Become root using TRAMP (if on local system).

Switches to a temporary directory to minimise damage potential.

Note that this only works on the local system, not remote systems.  For a r=
emote
system you need to specify your own TRAMP path with a privileged user.

e.g. /ssh:me@HIDDEN|sudo:example.com:"
    (unless (daemons--using-tramp-path-p default-directory)
      (let ((tempdir (string-trim (daemons--shell-command-to-string "mktemp=
 -d"))))
        (cd (format "/sudo::%s" tempdir))))))
```

I wanted to reach out to the author/maintainer and find out if he was plann=
ing to tag another release for melpa-stable, but I don't have a github acco=
unt and don't allow github javascript. I was unable to find any other conta=
ct information for him. Maybe somebody who uses github would want to reach =
out to him. Or if not, maybe we would want to patch the stable version.

Here is my system information:

```
christopher@theoden=20
-------------------=20
OS: Guix System x86_64=20
Host: OptiPlex 9020 00=20
Kernel: 5.15.161-gnu=20
Uptime: 29 days, 22 hours, 33 mins=20
Packages: 167 (guix-system), 251 (guix-user)=20
Shell: bash 5.1.16=20
Resolution: 1920x1080=20
DE: GNOME=20
Theme: Adwaita [GTK2/3]=20
Icons: Adwaita [GTK2/3]=20
Terminal: shepherd=20
CPU: Intel i5-4570 (4) @ 3.600GHz=20
GPU: AMD ATI Radeon HD 8490 / R5 235X OEM=20
GPU: Intel HD Graphics=20
Memory: 4265MiB / 15914MiB=20
```

``` guix describe
Generation 137	Jul 27 2024 05:04:20	(current)
  guix c6ff1d6
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: c6ff1d6ff761af0bd9bac5403fd834f04a14a192
```

--=20
=F0=9F=93=9B Christopher Howard
=F0=9F=9A=80 gemini://gem.librehacker.com
=F0=9F=8C=90 http://gem.librehacker.com

=D7=91=D7=A8=D7=90=D7=A9=D7=99=D7=AA =D7=91=D7=A8=D7=90 =D7=90=D7=9C=D7=94=
=D7=99=D7=9D =D7=90=D7=AA =D7=94=D7=A9=D7=9E=D7=99=D7=9D =D7=95=D7=90=D7=AA=
 =D7=94=D7=90=D7=A8=D7=A5




Acknowledgement sent to Christopher Howard <christopher@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#72427; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

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