--- ChangeLog +++ ChangeLog 2001/12/03 10:42:07 @@ -1,3 +1,8 @@ +2001-12-03 Thorsten Kukuk + + * ypxfr/ypxfr.c (ypxfr): Don't replace name of master with + FQHN, else ypserv cannot compare it later. + 2001-11-26 Thorsten Kukuk * release version 2.2 --- ypxfr/ypxfr.c +++ ypxfr/ypxfr.c 2001/12/03 10:35:35 @@ -326,6 +326,9 @@ extern struct ypall_callback *xdr_ypall_callback; +/* Don't replace the source_host with the FQHN in this function. Or ypserv + cannot compare the name of the host, who initiated a yppush, with the + master name of the map. */ static enum ypxfrstat ypxfr (char *map, char *source_host, char *source_domain, char *target_domain, int noclear, int force) @@ -374,6 +377,8 @@ h = gethostbyname (source_host); if (!h) return YPXFR_RSRC; + master_host = alloca (strlen (source_host) + 1); + strcpy (master_host, source_host); } else { @@ -383,14 +388,15 @@ if (yp_master (source_domain, map, &master_name)) return YPXFR_MADDR; - h = gethostbyname (master_name); + master_host = alloca (strlen (master_name) + 1); + strcpy (master_host, master_name); + free (master_name); + h = gethostbyname (master_host); if (!h) return YPXFR_RSRC; } memcpy (&sockaddr.sin_addr, h->h_addr, sizeof sockaddr.sin_addr); memcpy (&sockaddr_udp, &sockaddr, sizeof (sockaddr)); - master_host = alloca (strlen (h->h_name) + 1); - strcpy (master_host, h->h_name); /* Create a udp socket to the server */ sock = RPC_ANYSOCK;