Re: Patch: use SCM_CREDS authentication over PF_LOCAL sockets

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Garrett Wollman <wollman(at)khavrinen(dot)lcs(dot)mit(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch: use SCM_CREDS authentication over PF_LOCAL sockets
Date: 2001-08-17 03:35:40
Message-ID: 200108170335.f7H3Zev10533@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> <<On Thu, 16 Aug 2001 00:34:14 -0400 (EDT), Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> said:
>
> > OK, here is a cleaned up version of the patch that will apply to current
> > CVS. I worked it into the SO_PEERCRED code. I made some changes so it
> > compiles on BSD/OS. I am getting "Invalid Argument" from libpq's
> > sending of the credentials on BSD/OS.
>
> There are some funky alignment macros that you probably need to use on
> BSD/OS. Also, as written this will break on NetBSD and OpenBSD for
> reasons I have already noted (the structure is named something
> different there), and those systems will also require the alignment
> macros. (Basically, putting the two structures in another larger
> structure is a shortcut in my implementation which only works because
> the compiler puts the right amount of padding in; on those other
> systems, more padding is required.)

OK, attached is my current version of the patch. Would you download the
snapshot or CVS and let me know if this works on FreeBSD. Even if you
can't run it, can you tell me if it compiles.

Also, attached is the BSD/OS manual page that shows the use of the
macros for retrieving SCM. Can you add that and send me an updated
patch? Also, can you check to see if FreeBSD requires you to send the
full struct with empty cred, or if you can just send the header without
the struct. You will see in my patch for the libpq client part that
BSD/OS doesn't want the extra struct.

Looks like 7.2 is going to have overhauled authentication, and I would
really like to get this SCM stuff nailed down on as many platforms as
possible before going beta, which may happen as early as September 1.

--
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

Attachment Content-Type Size
unknown_filename text/plain 12.7 KB
unknown_filename text/plain 8.3 KB

Browse pgsql-patches by date

  From Date Subject
Next Message Karel Zak 2001-08-17 13:50:18 encoding names
Previous Message Bruce Momjian 2001-08-17 02:58:36 Re: Re: Proposal for encrypting pg_shadow passwords