diff options
author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-07-08 14:32:34 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-07-08 14:32:34 -0400 |
commit | 9fe18a0d9f5ed00295b5601b22bf2143b8012f5b (patch) | |
tree | 9c9acab10a319aa70a82f87ecae5c5833dbe3950 /src/plug-nis.c | |
parent | 899ab1307290b15a33a1ad8d1513fe395c1f617c (diff) | |
download | slapi-nis-9fe18a0d9f5ed00295b5601b22bf2143b8012f5b.tar.gz slapi-nis-9fe18a0d9f5ed00295b5601b22bf2143b8012f5b.tar.xz slapi-nis-9fe18a0d9f5ed00295b5601b22bf2143b8012f5b.zip |
- add framework for adding a test suite
- provide a way to get the nis plugin to run more or less unprivileged
Diffstat (limited to 'src/plug-nis.c')
-rw-r--r-- | src/plug-nis.c | 12 |
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; |