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 314759 Details for
Bug 454581
ypbind rewrites unchanged binding files every 60s
[?]
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.
[patch]
Proposed patch
smartwrite (text/plain), 3.97 KB, created by
Eric Sandeen
on 2008-08-21 22:33:32 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Eric Sandeen
Created:
2008-08-21 22:33:32 UTC
Size:
3.97 KB
patch
obsolete
>Index: ypbind-mt-1.20.4/src/serv_list.c >=================================================================== >--- ypbind-mt-1.20.4.orig/src/serv_list.c 2008-08-21 17:09:30.000000000 -0500 >+++ ypbind-mt-1.20.4/src/serv_list.c 2008-08-21 17:31:30.162166089 -0500 >@@ -81,6 +81,7 @@ struct binding > struct bound_server server[_MAXSERVER]; > struct bound_server ypset; > CLIENT *client_handle; >+ struct bound_server last; /* last written */ > }; > static inline char * > bound_host(struct binding *bptr) >@@ -130,29 +131,38 @@ update_bindingfile (struct binding *entr > char path1[MAXPATHLEN + 1], path2[MAXPATHLEN + 1]; > int fd, len; > >- sprintf (path1, "%s/%s.1", BINDINGDIR, entry->domain); >- sprintf (path2, "%s/%s.2", BINDINGDIR, entry->domain); >- >- iov[0].iov_base = (caddr_t) &sport; >- iov[0].iov_len = sizeof (sport); >- iov[1].iov_base = (caddr_t) &ybres; >- iov[1].iov_len = sizeof ybres; >- > memset(&ybres, 0, sizeof (ybres)); > ybres.ypbind_status = YPBIND_SUCC_VAL; >+ > if (entry->active >= 0) > { >+ if (entry->last.host && >+ !memcmp(&entry->server[entry->active].addr, &entry->last.addr, sizeof(struct in_addr)) && >+ entry->server[entry->active].port == entry->last.port) >+ { >+ log_msg (LOG_DEBUG, "Entry for %s unchanged, skipping writeout", entry->domain); >+ return; >+ } > memcpy (&ybres.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr, > &entry->server[entry->active].addr, sizeof (struct in_addr)); > memcpy (&ybres.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port, > &entry->server[entry->active].port, sizeof (unsigned short int)); >+ entry->last= entry->server[entry->active]; > } > else if (entry->active == -2) /* ypset was used */ > { >+ if (entry->last.host && >+ !memcmp(&entry->server[entry->active].addr, &entry->last.addr, sizeof(struct in_addr)) && >+ entry->ypset.port == entry->last.port) >+ { >+ log_msg (LOG_DEBUG, "Entry for %s unchanged, skipping writeout", entry->domain); >+ return; >+ } > memcpy (&ybres.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr, > &entry->ypset.addr, sizeof (struct in_addr)); > memcpy (&ybres.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port, > &entry->ypset.port, sizeof (unsigned short int)); >+ entry->last= entry->ypset; > } > else > { >@@ -160,10 +170,19 @@ update_bindingfile (struct binding *entr > libc will query ypbind direct. */ > unlink (path1); > unlink (path2); >+ entry->last.host = NULL; > log_msg (LOG_ERR, "INTERNAL ERROR: update_bindingfile called without valid data!"); > return; > } > >+ sprintf (path1, "%s/%s.1", BINDINGDIR, entry->domain); >+ sprintf (path2, "%s/%s.2", BINDINGDIR, entry->domain); >+ >+ iov[0].iov_base = (caddr_t) &sport; >+ iov[0].iov_len = sizeof (sport); >+ iov[1].iov_base = (caddr_t) &ybres; >+ iov[1].iov_len = sizeof ybres; >+ > len = iov[0].iov_len + iov[1].iov_len; > > if ((fd = open(path1, O_CREAT | O_RDWR | O_TRUNC, FILE_MODE )) != -1) >@@ -171,6 +190,7 @@ update_bindingfile (struct binding *entr > if (writev (fd, iov, 2) != len ) > { > log_msg (LOG_ERR, "writev (%s): %s", path1, strerror (errno)); >+ entry->last.host = NULL; > unlink (path1); > } > close (fd); >@@ -183,6 +203,7 @@ update_bindingfile (struct binding *entr > if (writev (fd, iov, 2) != len ) > { > log_msg (LOG_ERR, "writev (%s): %s", path2, strerror (errno)); >+ entry->last.host = NULL; > unlink (path2); > } > close (fd); >@@ -403,6 +424,7 @@ get_entry (const char *domain, struct bi > domainlist[max_domains - 1].ypset.host = NULL; > domainlist[max_domains - 1].active = (-1); > domainlist[max_domains - 1].use_broadcast = FALSE; >+ domainlist[max_domains - 1].last.host = NULL; > memset (domainlist[max_domains - 1].server, 0, > (_MAXSERVER * sizeof (struct bound_server))); > *entry = &domainlist[max_domains - 1];
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 454581
:
314759
|
320097