Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 42F3EB5D800 for ; Sun, 29 May 2011 15:49:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 83454-04 for ; Sun, 29 May 2011 18:49:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id DAE39B5DBB6 for ; Sun, 29 May 2011 15:49:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p4TInhWL024640; Sun, 29 May 2011 14:49:43 -0400 (EDT) To: Martin Pitt cc: PostgreSQL Bugs , Petr Salinger , 612888@bugs.debian.org Subject: Re: [PATCH] ident authentication fails on kFreeBSD/x86-64 due to wrong struct size In-reply-to: <24047.1306692513@sss.pgh.pa.us> References: <20110522141921.GC3123@piware.de> <24047.1306692513@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 29 May 2011 14:08:33 -0400" Date: Sun, 29 May 2011 14:49:43 -0400 Message-ID: <24639.1306694983@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/220 X-Sequence-Number: 30359 I wrote: > Martin Pitt writes: >> /* Compute size without padding */ >> - char cmsgmem[ALIGN(sizeof(struct cmsghdr)) + ALIGN(sizeof(Cred))]; /* for NetBSD */ >> + char cmsgmem[ALIGN(sizeof(struct cmsghdr)) + sizeof(Cred)]; /* for NetBSD */ > Hm. That code's been like that for a very long time (since 2001 > according to the git history...). How much confidence can we have > that this change won't result in breakage on other flavors of *BSD? BTW, I wonder whether the real bug isn't on the libpq side instead. I notice that its idea of the cmsgmem size is not like the backend's: #ifdef HAVE_STRUCT_CMSGCRED /* Prevent padding */ char cmsgmem[sizeof(struct cmsghdr) + sizeof(struct cmsgcred)]; This corresponds to the original coding in the backend, but not to what the code looks like now. The subsequent whacking around of the backend cmsgmem declaration was documented as fixing problems on NetBSD and then OpenBSD. If it's true as per the libpq comment that only FreeBSD needs the client-side cmsgmem buffer, this might not have gotten retested. regards, tom lane