mirror of
https://github.com/postgres/postgres.git
synced 2025-05-06 19:59:18 +03:00
Even though SO_PEERCRED is probably totally unportable, might as well
declare the getsockopt parameter as ACCEPT_TYPE_ARG3 to be consistent with our other uses of getsockopt.
This commit is contained in:
parent
49435fb98f
commit
d00b272299
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.60 2001/08/02 14:27:40 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.61 2001/08/02 14:39:35 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -863,11 +863,10 @@ ident_unix(int sock, char *ident_user)
|
|||||||
#ifdef SO_PEERCRED
|
#ifdef SO_PEERCRED
|
||||||
/* Linux style: use getsockopt(SO_PEERCRED) */
|
/* Linux style: use getsockopt(SO_PEERCRED) */
|
||||||
struct ucred peercred;
|
struct ucred peercred;
|
||||||
socklen_t so_len;
|
ACCEPT_TYPE_ARG3 so_len = sizeof(peercred);
|
||||||
struct passwd *pass;
|
struct passwd *pass;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
so_len = sizeof(peercred);
|
|
||||||
if (getsockopt(sock, SOL_SOCKET, SO_PEERCRED, &peercred, &so_len) != 0 ||
|
if (getsockopt(sock, SOL_SOCKET, SO_PEERCRED, &peercred, &so_len) != 0 ||
|
||||||
so_len != sizeof(peercred))
|
so_len != sizeof(peercred))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user