diff options
| author | Hartmut Brandt <harti@FreeBSD.org> | 2004-08-12 19:17:29 +0000 |
|---|---|---|
| committer | Hartmut Brandt <harti@FreeBSD.org> | 2004-08-12 19:17:29 +0000 |
| commit | e0fd476003e0c7c14a7c484bc9509903c9552778 (patch) | |
| tree | 4a11cc7d9accd683a9a4d6eab0ba55b38daa2d12 | |
| parent | 0a9d66ca0dd8e679168dfb4e36aaac1107b443f3 (diff) | |
Vendor patch: don't dump core when the config file cannot be opened.
Submitted by: Maxim Konovalov <maxim@macomnet.ru>
Notes
svn path=/vendor/bsnmp/dist/; revision=133594
| -rw-r--r-- | contrib/bsnmp/snmpd/config.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/bsnmp/snmpd/config.c b/contrib/bsnmp/snmpd/config.c index 2a690479255b..f6f5c35a13fc 100644 --- a/contrib/bsnmp/snmpd/config.c +++ b/contrib/bsnmp/snmpd/config.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Begemot: bsnmp/snmpd/config.c,v 1.21 2004/08/06 08:47:10 brandt Exp $ + * $Begemot: bsnmp/snmpd/config.c,v 1.22 2004/08/12 17:09:49 brandt Exp $ * * Parse configuration file. */ @@ -1290,13 +1290,18 @@ read_config(const char *fname, struct lmodule *lodmod) ignore = 0; input_push = 0; + + if (ERRPUSH()) + return (-1); if (input_open_file(fname, 0) == -1) { syslog(LOG_ERR, "%s: %m", fname); return (-1); } + ERRPOP(); community = COMM_INITIALIZE; if ((snmp_ctx = snmp_init_context()) == NULL) { + input_close_all(); syslog(LOG_ERR, "%m"); return (-1); } |
