Bug#683138: [Pkg-nagios-devel] Bug#683138: pnp4nagios-web: crashes immediately due to debian/patches/adjust-template-path

2012-08-01 Thread Sebastian Harl
tags 683138 + moreinfo
thanks

Hi,

On Sun, Jul 29, 2012 at 04:48:16AM +0200, Christoph Anton Mitterer wrote:
 The support for /etc/pnp4nagios/templates.d seems to be buggy:
 When /etc/pnp4nagios/templates.d is empty (in the sense of no subdirs),
 all I get from pnp4nagios is:
 Please check the documentation for information about the following error.
 
 Invalid argument supplied for foreach()
 file [line]:
 
 /etc/pnp4nagios/config.php [234]:
 
 Guess the reason is that the glob(/etc/pnp4nagios/templates.d/*, 
 GLOB_ONLYDIR)
 returns nothing and then one has a syntax error?!

I cannot reproduce this behavior. Which version of PHP do you use? What
architecture are you on? I've tested on amd64 Sid … any other ideas how
your system might be different from mine?

Cheers,
Sebastian

-- 
Sebastian tokkee Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin



signature.asc
Description: Digital signature


Bug#683138: [Pkg-nagios-devel] Bug#683138: pnp4nagios-web: crashes immediately due to debian/patches/adjust-template-path

2012-08-01 Thread Christoph Anton Mitterer

Am 01.08.2012 13:50, schrieb Sebastian Harl:

I cannot reproduce this behavior.

Hmm... and you had a clean fresh installation?



Which version of PHP do you use?

5.4.4-2



What
architecture are you on?

amd64



I've tested on amd64 Sid … any other ideas how
your system might be different from mine?
Well the base system is stable, but anything pnp4nagios depends on 
(especially PHP) is from testing.


I run PHP as CGI have some limitations in place, well actually just 
open_basedir ... as suhosin is non-functiona ATM.
But the open_basedir includes /etc/pnp4nagios so that shouldn't be 
aproblem.



So I did some debugging:
If the dir has no subdirs:
php -r 'var_dump(glob(/etc/pnp4nagios/templates.d/*, GLOB_ONLYDIR));'
PHP Warning:  PHP Startup: Unable to load dynamic library 
'/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: 
cannot open shared object file: No such file or directory in Unknown on 
line 0

bool(false)


If it has:
php -r 'var_dump(glob(/etc/pnp4nagios/templates.d/*, GLOB_ONLYDIR));'
PHP Warning:  PHP Startup: Unable to load dynamic library 
'/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: 
cannot open shared object file: No such file or directory in Unknown on 
line 0

array(3) {
  [0]=
  string(29) /etc/pnp4nagios/templates.d/a
  [1]=
  string(29) /etc/pnp4nagios/templates.d/b
  [2]=
  string(29) /etc/pnp4nagios/templates.d/c
}


You can ignore the Suhosin missing warning.

So I guess the problem is that my PHP doesn't return an empty array but 
false, which is also documented to be the case on some systems:

http://php.net/manual/en/function.glob.php

Cheers,
Chris.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org