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 611408 Details for
Bug 842279
Incomplete command line in UCD-SNMP-MIB::extCommand
[?]
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]
Patch
net-snmp-5.5-exec-cmdline.patch (text/plain), 3.10 KB, created by
Jan Safranek
on 2012-09-10 11:29:14 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jan Safranek
Created:
2012-09-10 11:29:14 UTC
Size:
3.10 KB
patch
obsolete
>commit e8e44b3faecdba5daedfb45d815fae65117d1b22 >Author: Jan Safranek <jsafranek@users.sourceforge.net> >Date: Mon Sep 10 13:25:38 2012 +0200 > > CHANGES: snmpd: fixed value of UCD-SNMP-MIB::extCommand to contain full command line. > > MIB description of UCD-SNMP-MIB::extCommand suggests it should contail full command line. > Also in Net-SNMP 5.3.2.2, whole command line was shown. > >diff --git a/agent/mibgroup/agent/extend.c b/agent/mibgroup/agent/extend.c >index 085d762..0b2c660 100644 >--- a/agent/mibgroup/agent/extend.c >+++ b/agent/mibgroup/agent/extend.c >@@ -44,6 +44,9 @@ unsigned int num_compatability_entries = 0; > unsigned int max_compatability_entries = 50; > netsnmp_old_extend *compatability_entries; > >+char *cmdlinebuf; >+size_t cmdlinesize; >+ > WriteMethod fixExec2Error; > FindVarMethod var_extensible_old; > oid old_extensible_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_SHELLMIBNUM, 1 }; >@@ -1354,6 +1357,23 @@ handle_nsExtendOutput2Table(netsnmp_mib_handler *handler, > * > *************************/ > >+char * _get_cmdline(netsnmp_extend *extend) >+{ >+ size_t size; >+ >+ size = strlen(extend->command) + strlen(extend->args) + 2; >+ if (size > cmdlinesize) { >+ cmdlinebuf = realloc(cmdlinebuf, size); >+ if (!cmdlinebuf) { >+ cmdlinesize = 0; >+ return NULL; >+ } >+ cmdlinesize = size; >+ } >+ sprintf(cmdlinebuf, "%s %s", extend->command, extend->args); >+ return cmdlinebuf; >+} >+ > u_char * > var_extensible_old(struct variable * vp, > oid * name, >@@ -1364,6 +1384,7 @@ var_extensible_old(struct variable * vp, > netsnmp_old_extend *exten = NULL; > static long long_ret; > int idx; >+ char *cmdline; > > if (header_simple_table > (vp, name, length, exact, var_len, write_method, num_compatability_entries)) >@@ -1382,8 +1403,10 @@ var_extensible_old(struct variable * vp, > *var_len = strlen(exten->exec_entry->token); > return ((u_char *) (exten->exec_entry->token)); > case SHELLCOMMAND: >- *var_len = strlen(exten->exec_entry->command); >- return ((u_char *) (exten->exec_entry->command)); >+ cmdline = _get_cmdline(exten->exec_entry); >+ if (cmdline) >+ *var_len = strlen(cmdline); >+ return ((u_char *) cmdline); > case ERRORFLAG: /* return code from the process */ > netsnmp_cache_check_and_reload( exten->exec_entry->cache ); > long_ret = exten->exec_entry->result; >@@ -1406,8 +1429,10 @@ var_extensible_old(struct variable * vp, > > case ERRORFIXCMD: > if (exten->efix_entry) { >- *var_len = strlen(exten->efix_entry->command); >- return ((u_char *) exten->efix_entry->command); >+ cmdline = _get_cmdline(exten->efix_entry); >+ if (cmdline) >+ *var_len = strlen(cmdline); >+ return ((u_char *) cmdline); > } else { > *var_len = 0; > return ((u_char *) &long_return); /* Just needs to be non-null! */
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 842279
: 611408