diff options
author | Ken Raeburn <raeburn@mit.edu> | 2008-06-19 18:29:45 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2008-06-19 18:29:45 +0000 |
commit | b373cb972a855b6faef4811d02b55dc63cfff7b6 (patch) | |
tree | e2f32cd2d5d0e39bedd7b3905b7f6a10c6bc33da | |
parent | 5f272c3775a8583e4aa3372bca6226f5b31271ce (diff) | |
download | krb5-b373cb972a855b6faef4811d02b55dc63cfff7b6.zip krb5-b373cb972a855b6faef4811d02b55dc63cfff7b6.tar.gz krb5-b373cb972a855b6faef4811d02b55dc63cfff7b6.tar.bz2 |
Use iprop port number from config file
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/sun-iprop@20421 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/lib/kadm5/clnt/client_init.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/lib/kadm5/clnt/client_init.c b/src/lib/kadm5/clnt/client_init.c index bd76282..d5131cf 100644 --- a/src/lib/kadm5/clnt/client_init.c +++ b/src/lib/kadm5/clnt/client_init.c @@ -300,14 +300,6 @@ static kadm5_ret_t _kadm5_init_any(char *client_name, goto cleanup; } - memset(&addr, 0, sizeof(addr)); - addr.sin_family = hp->h_addrtype; - (void) memcpy((char *) &addr.sin_addr, (char *) hp->h_addr, - sizeof(addr.sin_addr)); - addr.sin_port = htons((u_short) handle->params.kadmind_port); - - fd = RPC_ANYSOCK; - /* * If the service_name and client_name are iprop-centric, * we need to clnttcp_create to the appropriate RPC prog. @@ -318,8 +310,23 @@ static kadm5_ret_t _kadm5_init_any(char *client_name, if (service_name != NULL && (strstr(service_name, iprop_svc) != NULL) && - (strstr(client_name, iprop_svc) != NULL)) { + (strstr(client_name, iprop_svc) != NULL)) iprop_enable = 1; + else + iprop_enable = 0; + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = hp->h_addrtype; + (void) memcpy((char *) &addr.sin_addr, (char *) hp->h_addr, + sizeof(addr.sin_addr)); + if (iprop_enable) + addr.sin_port = htons((u_short) handle->params.iprop_port); + else + addr.sin_port = htons((u_short) handle->params.kadmind_port); + + fd = RPC_ANYSOCK; + + if (iprop_enable) { handle->clnt = clnttcp_create(&addr, KRB5_IPROP_PROG, KRB5_IPROP_VERS, &fd, 0, 0); } else |