|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.113 2003/11/29 19:51:49 pgsql Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.114 2003/12/20 18:24:52 tgl Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
@@ -471,32 +471,31 @@ ClientAuthentication(Port *port) |
471 | 471 | break; |
472 | 472 |
|
473 | 473 | caseuaIdent: |
474 | | -#if defined(HAVE_STRUCT_CMSGCRED)|| defined(HAVE_STRUCT_FCRED)|| \ |
475 | | -(defined(HAVE_STRUCT_SOCKCRED)&& defined(LOCAL_CREDS))&& \ |
476 | | -!defined(HAVE_GETPEEREID)&& !defined(SO_PEERCRED) |
477 | | - |
478 | 474 | /* |
479 | 475 | * If we are doing ident on unix-domain sockets, use SCM_CREDS |
480 | 476 | * only if it is defined and SO_PEERCRED isn't. |
481 | 477 | */ |
482 | | -#if defined(HAVE_STRUCT_FCRED)|| defined(HAVE_STRUCT_SOCKCRED) |
483 | | - |
484 | | -/* |
485 | | - * Receive credentials on next message receipt, BSD/OS, |
486 | | - * NetBSD. We need to set this before the client sends the |
487 | | - * next packet. |
488 | | - */ |
| 478 | +#if !defined(HAVE_GETPEEREID)&& !defined(SO_PEERCRED)&& \ |
| 479 | +(defined(HAVE_STRUCT_CMSGCRED)|| defined(HAVE_STRUCT_FCRED)|| \ |
| 480 | + (defined(HAVE_STRUCT_SOCKCRED)&& defined(LOCAL_CREDS))) |
| 481 | +if (port->raddr.addr.ss_family==AF_UNIX) |
489 | 482 | { |
| 483 | +#if defined(HAVE_STRUCT_FCRED)|| defined(HAVE_STRUCT_SOCKCRED) |
| 484 | +/* |
| 485 | + * Receive credentials on next message receipt, BSD/OS, |
| 486 | + * NetBSD. We need to set this before the client sends the |
| 487 | + * next packet. |
| 488 | + */ |
490 | 489 | inton=1; |
491 | 490 |
|
492 | 491 | if (setsockopt(port->sock,0,LOCAL_CREDS,&on,sizeof(on))<0) |
493 | 492 | ereport(FATAL, |
494 | 493 | (errcode_for_socket_access(), |
495 | 494 | errmsg("could not enable credential reception: %m"))); |
496 | | -} |
497 | 495 | #endif |
498 | | -if (port->raddr.addr.ss_family==AF_UNIX) |
| 496 | + |
499 | 497 | sendAuthRequest(port,AUTH_REQ_SCM_CREDS); |
| 498 | +} |
500 | 499 | #endif |
501 | 500 | status=authident(port); |
502 | 501 | break; |
|