File tree Expand file tree Collapse file tree 4 files changed +36
-7
lines changed Expand file tree Collapse file tree 4 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -9819,7 +9819,8 @@ test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext"
98199819
98209820
98219821
9822- for ac_func in cbrt fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync
9822+
9823+ for ac_func in cbrt fcvt getopt_long getpeereid memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync
98239824do
98249825as_ac_var=` echo " ac_cv_func_$ac_func " | $as_tr_sh `
98259826echo " $as_me :$LINENO : checking for $ac_func " >&5
Original file line number Diff line number Diff line change 11dnl Process this file with autoconf to produce a configure script.
2- dnl $Header: /cvsroot/pgsql/configure.in,v 1.218 2002/11/04 21:36:13 tgl Exp $
2+ dnl $Header: /cvsroot/pgsql/configure.in,v 1.219 2002/12/03 21:50:43 momjian Exp $
33dnl
44dnl Developers, please strive to achieve this order:
55dnl
@@ -782,7 +782,7 @@ PGAC_FUNC_GETTIMEOFDAY_1ARG
782782# SunOS doesn't handle negative byte comparisons properly with +/- return
783783AC_FUNC_MEMCMP
784784
785- AC_CHECK_FUNCS([cbrt fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync])
785+ AC_CHECK_FUNCS([cbrt fcvt getopt_long getpeereid memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync])
786786
787787AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
788788
Original file line number Diff line number Diff line change 11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/client-auth.sgml,v 1.41 2002/11/15 03:11:15 momjian Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/client-auth.sgml,v 1.42 2002/12/03 21:50:44 momjian Exp $
33-->
44
55<chapter id="client-authentication">
@@ -318,7 +318,8 @@ hostssl <replaceable>database</replaceable> <replaceable>user</replaceable> <
318318 support Unix-domain socket credentials (currently
319319 <systemitem class=osname>Linux</>, <systemitem
320320 class=osname>FreeBSD</>, <systemitem class=osname>NetBSD</>,
321- and <systemitem class=osname>BSD/OS</>).
321+ <systemitem class=osname>OpenBSD</>, and
322+ <systemitem class=osname>BSD/OS</>).
322323 </para>
323324
324325 <para>
Original file line number Diff line number Diff line change 1010 *
1111 *
1212 * IDENTIFICATION
13- * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.87 2002/09/04 20:31:19 momjian Exp $
13+ * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.88 2002/12/03 21:50:44 momjian Exp $
1414 *
1515 *-------------------------------------------------------------------------
1616 */
@@ -1216,7 +1216,34 @@ ident_inet(const struct in_addr remote_ip_addr,
12161216static bool
12171217ident_unix (int sock , char * ident_user )
12181218{
1219- #if defined(SO_PEERCRED )
1219+ #if defined(HAVE_GETPEEREID )
1220+ /* OpenBSD style: */
1221+ uid_t uid ;
1222+ gid_t gid ;
1223+ struct passwd * pass ;
1224+
1225+ errno = 0 ;
1226+ if (getpeereid (sock ,& uid ,& gid ) != 0 )
1227+ {
1228+ /* We didn't get a valid credentials struct. */
1229+ elog (LOG , "ident_unix: error receiving credentials: %m" );
1230+ return false;
1231+ }
1232+
1233+ pass = getpwuid (uid );
1234+
1235+ if (pass == NULL )
1236+ {
1237+ elog (LOG , "ident_unix: unknown local user with uid %d" ,
1238+ (int ) uid );
1239+ return false;
1240+ }
1241+
1242+ StrNCpy (ident_user , pass -> pw_name , IDENT_USERNAME_MAX + 1 );
1243+
1244+ return true;
1245+
1246+ #elsif defined(SO_PEERCRED)
12201247 /* Linux style: use getsockopt(SO_PEERCRED) */
12211248 struct ucred peercred ;
12221249 ACCEPT_TYPE_ARG3 so_len = sizeof (peercred );
You can’t perform that action at this time.
0 commit comments