summaryrefslogtreecommitdiffstats
path: root/src/plug-nis.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plug-nis.c')
-rw-r--r--src/plug-nis.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plug-nis.c b/src/plug-nis.c
index e0f1707..1c43a03 100644
--- a/src/plug-nis.c
+++ b/src/plug-nis.c
@@ -224,13 +224,23 @@ plugin_state_init(Slapi_PBlock *pb, struct plugin_state **lstate)
/* Create a socket for use in communicating with the portmapper. */
sockfd = socket(PF_INET, SOCK_DGRAM, 0);
if (sockfd == -1) {
+ slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
+ "error allocating portmap client socket\n");
goto failed;
}
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
if (bindresvport(sockfd, &sin) != 0) {
+ slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
+ "error binding portmap client socket to a "
+ "privileged port\n");
+ if ((getenv(NIS_PLUGIN_CONTINUE_WITHOUT_PORTMAP_ENV) == NULL) ||
+ !atol(getenv(NIS_PLUGIN_CONTINUE_WITHOUT_PORTMAP_ENV))) {
+ close(sockfd);
+ goto failed;
+ }
close(sockfd);
- goto failed;
+ sockfd = -1;
}
state->pmap_client_socket = sockfd;