bkv1409 / owasp-esapi-php

Automatically exported from code.google.com/p/owasp-esapi-php
0 stars 0 forks source link

ExecutorTest testcases fail due to symlinked executable to test (not in canonical form) #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Following testcases fail in my specific environment:
ExecutorTest::testExecuteUnixLegalSystemCommand()
ExecutorTest::testExecuteUnixGoodWorkDirectory()
ExecutorTest::testExecuteUnixChainedParameter()

This is caused by executable to test ('/bin/sh') that here is a symlink to 
'bin/bash'. Therefore in DefaultExecutor::executeSystemCommandLonghand() 
comparison [if (strcmp($resolved, realpath($resolved)) != 0)] is evaluated to 
TRUE and an ExecutorException is thrown.

Having /bin/sh symlinked is a behavior to expect.

And as unit tests are supposed to test correctness/completeness of program code 
and *not* environment specifics, ExecutorTest should be fixed in regards to 
symlink awareness.

Original issue reported on code.google.com by marcus.k...@googlemail.com on 20 Sep 2010 at 9:55

GoogleCodeExporter commented 9 years ago

Original comment by marcus.k...@googlemail.com on 20 Sep 2010 at 9:56

GoogleCodeExporter commented 9 years ago
I consider a "getResolvedSymlink($path)" function in file 
test/testresources/TestHelpers.php that in case of non-WIN OS will test for a 
symlink and resolve it. For any other cases is returned unmodified.

see attached patch!

Original comment by marcus.k...@googlemail.com on 20 Sep 2010 at 11:19

Attachments:

GoogleCodeExporter commented 9 years ago
All these issues must be dealt with before 1.0. New issues will be on a case by 
case basis as to whether we hold up 1.0 or not. 

Original comment by vande...@gmail.com on 17 Jun 2011 at 3:36