Re: backend hba.c prob

Lists: pgsql-hackersPostg무지개 토토SQL
From: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: backend hba.c prob
Date: 2001-09-07 12:55:50
Message-ID: 20010907135550.H6283@quartz.newn.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-ports

gcc -O2 -pipe -g -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/include -c -o hba.o hba.c
hba.c: In function `ident_unix':
hba.c:923: sizeof applied to an incomplete type
hba.c:960: dereferencing pointer to incomplete type
hba.c:965: dereferencing pointer to incomplete type
gmake: *** [hba.o] Error 1

Now, the problem is sizeof(Cred), typedef struct cmsgcred Cred, and I don't
have a cmsgcred anywhere! The closest is my sys/ucred.h which defines a
struct ucred {
u_short cr_ref; /* reference count */
uid_t cr_uid; /* effective user id */
gid_t cr_gid; /* effective group id */
short cr_ngroups; /* number of groups */
gid_t cr_groups[NGROUPS]; /* groups */
};

Thoughts?

Cheers,

Patrick


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: backend hba.c prob
Date: 2001-09-07 14:14:27
Message-ID: 22759.999872067@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-ports

Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk> writes:
> hba.c: In function `ident_unix':
> hba.c:923: sizeof applied to an incomplete type

> Now, the problem is sizeof(Cred), typedef struct cmsgcred Cred, and I don't
> have a cmsgcred anywhere!

That's new code and we expected some portability issues with it :-(

What platform are you on exactly? What changes are needed to make the
code work there, and how might we #ifdef or autoconfigure a test for it?

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: backend hba.c prob
Date: 2001-09-07 14:37:28
Message-ID: 200109071437.f87EbSL20331@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg와이즈 토토SQL pgsql-ports

> gcc -O2 -pipe -g -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/include -c -o hba.o hba.c
> hba.c: In function `ident_unix':
> hba.c:923: sizeof applied to an incomplete type
> hba.c:960: dereferencing pointer to incomplete type
> hba.c:965: dereferencing pointer to incomplete type
> gmake: *** [hba.o] Error 1
>
>
> Now, the problem is sizeof(Cred), typedef struct cmsgcred Cred, and I don't
> have a cmsgcred anywhere! The closest is my sys/ucred.h which defines a
> struct ucred {
> u_short cr_ref; /* reference count */
> uid_t cr_uid; /* effective user id */
> gid_t cr_gid; /* effective group id */
> short cr_ngroups; /* number of groups */
> gid_t cr_groups[NGROUPS]; /* groups */
> };
>
> Thoughts?

Actually, yes.

The code currently runs on FreeBSD and BSD/OS. Right now, it tests for
BSD/OS and if it fails, assume it is FreeBSD. That is what the #ifndef
fc_uid is for. Now, I assume you are on a *BSD which is not one of
those. Do you have a struct fcred? I will browse your OS headers as
soon as I know your OS.

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


From: bpalmer <bpalmer(at)crimelabs(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: backend hba.c prob
Date: 2001-09-07 15:18:41
Message-ID: Pine.BSO.4.33.0109071110200.14876-100000@mizer.crimelabs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-ports

On Fri, 7 Sep 2001, Bruce Momjian wrote:

> > gcc -O2 -pipe -g -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/include -c -o hba.o hba.c
> > hba.c: In function `ident_unix':
> > hba.c:923: sizeof applied to an incomplete type
> > hba.c:960: dereferencing pointer to incomplete type
> > hba.c:965: dereferencing pointer to incomplete type
> > gmake: *** [hba.o] Error 1

> The code currently runs on FreeBSD and BSD/OS. Right now, it tests for
> BSD/OS and if it fails, assume it is FreeBSD. That is what the #ifndef
> fc_uid is for. Now, I assume you are on a *BSD which is not one of
> those. Do you have a struct fcred? I will browse your OS headers as
> soon as I know your OS.

Yeah, i'm seeing the same problem on OpenBSD-current (and 2.9). No Cred
anywhere!

This:

root(at)mizer:/usr/src$ egrep -r "fcred" *

turned up nothing interesting either.

Thoughts?

- Brandon

----------------------------------------------------------------------------
b. palmer, bpalmer(at)crimelabs(dot)net pgp:crimelabs.net/bpalmer.pgp5


From: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: backend hba.c prob
Date: 2001-09-07 16:21:26
Message-ID: 20010907172126.N6283@quartz.newn.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-ports

