-
Notifications
You must be signed in to change notification settings - Fork 578
crypt() works randomly with utf-8 #4784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From [email protected]Created by [email protected]crypt in current devels behaves randomly because pp_crypt "decodes" the Newz(688, t, len, char); this doesn't leave space for the final 0 byte (which crypt needs). An Newz(688, t, len + 1, char); Have fun ;) Perl Info
|
From @jhiOn Sat, Jan 05, 2002 at 12:40:39AM +0100, Marc Lehmann wrote:
Hmmm, not for any of my platforms (Linux, Solaris, HP-UX, Tru64).
Documented... where?
But I can add that one byte there if it makes your crypt() happier. -- |
From @jhiOn Sat, Jan 05, 2002 at 12:40:39AM +0100, Marc Lehmann wrote:
Hmmm, the Newz() is relevant only for the DO_UTF8() branch. I hope -- |
From [Unknown Contact. See original ticket]On Sat, Jan 05, 2002 at 02:34:26AM +0200, Jarkko Hietaniemi <jhi@iki.fi> wrote:
This is wrong. It will fail on EACH and EVERY UNIX, unless malloc
Does it need documentation? common sense tells me that crypt doesn't
_my_ crypt? how does your crypt guess your password length when it gets On Sat, Jan 05, 2002 at 02:37:55AM +0200, Jarkko Hietaniemi <jhi@iki.fi> wrote:
Sorry, but who told me that the *internal* representation of strings does And as long as perl randomly converts latin1 to utf-8 at various points It's perfectly safe to feed in utf-8 into *any* vendors crypt as long as It's even perfectly safe to feed utf-8 with >255 chars into crypt, the
You confuse Unicode with characters > 256. Characters below 256 exist in -- |
From [Unknown Contact. See original ticket]On Sat, Jan 05, 2002 at 02:36:22AM +0100, Marc Lehmann <pcg@goof.com> wrote:
-- |
From @jhiOn Sat, Jan 05, 2002 at 02:36:22AM +0100, Marc A. Lehmann wrote:
Okay, on this you are right.
-- |
From @jhi(1) The dynamic allocation with Newz() happens only in the case when (2) Even if we had met the UTF0-8 case more often, we would have been (3) Trying to argue that crypt() would have any sensible meaning on the [1] At least the old de facto standard crypt(). Yes, there are fancier -- |
From [Unknown Contact. See original ticket]Marc Lehmann wrote: One small nit about that -- one that doesn't really impact for or against Utf8 looks like ASCII or values < 128. From 128 through 255 (and beyond), But then, if all characters of a string have ordinals <= 255, perl does I guess that's the question. If a system's native encoding is byte-oriented, |> Sorry, but who told me that the *internal* representation of strings Jarkko Responds: I've heard that NT syscalls, for example, accept strings as UTS-2 (16-bit For 8-bit systems, I guess it hinges on the guarantee. If the guarantee Jeffrey |
From [Unknown Contact. See original ticket]On Sat, 5 Jan 2002, Marc wrote:
The manpage for the crypt() on Linux says : By taking the lowest 7 bit of each character of the key, a Which implies that it doesn't guess the length but rather assumes that it /J\ |
From @jhi
Yes, you are right, a terminating zero byte needs to be there, and -- |
From [Unknown Contact. See original ticket]On Sat, Jan 05, 2002 at 11:04:19AM +0000, Jonathan Stowe <gellyfish@gellyfish.com> wrote:
If this were true, every login program would be in error, as would be perl. No matter what, the fix is a required fix. -- |
From [Unknown Contact. See original ticket]On Sat, Jan 05, 2002 at 01:02:32AM -0800, Jeffrey Friedl <jfriedl@yahoo.com> wrote:
I think 255/256 is right. All world is not the US, and 8-bit-characters are Under linux, for example, syscalls are defined to use utf-8, but nobody uses Now Jarkko claimsthat perl programmers must not now the internal
Perl tries, not very hard. I found trhe bug in crypt (which, again, is the $pass = "public"; Since $pass was mareked as utf-8, I triggered the (non-utf-8-related) bug in (I highly regard Jarkko as a great programmer, but his treatement of
I think not in all cases, but in most (so I agree mostly with
So pelr will croak randomly because some previous operationb utf-8-ifid Of course, you should also do this for all syscalls.
I thought UCS-2 (and lately UTF-17, because UCS-2 can't do full unicode),
If perl suddenly can't work with the files rreturned by readdir, I would Anmd if perl stops working with ascii paths because they get marked as However, the bug report was about a missing zero byte, which Jarkko also Why is it so difficult to get an obvious bugfix into pelr? -- |
From [Unknown Contact. See original ticket]On Sat, Jan 05, 2002 at 06:49:51AM +0200, Jarkko Hietaniemi <jhi@iki.fi> wrote:
Sure, why aren't you happy because I found this obvious bug before you
Well, the bytes behind malloc might well be at the end of the page, so it Even more of a wonder that I found the bug.
I agree fully. That's why you *must* convert it to 8-bit-bytes.
Cool perl. Croaks depending on the phase of the moon.
Like the one on your linux platform that you claimed not accept *pissed off* -- |
From [Unknown Contact. See original ticket]Let me add here that Jarkko and I seem to want to kill each other without In any case, the fix is/will be applied and perl works as I think it Sorry for making p5p a small battlefield. -- |
From @jhi
I have no idea why you haven't been reading my several public and
The downgrade happens automatically in pp_crypt() so I have no idea
Your bugfix is now in Perl. Has been there since your bug report. -- |
From [Unknown Contact. See original ticket]On Sat, Jan 05, 2002 at 09:40:17PM +0200, Jarkko Hietaniemi <jhi@iki.fi> wrote:
I am really sorry, I just answered mail in the order they arrive, and I
I was just puzzled because of your remark about passing UTF-8 into crypt But since perl utf8_upgrades ascii scalars regularly and without any But maybe you meant something completely different and we just
I hope this mail qualifies as objective and not angry again. If somebody Sorry for the confusion. -- |
From @jhi
I think what I meant was that the string cannot be downgraded to -- |
From [Unknown Contact. See original ticket]On Sat, 5 Jan 2002, Marc wrote:
Er, this *is* true. Of course for shorter passwords it would be an error /J\ |
From [Unknown Contact. See original ticket]On Sat, Jan 05, 2002 at 10:00:49PM +0200, Jarkko Hietaniemi <jhi@iki.fi> wrote:
(As I wrote to you earlier, but not on this list), I am fine with croaking So everything (== crypt ;) is extraordinarily fine in perl right now ;) -- |
From [Unknown Contact. See original ticket]On Sat, Jan 05, 2002 at 08:25:31PM +0000, Jonathan Stowe <gellyfish@gellyfish.com> wrote:
Nonsense. Show me a crypt that blindly reads eight characters, you will The standard (which is SuSv2 in this case) also doesn't claim such
And it currently isn't an error, so you are wrong... -- |
From [Unknown Contact. See original ticket]On Jan 5, A., MISSINGpcgTERMINATOR, and UNEXPECTED_DATA_AFTERpcg@goofsaid:
The crypt() I use, that Perl uses, and most login programs I've seen use, I have a password that is more than 8 characters on a machine, and I only See: http://www.art.net/~hopkins/Don/unix-haters/login.html -- |
From [Unknown Contact. See original ticket]On Sat, Jan 05, 2002 at 03:52:14PM -0500, Jeff 'japhy' Pinyan <jeffp@crusoe.net> wrote:
And if my buffer is shorter than 8 byte it sometimes segfaults, no sorry When you probably mean is that crypt treats shorter passwords as _if_ it
I am aware of this. Are you? Please, I am angry enough at so many people claiming utter nonsense (if Basically, it works like it, in practise, works, and this is in harmony Please also note that Jarkko agrees with that, as probbaly does everybody (And take replies off-list, this is not perl-related in any way). *sigh* -- |
Migrated from rt.perl.org#8180 (status was 'resolved')
Searchable as RT8180$
The text was updated successfully, but these errors were encountered: