GNU bug report logs - #70301
30.0.50; secrets-create-item mangles cyrillic passwords

Previous Next

Package: emacs;

Reported by: k.ninev <at> cdots.bg

Date: Tue, 9 Apr 2024 08:20:04 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Fixed in version 30.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 70301 <at> debbugs.gnu.org, k.ninev <at> cdots.bg
Subject: Re: bug#70301: 30.0.50; secrets-create-item mangles cyrillic passwords
Date: Wed, 10 Apr 2024 18:10:00 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi Eli,

>> Thanks for the patch. However, I believe we shouldn't fix it in
>> secrets.el, but in dbus.el.
>
> Then we ought to update the doc string of dbus-string-to-byte-array,
> which currently says the argument should be a UTF-8 encoded string.

Yep.

>> > 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.
>>
>> Yes. The following patch works for me. WDYT?
>
> If you are okay with changing the behavior of
> dbus-byte-array-to-string in backward-incompatible ways, I don't mind.
> But maybe this should be called out in NEWS.

I'm aware of this incompatibility. Well, I've played several hours today
with this. Since we have no information from D-Bus about the underlying
byte array, we must assume a given context. A sequence of raw 8-bit
bytes, unibyte, representing an UTF-8 encoded string seems to be aapropriate.

If people want another conversion for a D-Bus byte array, it is still
possible. But they shouldn't use dbus-byte-array-to-string and
dbus-string-to-byte-array then.

I'll puzzle everything together by tomorrow.

Best regards, <<michael.




This bug report was last modified 1 year and 93 days ago.

Previous Next


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