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 144862 Details for
Bug 221533
Incorporate some recent improvements to the rpc.gssd debugging.
[?]
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]
2 of 3 upstream patches
nfs-utils-1.0.8-005-printerr_error.dif (text/plain), 2.90 KB, created by
Steve Dickson
on 2007-01-04 22:42:38 UTC
(
hide
)
Description:
2 of 3 upstream patches
Filename:
MIME Type:
Creator:
Steve Dickson
Created:
2007-01-04 22:42:38 UTC
Size:
2.90 KB
patch
obsolete
> >Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> > >Update the printerr() function to: > >1) Determine whether we'll print the message before going to all the > work of formatting it. >2) Don't just toss away messages that are too long for the buffer. > Print what we can and give an indication of the truncation with > "..." at the end. >3) Use a single buffer rather than two. >4) Messages either go to syslog (with level ERR) or stderr. Don't > send some messages to syslog level DEBUG. > > >--- > > nfs-utils-1.0.8-kwc/utils/gssd/err_util.c | 61 +++++++++++++++--------------- > 1 files changed, 31 insertions(+), 30 deletions(-) > >diff -puN utils/gssd/err_util.c~printerr_error utils/gssd/err_util.c >--- nfs-utils-1.0.8/utils/gssd/err_util.c~printerr_error 2006-06-16 16:00:53.209358000 -0400 >+++ nfs-utils-1.0.8-kwc/utils/gssd/err_util.c 2006-06-16 16:00:53.262358000 -0400 >@@ -38,7 +38,6 @@ static int verbosity = 0; > static int fg = 0; > > static char message_buf[500]; >-static char tmp_buf[500]; > > void initerr(char *progname, int set_verbosity, int set_fg) > { >@@ -48,45 +47,47 @@ void initerr(char *progname, int set_ver > openlog(progname, LOG_PID, LOG_DAEMON); > } > >+ > void printerr(int priority, char *format, ...) > { > va_list args; > int ret; >+ int buf_used, buf_available; >+ char *buf; >+ >+ /* Don't bother formatting a message we're never going to print! */ >+ if (priority > verbosity) >+ return; >+ >+ buf_used = strlen(message_buf); >+ /* subtract 4 to leave room for "...\n" if necessary */ >+ buf_available = sizeof(message_buf) - buf_used - 4; >+ buf = message_buf + buf_used; > >- /* aggregate lines: only print buffer when we get to the end of a >- * line or run out of space: */ >+ /* >+ * Aggregate lines: only print buffer when we get to the >+ * end of a line or run out of space >+ */ > va_start(args, format); >- ret = vsnprintf(tmp_buf, sizeof(tmp_buf), format, args); >+ ret = vsnprintf(buf, buf_available, format, args); > va_end(args); >- if ((ret < 0) || (ret >= sizeof(tmp_buf))) >- goto output; >- if (strlen(tmp_buf) + strlen(message_buf) + 1 > sizeof(message_buf)) >- goto output; >- strcat(message_buf, tmp_buf); >- if (tmp_buf[strlen(tmp_buf) - 1] == '\n') >- goto output; >+ >+ if (ret < 0) >+ goto printit; >+ if (ret >= buf_available) { >+ /* Indicate we're truncating */ >+ strcat(message_buf, "...\n"); >+ goto printit; >+ } >+ if (message_buf[strlen(message_buf) - 1] == '\n') >+ goto printit; > return; >-output: >- priority -= verbosity; >- if (priority < 0) >- priority = 0; >+printit: > if (fg) { >- if (priority == 0) >- fprintf(stderr, "%s", message_buf); >+ fprintf(stderr, "%s", message_buf); > } else { >- int sys_pri; >- switch (priority) { >- case 0: >- sys_pri = LOG_ERR; >- break; >- case 1: >- sys_pri = LOG_DEBUG; >- break; >- default: >- goto out; >- } >- syslog(sys_pri, "%s", message_buf); >+ syslog(LOG_ERR, "%s", message_buf); > } >-out: >+ /* reset the buffer */ > memset(message_buf, 0, sizeof(message_buf)); > } > >_
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 221533
:
144861
| 144862 |
144863