Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 185031 Details for
Bug 169815
ypbind needs to report when it has lost all bindings
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
ypbind_log_msg.patch
ypbind_log_msg.patch (text/plain), 7.00 KB, created by
IBM Bug Proxy
on 2007-09-03 06:00:45 UTC
(
hide
)
Description:
ypbind_log_msg.patch
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2007-09-03 06:00:45 UTC
Size:
7.00 KB
patch
obsolete
>diff --git a/src/serv_list.c b/src/serv_list.c >index bdaaeac..49ad169 100644 >--- a/src/serv_list.c >+++ b/src/serv_list.c >@@ -514,11 +514,10 @@ eachresult (bool_t *out, struct sockaddr > { > struct timeval timeout; > int sock; >+ int active; > > if (*out) > { >- if(debug_flag) >- { > #if defined (HAVE___NSS_CONFIGURE_LOOKUP) > struct hostent hostbuf, *host; > size_t hstbuflen; >@@ -555,6 +554,7 @@ #else > sizeof(addr->sin_addr.s_addr), AF_INET); > #endif > #endif /* HAVE___NSS_CONFIGURE_LOOKUP */ >+ if (debug_flag) { > if (host != NULL) > log_msg (LOG_DEBUG, _("Answer for domain '%s' from server '%s'"), > in_use->domain, host->h_name); >@@ -562,7 +562,7 @@ #endif /* HAVE___NSS_CONFIGURE_LOOKUP */ > log_msg (LOG_DEBUG, > _("Answer for domain '%s' from unknown server '%s'"), > in_use->domain, inet_ntoa (addr->sin_addr)); >- } >+ } > > if (!broken_server && (ntohs(addr->sin_port) >= IPPORT_RESERVED)) > { >@@ -571,10 +571,31 @@ #endif /* HAVE___NSS_CONFIGURE_LOOKUP */ > return 0; > } > >- memcpy(&(in_use->server[0].addr), &addr->sin_addr, >- sizeof (struct in_addr)); >- memcpy(&(in_use->server[0].port), &addr->sin_port, >- sizeof (unsigned short int)); >+ /* Find an empty slot or an entry that matches the server */ >+ for (active = 0; active < _MAXSERVER; ++active) { >+ if (in_use->server[active].host == NULL) >+ break; >+ if (in_use->server[active].addr.s_addr == addr->sin_addr.s_addr) >+ break; >+ } >+ >+ if (active == _MAXSERVER) { >+ log_msg(LOG_ERR, "eachresult: exceeded the _MAXSERVER limit\n"); >+ return 0; >+ } >+ >+ /* Add the server to the list only if it is a new one */ >+ if (in_use->server[active].host == NULL) { >+ in_use->server[active].host = strdup(host->h_name); >+ in_use->server[active].addr.s_addr = addr->sin_addr.s_addr; >+ in_use->server[active].port = addr->sin_port; >+ in_use->server[active].family = host->h_addrtype; >+ log_msg(LOG_DEBUG, >+ "Adding hostname:%s, addr:%s, port:%d active_idx:%d\n", >+ in_use->server[active].host, >+ inet_ntoa(in_use->server[active].addr), >+ in_use->server[active].port, active); >+ } > > sock = RPC_ANYSOCK; > timeout.tv_sec = 1; >@@ -586,7 +607,7 @@ #endif /* HAVE___NSS_CONFIGURE_LOOKUP */ > return 0; > > pthread_rdwr_wlock_np (&domainlock); >- in_use->active = 0; >+ in_use->active = active; > found_one++; > pthread_rdwr_wunlock_np (&domainlock); > >@@ -623,7 +644,8 @@ do_broadcast (struct binding *list) > pthread_rdwr_wunlock_np (&domainlock); > > remove_bindingfile(list->domain); >- log_msg (LOG_ERR, "broadcast: %s.", clnt_sperrno(status)); >+ log_msg (LOG_ERR, "No response for domain '%s' from any NIS server", >+ domain); > } > else > { >@@ -729,7 +751,7 @@ ping_all (struct binding *list) > CLIENT *clnt; > struct findserv_req **pings; > struct sockaddr_in s_in, *any = NULL; >- int found = -1; >+ int found = 0; > u_int32_t xid_seed, xid_lookup; > int sock, dontblock = 1; > bool_t clnt_res; >@@ -748,8 +770,8 @@ ping_all (struct binding *list) > for (i = 0; i < _MAXSERVER && list->server[i].host; ++i) > { > if (debug_flag) >- log_msg (LOG_DEBUG, _("ping host '%s', domain '%s'"), >- list->server[i].host, list->domain); >+ log_msg (LOG_DEBUG, _("ping host '%s', addr:%s, domain '%s'"), >+ list->server[i].host, inet_ntoa(list->server[i].addr), list->domain); > > memset (&s_in, 0, sizeof (struct sockaddr_in)); > memcpy (&s_in.sin_addr, &(list->server[i].addr), >@@ -760,9 +782,16 @@ ping_all (struct binding *list) > list->server[i].port = s_in.sin_port; > if (s_in.sin_port == 0) > { >- if (debug_flag) >- log_msg (LOG_DEBUG, _("host '%s' doesn't answer."), >- list->server[i].host); >+ if (list->active == i) >+ log_msg (LOG_WARNING, >+ _("NIS server '%s' not responding for domain %s."), >+ list->server[i].host, list->domain); >+ else { >+ if (debug_flag) >+ log_msg (LOG_DEBUG, >+ _("NIS server '%s' not responding for domain %s."), >+ list->server[i].host, list->domain); >+ } > continue; > } > >@@ -777,13 +806,7 @@ ping_all (struct binding *list) > > /* Make sure at least one server was assigned */ > if (pings_count == 0) >- { >- free (pings); >- pthread_rdwr_wlock_np (&domainlock); >- list->active = -1; >- pthread_rdwr_wunlock_np (&domainlock); >- return 0; >- } >+ goto done; > > /* Create RPC handle */ > sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); >@@ -791,13 +814,7 @@ ping_all (struct binding *list) > if (clnt == NULL) > { > close (sock); >- for (i = 0; i < pings_count; ++i) >- free (pings[i]); >- free (pings); >- pthread_rdwr_wlock_np (&domainlock); >- list->active = -1; >- pthread_rdwr_wunlock_np (&domainlock); >- return 0; >+ goto done; > } > clnt->cl_auth = authunix_create_default (); > cu = (struct cu_data *) clnt->cl_private; >@@ -851,15 +868,19 @@ ping_all (struct binding *list) > auth_destroy (clnt->cl_auth); > clnt_destroy (clnt); > >+done: > for (i = 0; i < pings_count; ++i) > free (pings[i]); > free (pings); > > if (!found) { >- pthread_rdwr_wlock_np (&domainlock); >- list->active = -1; >- pthread_rdwr_wunlock_np (&domainlock); >+ pthread_rdwr_wlock_np (&domainlock); >+ list->active = -1; >+ pthread_rdwr_wunlock_np (&domainlock); > remove_bindingfile(list->domain); >+ if (!(list->use_broadcast)) >+ log_msg(LOG_ERR, "No response for domain '%s' from any NIS server", >+ domain); > } > return found; > } >@@ -902,10 +923,16 @@ ping_all (struct binding *list) > > if (clnt_handlep == NULL) > { >- if (debug_flag) >- log_msg (LOG_DEBUG, >- _("clnt_create for server '%s' (domain '%s') failed"), >- list->server[i].host, domain); >+ if (list->active == i) >+ log_msg (LOG_WARNING, >+ _("NIS server '%s' not responding for domain %s."), >+ list->server[i].host, list->domain); >+ else { >+ if (debug_flag) >+ log_msg (LOG_DEBUG, >+ _("NIS server '%s' not responding for domain %s."), >+ list->server[i].host, list->domain); >+ } > ++i; > continue; > } >@@ -947,17 +974,15 @@ ping_all (struct binding *list) > > ++i; > if (i == _MAXSERVER) >- { >- pthread_rdwr_wlock_np (&domainlock); >- list->active = -1; >- pthread_rdwr_wunlock_np (&domainlock); >- remove_bindingfile(list->domain); >- return 0; >- } >+ goto done; > } >+done: > pthread_rdwr_wlock_np (&domainlock); > list->active = -1; > pthread_rdwr_wunlock_np (&domainlock); >+ remove_bindingfile(list->domain); >+ if (!(list->use_broadcast)) >+ log_msg(LOG_ERR, "No response for domain '%s' from any NIS server", domain); > return 0; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 169815
:
129280
|
129463
|
129885
| 185031