Index: configure
===================================================================
RCS file: /cvsroot/pgsql-server/configure,v
retrieving revision 1.227
diff -c -c -r1.227 configure
*** configure	4 Nov 2002 21:36:13 -0000	1.227
--- configure	3 Dec 2002 21:43:28 -0000
***************
*** 9819,9825 ****
  
  
  
! for ac_func in cbrt fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync
  do
  as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
  echo "$as_me:$LINENO: checking for $ac_func" >&5
--- 9819,9826 ----
  
  
  
! 
! for ac_func in cbrt fcvt getopt_long getpeereid memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync
  do
  as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
  echo "$as_me:$LINENO: checking for $ac_func" >&5
Index: configure.in
===================================================================
RCS file: /cvsroot/pgsql-server/configure.in,v
retrieving revision 1.218
diff -c -c -r1.218 configure.in
*** configure.in	4 Nov 2002 21:36:13 -0000	1.218
--- configure.in	3 Dec 2002 21:43:30 -0000
***************
*** 782,788 ****
  # SunOS doesn't handle negative byte comparisons properly with +/- return
  AC_FUNC_MEMCMP
  
! AC_CHECK_FUNCS([cbrt fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync])
  
  AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
  
--- 782,788 ----
  # SunOS doesn't handle negative byte comparisons properly with +/- return
  AC_FUNC_MEMCMP
  
! AC_CHECK_FUNCS([cbrt fcvt getopt_long getpeereid memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync])
  
  AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
  
Index: doc/src/sgml/client-auth.sgml
===================================================================
RCS file: /cvsroot/pgsql-server/doc/src/sgml/client-auth.sgml,v
retrieving revision 1.41
diff -c -c -r1.41 client-auth.sgml
*** doc/src/sgml/client-auth.sgml	15 Nov 2002 03:11:15 -0000	1.41
--- doc/src/sgml/client-auth.sgml	3 Dec 2002 21:43:40 -0000
***************
*** 318,324 ****
            support Unix-domain socket credentials (currently
            <systemitem class=osname>Linux</>, <systemitem
            class=osname>FreeBSD</>, <systemitem class=osname>NetBSD</>,
!           and <systemitem class=osname>BSD/OS</>).
           </para>
  
           <para>
--- 318,325 ----
            support Unix-domain socket credentials (currently
            <systemitem class=osname>Linux</>, <systemitem
            class=osname>FreeBSD</>, <systemitem class=osname>NetBSD</>,
!           <systemitem class=osname>OpenBSD</>, and 
!           <systemitem class=osname>BSD/OS</>).
           </para>
  
           <para>
Index: src/backend/libpq/hba.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/libpq/hba.c,v
retrieving revision 1.87
diff -c -c -r1.87 hba.c
*** src/backend/libpq/hba.c	4 Sep 2002 20:31:19 -0000	1.87
--- src/backend/libpq/hba.c	3 Dec 2002 21:43:42 -0000
***************
*** 1216,1222 ****
  static bool
  ident_unix(int sock, char *ident_user)
  {
! #if defined(SO_PEERCRED)
  	/* Linux style: use getsockopt(SO_PEERCRED) */
  	struct ucred peercred;
  	ACCEPT_TYPE_ARG3 so_len = sizeof(peercred);
--- 1216,1249 ----
  static bool
  ident_unix(int sock, char *ident_user)
  {
! #if defined(HAVE_GETPEEREID)
! 	/* OpenBSD style:  */
! 	uid_t uid;
! 	gid_t gid;
! 	struct passwd *pass;
! 
! 	errno = 0;
! 	if (getpeereid(sock,&uid,&gid) != 0)
! 	{
! 		/* We didn't get a valid credentials struct. */
! 		elog(LOG, "ident_unix: error receiving credentials: %m");
! 		return false;
! 	}
! 
! 	pass = getpwuid(uid);
! 
! 	if (pass == NULL)
! 	{
! 		elog(LOG, "ident_unix: unknown local user with uid %d",
! 			 (int) uid);
! 		return false;
! 	}
! 
! 	StrNCpy(ident_user, pass->pw_name, IDENT_USERNAME_MAX + 1);
! 
! 	return true;
! 
! #elsif defined(SO_PEERCRED)
  	/* Linux style: use getsockopt(SO_PEERCRED) */
  	struct ucred peercred;
  	ACCEPT_TYPE_ARG3 so_len = sizeof(peercred);
