From: mwm at godaddy dot com
Operating system: Redhat Enterprise Linux ES 4
PHP version: 5.2.4
PHP Bug Type: SNMP related
Bug description: adding snmp support requires root access to
/var/net-snmp/snmpapp.conf
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
--
Edit bug report at http://bugs.php.net/?id=42553&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=42553&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=42553&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=42553&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42553&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=42553&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42553&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42553&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42553&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42553&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42553&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=42553&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=42553&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42553&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42553&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42553&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42553&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42553&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42553&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42553&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42553&r=mysqlcfg