RE: SAFE MODE Restriction - mkdir()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It just seems not making sence. I have read the manual and it does not
explain this specially.

If the user owns this folder: "www\myfolders"

And runs a PHP-script in safe mode that creates the folder
"www\myfolders\who".

Who owns the "who" folder?

I assume the owner. If so, why can't the PHP-script create another folder
inside like "www\myfolders\who\this" like before?

If "the user of the php process" (UID) is the owner of the new folder, why
can't it create a folder inside its own folder? Is it because it's triggered
by a user different from the user of the PHP process?

Regards,
Summi

-----Original Message-----
From: Marek Kilimajer [mailto:lists@xxxxxxxxxxxxx] 
Sent: 25. nóvember 2004 01:13
To: SED
Cc: php-general@xxxxxxxxxxxxx
Subject: Re:  SAFE MODE Restriction - mkdir()

SED wrote:
> Then, shouldn't the owner be able to handle the new directory?
> 
> In my case, the owner creates the directory X but can't create a 
> subdirectory inside the directory X! nor save a file into it!
> 
> Can you explain that?
> 
> Is the PHP not always running as the same user? Or is it base on type 
> of the function?

Once again: the user of the php process is different from the owner of the
php script. And this is what matters.

The limitation is not at operating system level, but php willingly chooses
not to let you create the subdirectory (because safe mode is on)

> 
> Regards,
> Summi
> 	
> 
> -----Original Message-----
> From: Marek Kilimajer [mailto:lists@xxxxxxxxxxxxx]
> Sent: 25. nóvember 2004 00:05
> To: SED
> Cc: php-general@xxxxxxxxxxxxx
> Subject: Re:  SAFE MODE Restriction - mkdir()
> 
> SED wrote:
> 
>>Hi,
>>
>>I have very wierd situation. The ISP is running in SAFE MODE.
>>
>>I use PHP to create a directory with mkdir("something", 0777), it 
>>works great!
>>
>>However, if I try to create a sub-directory (e.g. "something2") in the 
>>"something" directory, I get the following:
>>
>>Warning: SAFE MODE Restriction in effect. The script whose uid is 3703 
>>is not allowed to access "something" owned by uid 508 in 
>>/www/login/filer.php on line 287
>>
>>However, if I check the chmod of "something" directory it's 777.
>>
>>Why can't I use PHP-uid to do create or upload files to this "something"
>>directory, which PHP-uid itself created?
> 
> 
> Because SAFE MODE is on :-)
> 
> It's all in the manual. something is created by the server process so 
> it's also owned by server process. The script is owned by you and can 
> access only directories and files owned by you. You can try to change 
> the group
> (chgrp()) if safe_mode_gid is on, or use ftp functions to create the 
> directories.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux