From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: k.ninev@cdots.bg Newsgroups: gmane.emacs.bugs Subject: bug#70301: 30.0.50; secrets-create-item mangles cyrillic passwords Date: Tue, 09 Apr 2024 10:09:19 +0000 Message-ID: <1712657350147.2542454644.3268333671@cdots.bg> References: <86o7aix3wq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14060"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Vivaldi Mail/6.6.3271.57 Cc: 70301@debbugs.gnu.org To: Eli Zaretskii , Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 09 12:10:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ru8Qi-0003Rk-04 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Apr 2024 12:10:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ru8QR-0006Z6-JZ; Tue, 09 Apr 2024 06:09:59 -0400 Original-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 ) id 1ru8QP-0006Ye-DY for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 06:09:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ru8QN-00038A-Gs for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 06:09:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ru8QV-0000Bk-CE for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 06:10:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: k.ninev@cdots.bg Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2024 10:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70301 X-GNU-PR-Package: emacs Original-Received: via spool by 70301-submit@debbugs.gnu.org id=B70301.1712657379462 (code B ref 70301); Tue, 09 Apr 2024 10:10:03 +0000 Original-Received: (at 70301) by debbugs.gnu.org; 9 Apr 2024 10:09:39 +0000 Original-Received: from localhost ([127.0.0.1]:48353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ru8Q5-00007A-BG for submit@debbugs.gnu.org; Tue, 09 Apr 2024 06:09:38 -0400 Original-Received: from mail.cdots.bg ([91.92.199.54]:60928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ru8Q1-00005b-SC for 70301@debbugs.gnu.org; Tue, 09 Apr 2024 06:09:35 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.cdots.bg (Postfix) with ESMTP id 45DAFA0D6352; Tue, 9 Apr 2024 13:09:20 +0300 (EEST) Original-Received: from mail.cdots.bg ([127.0.0.1]) by localhost (mail.cdots.bg [127.0.0.1]) (amavis, port 10032) with ESMTP id hFXsvU1LRa3A; Tue, 9 Apr 2024 13:09:19 +0300 (EEST) Original-Received: from localhost (localhost [127.0.0.1]) by mail.cdots.bg (Postfix) with ESMTP id 9CD53A0D634D; Tue, 9 Apr 2024 13:09:19 +0300 (EEST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cdots.bg 9CD53A0D634D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cdots.bg; s=38EB8BB6-1E4E-11E5-AEB1-E0FC2BDD2164; t=1712657359; bh=Wse4o1wiJAQzQxJ99gsm4DDKqwkdkEsJ4BSfUgVFlNw=; h=Message-Id:From:To:Date:MIME-Version; b=gtRipSRlilI4XaFMIRkSYK7WbI1Ysyj0Q0bJG+Y17HklhATyC838/bdpeqD74FAxw 4432r5dQMpl7ufCZfuRKqkJiGopBzJLu/a8LsMsPuOisVSlMtX1NHxo/1SCf4aQRr3 /aTk3R75EjKruZE0A/oRaU0c05BdAmj2VaE7cieI= X-Virus-Scanned: amavis at mail.cdots.bg Original-Received: from mail.cdots.bg ([127.0.0.1]) by localhost (mail.cdots.bg [127.0.0.1]) (amavis, port 10026) with ESMTP id 5tmI0Coa2a5C; Tue, 9 Apr 2024 13:09:19 +0300 (EEST) Original-Received: from noip.localdomain (unknown [85.196.152.25]) by mail.cdots.bg (Postfix) with ESMTPSA id 7F4DCA0D3264; Tue, 9 Apr 2024 13:09:19 +0300 (EEST) In-Reply-To: <86o7aix3wq.fsf@gnu.org> X-Mailer: Vivaldi Mail X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282983 Archived-At: Yes, the patch works for me. Thank you. On Tuesday, April 9, 2024 12:48 PM (+03:00), Eli Zaretskii wrote: > > Date: Tue, 09 Apr 2024 08:18:37 +0000 > > From: k.ninev--- via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" > >=20 > >=20 > > using this Secret Service API code in 'emacs -Q' > >=20 > > (require 'secrets) > > (secrets-create-item "session" "my item" "=D0=BF=D0=B0=D1=80=D0=BE= =D0=BB=D0=B0" :method "sudo" :user > > "joe" :host "remote-host") > >=20 > > Successfully creates an entry but the password "=D0=BF=D0=B0=D1=80= =D0=BE=D0=BB=D0=B0" is mangled to > > "?0@>;0" and cannot be viewed both with M-x secrets-show-secrets=20 > > and secret-tool cli tool , this does not occur with latin passwords >=20 > Does the patch below give good results? >=20 > Michael, I think we have a similar problem in > dbus-byte-array-to-string: when MULTIBYTE is non-nil, the function > should call decode-coding-string on the unibyte string it produces > instead of converting each byte to multibyte. Because the bytes in > the argument BYTE-ARRAY are not characters, they are raw bytes of the > UTF-8 sequence, so calling 'string' on them is not TRT. >=20 > diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el > index c1a670f..63fc874 100644 > --- a/lisp/net/secrets.el > +++ b/lisp/net/secrets.el > @@ -665,7 +665,8 @@ secrets-create-item > ;; Secret. > `(:struct :object-path ,secrets-session-path > (:array :signature "y") ;; No parameters. > - ,(dbus-string-to-byte-array password) > + ,(dbus-string-to-byte-array > + (encode-coding-string password 'utf-8)) > ,secrets-struct-secret-content-type) > ;; Do not replace. Replace does not seem to work. > nil)) >=20 --=20 KN