On Fri, Sep 07, 2001 at 10:14:27AM -0400, Tom Lane wrote:
> Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk> writes:
> > hba.c: In function `ident_unix':
> > hba.c:923: sizeof applied to an incomplete type
>
> > Now, the problem is sizeof(Cred), typedef struct cmsgcred Cred, and I don't
> > have a cmsgcred anywhere!
>
> That's new code and we expected some portability issues with it :-(
>
> What platform are you on exactly?

NetBSD-1.5X/i386 Remeber me? :)

> What changes are needed to make the
> code work there, and how might we #ifdef or autoconfigure a test for it?

I need to look at it some more for that..

Cheers,

Patrick


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, PostgreSQL-ports <pgsql-ports(at)postgresql(dot)org>
Subject: Re: backend hba.c prob
Date: 2001-09-07 20:05:58
Message-ID: 200109072005.f87K5wO20571@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-ports

> On Fri, Sep 07, 2001 at 10:14:27AM -0400, Tom Lane wrote:
> > Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk> writes:
> > > hba.c: In function `ident_unix':
> > > hba.c:923: sizeof applied to an incomplete type
> >
> > > Now, the problem is sizeof(Cred), typedef struct cmsgcred Cred, and I don't
> > > have a cmsgcred anywhere!
> >
> > That's new code and we expected some portability issues with it :-(
> >
> > What platform are you on exactly?
>
> NetBSD-1.5X/i386 Remeber me? :)
>
> > What changes are needed to make the
> > code work there, and how might we #ifdef or autoconfigure a test for it?
>
> I need to look at it some more for that..

OK, I have modified the CVS CREDS code to work on FreeBSD and BSD/OS,
and hopefully NetBSD. I talked to Jason at Linuxworld and I think this
code should work. Please test the CVS version and let me know. OpenBSD
doesn't support creds as far as I can tell.

To test, define 'ident sameuser' for 'local' in pg_hba.conf and restart
postmaster. Then connect as local user.

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


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: bpalmer <bpalmer(at)crimelabs(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: backend hba.c prob
Date: 2001-09-07 20:06:46
Message-ID: 200109072006.f87K6kb20765@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-ports

> On Fri, 7 Sep 2001, Bruce Momjian wrote:
>
> > > gcc -O2 -pipe -g -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/include -c -o hba.o hba.c
> > > hba.c: In function `ident_unix':
> > > hba.c:923: sizeof applied to an incomplete type
> > > hba.c:960: dereferencing pointer to incomplete type
> > > hba.c:965: dereferencing pointer to incomplete type
> > > gmake: *** [hba.o] Error 1
>
> > The code currently runs on FreeBSD and BSD/OS. Right now, it tests for
> > BSD/OS and if it fails, assume it is FreeBSD. That is what the #ifndef
> > fc_uid is for. Now, I assume you are on a *BSD which is not one of
> > those. Do you have a struct fcred? I will browse your OS headers as
> > soon as I know your OS.
>
> Yeah, i'm seeing the same problem on OpenBSD-current (and 2.9). No Cred
> anywhere!
>
> This:
>
> root(at)mizer:/usr/src$ egrep -r "fcred" *
>
> turned up nothing interesting either.

OK, CVS should compile on OpenBSD now. However, there is no SCM_CREDS
capability on OpenBSD that I can see so 'ident' will not work on 'local'
in pg_hba.conf.

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


From: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, PostgreSQL-ports <pgsql-ports(at)postgresql(dot)org>
Subject: Re: backend hba.c prob
Date: 2001-09-12 12:29:27
Message-ID: 20010912132927.F19454@quartz.newn.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-ports

On Fri, Sep 07, 2001 at 04:05:58PM -0400, Bruce Momjian wrote:
...
> OK, I have modified the CVS CREDS code to work on FreeBSD and BSD/OS,
> and hopefully NetBSD. I talked to Jason at Linuxworld and I think this
> code should work. Please test the CVS version and let me know. OpenBSD
> doesn't support creds as far as I can tell.
>
> To test, define 'ident sameuser' for 'local' in pg_hba.conf and restart
> postmaster. Then connect as local user.

All tested OK under NetBSD :)

Cheers,

Patrick


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, PostgreSQL-ports <pgsql-ports(at)postgresql(dot)org>
Subject: Re: backend hba.c prob
Date: 2001-09-12 14:32:50
Message-ID: 200109121432.f8CEWou07260@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers Postg무지개 토토SQL

> On Fri, Sep 07, 2001 at 04:05:58PM -0400, Bruce Momjian wrote:
> ...
> > OK, I have modified the CVS CREDS code to work on FreeBSD and BSD/OS,
> > and hopefully NetBSD. I talked to Jason at Linuxworld and I think this
> > code should work. Please test the CVS version and let me know. OpenBSD
> > doesn't support creds as far as I can tell.
> >
> > To test, define 'ident sameuser' for 'local' in pg_hba.conf and restart
> > postmaster. Then connect as local user.
>
> All tested OK under NetBSD :)

Really? Looks like I hit it right the first time. The NetBSD method is
very similar to the BSD/OS version.

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