Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf
Date
Msg-id 26583.1085512418@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf
Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf
List pgsql-bugs
I said:
> I would suggest adding more paranoia along these lines:

Actually the correct patch is as per attached.  Even without a core
dump, the original code would not print the token that was really
causing the problem :-(.  Please apply this patch and then tell us
what you see with winbind.

            regards, tom lane

Index: hba.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/libpq/hba.c,v
retrieving revision 1.116.2.1
diff -c -r1.116.2.1 hba.c
*** hba.c    5 Dec 2003 15:50:39 -0000    1.116.2.1
--- hba.c    25 May 2004 19:06:54 -0000
***************
*** 124,137 ****

              if (buf >= end_buf)
              {
                  ereport(LOG,
                          (errcode(ERRCODE_CONFIG_FILE_ERROR),
                           errmsg("authentication file token too long, skipping: \"%s\"",
!                                 buf)));
                  /* Discard remainder of line */
                  while ((c = getc(fp)) != EOF && c != '\n')
                      ;
-                 buf[0] = '\0';
                  break;
              }

--- 124,137 ----

              if (buf >= end_buf)
              {
+                 *buf = '\0';
                  ereport(LOG,
                          (errcode(ERRCODE_CONFIG_FILE_ERROR),
                           errmsg("authentication file token too long, skipping: \"%s\"",
!                                 start_buf)));
                  /* Discard remainder of line */
                  while ((c = getc(fp)) != EOF && c != '\n')
                      ;
                  break;
              }

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1156: Database is not initializing