PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.comp.lang.php > PHP 4 security File Access Issue on AIX
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
PHP 4 security File Access Issue on AIX

Réponse
 
LinkBack Outils de la discussion
Vieux 22/06/2007, 09h27   #1
Alex Lirus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut PHP 4 security File Access Issue on AIX

Hi.
We are facing a problem with an old PHP application.

The application browse the local server directory in order to show to
the
client browser file info and data.

When we remove all the grants from "others", from any of the
directoryes or the
tree involved, or the files themself, the progam pop up with the
error:

------
Warning: opendir(/appl/apt000/pt0/include/p/): failed to open dir:
Permission denied in /appl/estion/AE/web/html/sources/filed/
gestioneOggetti.php on line 337
------


The PHP script line involved is
$hd=opendir($dir);
with $dir="/appl/apt000/pt0/include/p/"

This is the directory list where no "others" permissions are granted:

[aspt000@svuni330:/appl/apt000/pt0/include]#> ls -al p
drwxrwx--- 2 aspt000 aspt000 4096 Apr 19 12:52 p

If the directory gets backs the grants for "others"

[aspt000@svuni330:/appl/apt000/pt0/include]#> ls -al p
drwxrwxrwx 2 aspt000 aspt000 4096 Apr 19 12:52 p

evrything goes fine.

The user runnig the web server is in the same group (aspt000) (but is
not the
owner) of any of the dirs/files involved.

If we run a simple PHP script

We are using
- AIX 3.5
- PHP Version 4.3.8
- PHP API 20020918
- PHP Extension 20020429
- Zend Extension 20021010
- Thread Safety disabled
- Apache/1.3.33 (Unix) mod_ssl/2.8.24 OpenSSL/0.9.8d PHP/4.3.8
- Apache Release 10333100
- Apache API Version 19990320

We want to tighten the security on the machine so we have to remove
the "others"
grants, but in other hand we don't want to face a PHP upgrade to a
newer version.

Any suggestions ?

Thanks.

  Réponse avec citation
Vieux 22/06/2007, 09h37   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP 4 security File Access Issue on AIX

Alex Lirus wrote:
> Hi.
> We are facing a problem with an old PHP application.
>
> The application browse the local server directory in order to show to
> the
> client browser file info and data.
>
> When we remove all the grants from "others", from any of the
> directoryes or the
> tree involved, or the files themself, the progam pop up with the
> error:
>
> ------
> Warning: opendir(/appl/apt000/pt0/include/p/): failed to open dir:
> Permission denied in /appl/estion/AE/web/html/sources/filed/
> gestioneOggetti.php on line 337
> ------


You can suppress the error messages with putting @ in front of opendir

$hd@opendir($dir);


> The user runnig the web server is in the same group (aspt000) (but is
> not the owner) of any of the dirs/files involved.


if the webserver is in the group that is the group owner of the file, then
there shouldn't be any trouble for it to access the file, at least as long as
it's the servers main group.



> We want to tighten the security on the machine so we have to remove
> the "others"
> grants, but in other hand we don't want to face a PHP upgrade to a
> newer version.


If the user has to authenticate itself before starting to browse, then it
would be the users ownership that affects the access to files, and you would
get more "power" in limiting file access.


--

//Aho
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h24.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07896 seconds with 10 queries