diff options
author | gibbs <gibbs@FreeBSD.org> | 1995-08-02 18:31:08 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1995-08-02 18:31:08 +0000 |
commit | 81842686f9c03ebc24d9b37e6db8f14197f9554e (patch) | |
tree | c609a18a5e8bf0c849b9753e153e592e163e9f0b /eBones/usr.sbin | |
parent | 2025cfa67f37a6a4ec6c895380fddda501d5b899 (diff) | |
download | FreeBSD-src-81842686f9c03ebc24d9b37e6db8f14197f9554e.zip FreeBSD-src-81842686f9c03ebc24d9b37e6db8f14197f9554e.tar.gz |
Make kadmind safe to run on multi-homed machines.
Reviewed by: Garrett A. Wollman (wollman@FreeBSD.org)
Diffstat (limited to 'eBones/usr.sbin')
-rw-r--r-- | eBones/usr.sbin/kadmin/admin_server.c | 10 | ||||
-rw-r--r-- | eBones/usr.sbin/kadmin/kadm_ser_wrap.c | 3 | ||||
-rw-r--r-- | eBones/usr.sbin/kadmind/admin_server.c | 10 | ||||
-rw-r--r-- | eBones/usr.sbin/kadmind/kadm_ser_wrap.c | 3 |
4 files changed, 22 insertions, 4 deletions
diff --git a/eBones/usr.sbin/kadmin/admin_server.c b/eBones/usr.sbin/kadmin/admin_server.c index 7f04ff2..ce36eb6 100644 --- a/eBones/usr.sbin/kadmin/admin_server.c +++ b/eBones/usr.sbin/kadmin/admin_server.c @@ -226,6 +226,16 @@ kadm_listen() log("accept: %s",error_message(errno)); continue; } + addrlen = sizeof(server_parm.admin_addr); + if (getsockname(peer_fd, (struct sockaddr *)&server_parm.admin_addr, + &addrlen)) { + log("getsockname: %s",error_message(errno)); + continue; + } +#ifdef DEBUG + printf("Connection recieved on %s\n", + inet_ntoa(server_parm.admin_addr.sin_addr)); +#endif /* DEBUG */ #ifndef DEBUG /* if you want a sep daemon for each server */ if (pid = fork()) { diff --git a/eBones/usr.sbin/kadmin/kadm_ser_wrap.c b/eBones/usr.sbin/kadmin/kadm_ser_wrap.c index 79196c6..23664d4 100644 --- a/eBones/usr.sbin/kadmin/kadm_ser_wrap.c +++ b/eBones/usr.sbin/kadmin/kadm_ser_wrap.c @@ -57,8 +57,7 @@ char realm[]; server_parm.admin_addr.sin_family = AF_INET; if ((hp = gethostbyname(hostname)) == NULL) return KADM_NO_HOSTNAME; - bcopy(hp->h_addr, (char *) &server_parm.admin_addr.sin_addr.s_addr, - hp->h_length); + server_parm.admin_addr.sin_addr.s_addr = INADDR_ANY; server_parm.admin_addr.sin_port = sep->s_port; /* setting up the database */ if (kdb_get_master_key((inter==1),server_parm.master_key, diff --git a/eBones/usr.sbin/kadmind/admin_server.c b/eBones/usr.sbin/kadmind/admin_server.c index 7f04ff2..ce36eb6 100644 --- a/eBones/usr.sbin/kadmind/admin_server.c +++ b/eBones/usr.sbin/kadmind/admin_server.c @@ -226,6 +226,16 @@ kadm_listen() log("accept: %s",error_message(errno)); continue; } + addrlen = sizeof(server_parm.admin_addr); + if (getsockname(peer_fd, (struct sockaddr *)&server_parm.admin_addr, + &addrlen)) { + log("getsockname: %s",error_message(errno)); + continue; + } +#ifdef DEBUG + printf("Connection recieved on %s\n", + inet_ntoa(server_parm.admin_addr.sin_addr)); +#endif /* DEBUG */ #ifndef DEBUG /* if you want a sep daemon for each server */ if (pid = fork()) { diff --git a/eBones/usr.sbin/kadmind/kadm_ser_wrap.c b/eBones/usr.sbin/kadmind/kadm_ser_wrap.c index 79196c6..23664d4 100644 --- a/eBones/usr.sbin/kadmind/kadm_ser_wrap.c +++ b/eBones/usr.sbin/kadmind/kadm_ser_wrap.c @@ -57,8 +57,7 @@ char realm[]; server_parm.admin_addr.sin_family = AF_INET; if ((hp = gethostbyname(hostname)) == NULL) return KADM_NO_HOSTNAME; - bcopy(hp->h_addr, (char *) &server_parm.admin_addr.sin_addr.s_addr, - hp->h_length); + server_parm.admin_addr.sin_addr.s_addr = INADDR_ANY; server_parm.admin_addr.sin_port = sep->s_port; /* setting up the database */ if (kdb_get_master_key((inter==1),server_parm.master_key, |