Make kadmind safe to run on multi-homed machines.

Reviewed by: Garrett A. Wollman (wollman@FreeBSD.org)
This commit is contained in:
Justin T. Gibbs 1995-08-02 18:31:08 +00:00
parent 94a8606f1b
commit e0deda6676
6 changed files with 33 additions and 6 deletions

View File

@ -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()) {

View File

@ -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,

View File

@ -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()) {

View File

@ -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,

View File

@ -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()) {

View File

@ -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,