public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
From: Lars Henriksen <Lars.Henriksen@netman.dk>
To: gargp@acm.org
Cc: "'Dirk Schenkewitz'" <Dirk.Schenkewitz@interface-ag.com>,
	help-gnats@gnu.org
Subject: Re: Patch: Fix user authentication + MKDB
Date: Sun, 29 Sep 2002 20:31:00 -0000	[thread overview]
Message-ID: <20020929094001.GA1288963@cluster2.netman.dk> (raw)
In-Reply-To: <000001c26671$28b76380$8d835f0f@home.org>

On Fri, Sep 27, 2002 at 02:59:28PM -0700, Pankaj K Garg wrote:
> >...
> > I've spotted one difference in behaviour: gnatsd no longer seems to
> > remember the user when you switch between databases (it still 
> > remembers
> 
> OOpss...yes, this should not have happened. There was a problem with
> the way I was handling NULL usernames and passwords.
> 
> Should be fixed in the attached patch.

It is! I believe your patch is OK now as far as plaintext/no password
is concerned. Apart from making the password checking work, this is a
convenient improvement.

But as for DES/MD5 I believe the original code is correct:

  else
    {
      /* DES crypt or MD5 hash of the password */
#ifdef HAVE_LIBCRYPT
      char *encrypted = crypt (password, hash);
      return encrypted && ! strcmp (encrypted, hash);
#else
      /* TODO: log some warning */
      return FALSE;
#endif
    }

It is for crypt() to decide the form of password encryption based on
the contents of hash: if hash begins with $1$ it will use MD5, if it
doesn't begin with $<digit>$ it will use DES. The return value of
crypt() is similarly adjusted with a starting $1$ for MD5. This assumes
an MD5-supporting crypt(3) (e.g. FreeBSD or GNU). With a traditional
Unix crypt() function you will of course get DES encryption.

Regards
Lars Henriksen


_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

  reply	other threads:[~2002-09-29  9:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-24  7:17 Pankaj K Garg
2002-09-25  8:25 ` Lars Henriksen
2002-09-25  8:25   ` Dirk Schenkewitz
2002-09-25  8:43     ` Pankaj K Garg
2002-09-27  6:01     ` Pankaj K Garg
2002-09-27 10:06       ` Yngve Svendsen
2002-09-27 11:40       ` Lars Henriksen
2002-09-27 14:28         ` Pankaj K Garg
2002-09-29  2:43           ` Lars Henriksen
2002-09-29 12:06             ` Pankaj K Garg
2002-09-29 20:31               ` Lars Henriksen [this message]
2002-09-30  3:21                 ` Pankaj K Garg
2002-10-03 21:27                   ` Lars Henriksen
2002-10-04  0:01                   ` Lars Henriksen
2002-10-04 10:25                     ` Pankaj K Garg
2002-10-04 11:41                       ` Yngve Svendsen
2002-09-25  8:59   ` Pankaj K Garg
2002-09-26  6:38     ` Lars Henriksen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020929094001.GA1288963@cluster2.netman.dk \
    --to=lars.henriksen@netman.dk \
    --cc=Dirk.Schenkewitz@interface-ag.com \
    --cc=gargp@acm.org \
    --cc=help-gnats@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).