php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mwm at godaddy dot com
New email:
PHP Version: OS:

 

 [2007-09-04 22:17 UTC] mwm at godaddy dot com
Description:
------------
net-snmp-libs-5.1.2-11.EL4.7
net-snmp-devel-5.1.2-11.EL4.7
net-snmp-utils-5.1.2-11.EL4.7
net-snmp-5.1.2-11.EL4.7

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-04 22:29 UTC] jani@php.net
See bug #34165


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 13:01:29 2025 UTC