Re: crypt and null termination

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: crypt and null termination
Date: 2001-08-17 02:59:40
Message-ID: 200108170259.f7H2xec05446@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > It seems to say that the salt passed to crypt should be null-terminated,
>
> Hmm. The HPUX man page for crypt() just says that
> salt is a two-character string chosen from the set [a-zA-Z0-9./]
> which I think is the traditional spec. Looks like BSD has adopted some
> local extensions.
>
> Note that the BSD page specifies that the extended salt format starts
> with '_', which is not one of the allowed characters in the traditional
> format. I bet they check that before trying to fetch more than 2 bytes.
> The second paragraph you quote doesn't say anything about null
> termination.
>
> Still, it wouldn't be a bad idea to add a null byte ... couldn't hurt.

That was my feeling, and it may explain some of our crypt() platform
failures!

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2001-08-17 03:06:21 Re: crypt and null termination
Previous Message Tom Lane 2001-08-17 02:51:21 Re: crypt and null termination