From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70301: 30.0.50; secrets-create-item mangles cyrillic passwords Date: Tue, 09 Apr 2024 12:48:37 +0300 Message-ID: <86o7aix3wq.fsf@gnu.org> References: <1712650236526.1662743497.3911072838@cdots.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22470"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70301@debbugs.gnu.org To: k.ninev@cdots.bg, Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 09 11:49:23 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 1ru86U-0005eM-MM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Apr 2024 11:49:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ru864-0001pY-GQ; Tue, 09 Apr 2024 05:48:56 -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 1ru862-0001p0-L2 for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 05:48:54 -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 1ru862-000815-Ct for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 05:48:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ru86A-0005so-3Z for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 05:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2024 09:49:02 +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.171265613922592 (code B ref 70301); Tue, 09 Apr 2024 09:49:02 +0000 Original-Received: (at 70301) by debbugs.gnu.org; 9 Apr 2024 09:48:59 +0000 Original-Received: from localhost ([127.0.0.1]:48289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ru866-0005sG-V0 for submit@debbugs.gnu.org; Tue, 09 Apr 2024 05:48:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ru863-0005r7-LW for 70301@debbugs.gnu.org; Tue, 09 Apr 2024 05:48:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ru85p-0007vC-G3; Tue, 09 Apr 2024 05:48:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=eVRYXR6MxpfEZ40L5KEkr2qKV4nHzdVwt/NeyZI1Z/g=; b=TA0+yX4E2fswFR0uqpYA P5cTiNn6lCA/rrKfqPcycs6GOC6qvGngk4vxIlk993QesdTChJSmGoY6lsDLnIyRLa4Hib96ZJHg3 GL2sfrWtgdOfgSt3SqOSVIMhY33/ytOK4vDxH/UikypKG2QUhgbEctE8oO3qavXCPsXuEEwvEaAX8 Rs9yde8WIQP1ocie9Xq6vaYs12PIISnYNSfcmv4czno7VTcmnwU1/rF0x+nMjxN7VBVn7J04QhYoR ZeZmieHfzWGnlRHcKItgXAFYSu16o6NLcOrcSvbiFaIzbqccCjZjIkaHH3Ulf/TQQV6hAfpl9ETF8 x5xk0RJ3txsk6w==; In-Reply-To: <1712650236526.1662743497.3911072838@cdots.bg> (bug-gnu-emacs@gnu.org) 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:282981 Archived-At: > 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" > > > using this Secret Service API code in 'emacs -Q' > > (require 'secrets) > (secrets-create-item "session" "my item" "парола" :method "sudo" :user > "joe" :host "remote-host") > > Successfully creates an entry but the password "парола" is mangled to > "?0@>;0" and cannot be viewed both with M-x secrets-show-secrets > and secret-tool cli tool , this does not occur with latin passwords Does the patch below give good results? 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. 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))