Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 448232E36D6 for ; Tue, 11 Dec 2007 18:32:11 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 11714-03-3 for ; Tue, 11 Dec 2007 18:32:02 -0400 (AST) Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 8881B2E366F for ; Tue, 11 Dec 2007 18:32:05 -0400 (AST) Received: from 219-89-36-140.dialup.xtra.co.nz ([219.89.36.140] helo=[192.168.1.2]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1J2Ddw-00060I-6S; Wed, 12 Dec 2007 11:32:00 +1300 Message-ID: <475F0FE0.6030902@opencloud.com> Date: Wed, 12 Dec 2007 11:32:00 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: sulfinu@gmail.com CC: pgsql-jdbc@postgresql.org Subject: Re: JDBC driver patch for non-ASCII users References: <200712071448.21411.sulfinu@gmail.com> <200712111421.47161.sulfinu@gmail.com> <475E8CAF.5000504@opencloud.com> <200712111722.19122.sulfinu@gmail.com> In-Reply-To: <200712111722.19122.sulfinu@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/74 X-Sequence-Number: 17929 sulfinu@gmail.com wrote: > On Tuesday 11 December 2007, Oliver Jowett wrote: >> A general String certainly might contain non-ASCII, but all Strings >> returned by UnixCrypt.crypt() contain only ASCII. See the implementation >> of UnixCrypt.crypt(), and in particular the UnixCrypt.cov_2char array. >> >> So I still do not understand why the change quoted above is necessary. >> Can you explain why it is necessary? > As I already stated, UnixCrypt looks like a lost cause to me. It truncates a > lot of the information in the password (try to imagine what happens to a > Unicode password at line 620), so it's result is a little more relevant than > nothing. That's not what I'm complaining about. Why do you need to change the encoding of the RESULT of UnixCrypt? >> The server only ever sends a subset of ASCII as crypt salt characters >> (specifically, the 62 characters a-z A-Z 0-9), so US-ASCII is just fine >> for decoding. See postmaster.c, RandomSalt() / RemapChar(). > I didn't know that, I'll take your word for it. Is it officially specified > anywhere? Can it be relied upon in the future? Yes. My crypt(3) manpage here says: * salt is a two-character string chosen from the set [a-zA-Z0-9./] * The returned value points to the encrypted password, a series of 13 printable ASCII characters (the first two characters represent the salt itself). * CONFORMING TO: SVr4, 4.3BSD, POSIX.1-2001 > I used the same Encoding.AUTHENTICATION_PHASE_ENCODING in all places for > consistency and it doesn't harm in any way, since I make sure it is an ASCII > extension. Ok, so this is an unnecessary change that we can discard? I actually think this patch as a whole is a lost cause (unfortunately, more because you seem to be unwilling to take feedback on it than any inherent problem). Would a patch that did only UTF-8 encoding, as suggested by Kris, handle the cases you need? -O