|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42553 adding snmp support requires root access to /var/net-snmp/snmpapp.conf
Submitted: 2007-09-04 22:17 UTC Modified: 2007-09-04 22:29 UTC
From: mwm at godaddy dot com Assigned:
Status: Not a bug Package: SNMP related
PHP Version: 5.2.4 OS: Redhat Enterprise Linux ES 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mwm at godaddy dot com
New email:
PHP Version: OS:


 [2007-09-04 22:17 UTC] mwm at godaddy dot com

When 5.2.4 is compiled --with-snmp (also with and without --enable-ucd-snmp-hack) permission is required to read /var/net-snmp/snmpapp.conf.  This by default is owned by root with permissions so that only root can read the files.

$ ls -la /var/net-snmp/ /var/net-snmp/snmpapp.conf
-rw-------  1 root root  675 Sep  4 12:47 /var/net-snmp/snmpapp.conf

ls: /var/net-snmp/: Permission denied

I'd rather not open up public permissions to the conf file or directory, and I certainly do not want to run this under an apache virtualhost as root. I running under Apache 2.2 as a CGI with operating system Red Hat Enterprise Linux ES release 4 update 4.

The highest version of net-snmp provided by Redhat for RHEL4 is 5.1.

This appears in nature similar to Bug #32613, however that bug was closed.

Reproduce code:
php -v as a non-root user, or a user that does not have permission to read/write to the default net-snmp path.

$ php -v
PHP 5.2.4 (cli) (built: Sep  4 2007 12:46:28)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
No log handling enabled - turning on stderr logging
Cannot rename /var/net-snmp/snmpapp.conf to /var/net-snmp/snmpapp.0.conf
Cannot unlink /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf

Expected result:
I expected not to see a permission issue (read_config_store open failure) in attempting to write to the persistent file.

Actual result:
Actual result is:
read_config_store open failure on /var/net-snmp/snmpapp.conf


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-04 22:29 UTC]
See bug #34165

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jun 06 09:01:23 2020 UTC