Re: [PHP] mkdir and directory permissions

2002-10-25 Thread Jason Wong
On Friday 25 October 2002 06:51, Matias Silva wrote:
 Hi-ya all, here's a quickie...

 In my script I create a directory (mysql.backup.timestamp/) within a
 directory called backup/.
 I use  the function  mkdir(mysql.backup.timestamp, 0777);  and it shows
 the permissions
 as after the function executes:

 drx--t   2 nobodydaemon1024 Oct 24 15:16
 mysql.backup.October-24-2002-1516

 Where's the permissions (drx--t   2 nobody   daemon) coming from?  Is
 it the php.ini, apache conf or
 the operating system?

The permissions (rx--t) is coming from your mode setting in your mkdir() 
function AND from the system setting umask -- see manual - umask() and check 
out user comments as well.

 I would like to set the owner to root and the group to nc.  How can
 this be achieved
 by the php script?  Or do I have set this up in the other environments (OS
 or Apache)?

You can't.

The user:group comes from the user running the webserver, which in your case 
is nobody:daemon.

Only root can the the user:group ownership of files and directories. So unless 
your webserver is running as root you cannot use chown()/chgrp().


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
After years of research, scientists recently reported that there is,
indeed, arroz in Spanish Harlem.
*/

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Richard B. Johnson wrote:
 It's a tomorrow thing. Ten hours it too long to stare at a
 screen.

Sissy!

- Jens Axboe on linux-kernel
*/


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




Re: [PHP] mkdir and directory permissions

2002-10-25 Thread Marek Kilimajer
Actualy, you can use chgrp(), but apache must be a member of the group 
you are changing to.

Jason Wong wrote:

On Friday 25 October 2002 06:51, Matias Silva wrote:
 

Hi-ya all, here's a quickie...

In my script I create a directory (mysql.backup.timestamp/) within a
directory called backup/.
I use  the function  mkdir(mysql.backup.timestamp, 0777);  and it shows
the permissions
as after the function executes:

   drx--t   2 nobodydaemon1024 Oct 24 15:16
mysql.backup.October-24-2002-1516

Where's the permissions (drx--t   2 nobody   daemon) coming from?  Is
it the php.ini, apache conf or
the operating system?
   


The permissions (rx--t) is coming from your mode setting in your mkdir() 
function AND from the system setting umask -- see manual - umask() and check 
out user comments as well.

 

I would like to set the owner to root and the group to nc.  How can
this be achieved
by the php script?  Or do I have set this up in the other environments (OS
or Apache)?
   


You can't.

The user:group comes from the user running the webserver, which in your case 
is nobody:daemon.

Only root can the the user:group ownership of files and directories. So unless 
your webserver is running as root you cannot use chown()/chgrp().


 



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




Re: [PHP] mkdir and directory permissions

2002-10-25 Thread Monty
Hi Jason, I have a follow-up question about mkdir. If the files created by
mkdir are owned by 'nobody', does that create a security risk for those
files? If so, how does one get around accepting files via an upload form
that are assigned to a user other than 'nobody'?

Monty



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




Re: [PHP] mkdir and directory permissions

2002-10-25 Thread @ Edwin
Hello,

Just a few comments... And no, I'm not Jason :)

Monty [EMAIL PROTECTED] wrote:
 Hi Jason, I have a follow-up question about mkdir. If the files created by
 mkdir are owned by 'nobody', does that create a security risk for those
 files?

No, not really.

 If so, how does one get around accepting files via an upload form
 that are assigned to a user other than 'nobody'?

Perhaps, you can check this: (Also see: User Contributed Notes)

  http://www.php.net/manual/en/function.chown.php

- E

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




[PHP] mkdir and directory permissions

2002-10-24 Thread Matias Silva
Hi-ya all, here's a quickie...

In my script I create a directory (mysql.backup.timestamp/) within a
directory called backup/.
I use  the function  mkdir(mysql.backup.timestamp, 0777);  and it shows
the permissions
as after the function executes:

drx--t   2 nobodydaemon1024 Oct 24 15:16
mysql.backup.October-24-2002-1516

Where's the permissions (drx--t   2 nobody   daemon) coming from?  Is it
the php.ini, apache conf or
the operating system?

I would like to set the owner to root and the group to nc.  How can this
be achieved
by the php script?  Or do I have set this up in the other environments (OS
or Apache)?

Cheers!
-Matias




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