Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 02-18-2011, 04:32 PM File ownership
borzoid's Avatar
Webmaster Talker

Posts: 526
Name: Connie Taylor
Trades: 13
I have a php application that I'm having rewritten. The old appliction created directories and files - but only with the 777 chmod on the directory it had to access. We are changing this but I am curious about how this works.

If the application creates a file is it the "owner" of the file in terms of chmod. I do want the ability of change, rename, etc.. files and I've used some gallery scripts in the past that would not allow a user to do that even via ftp.

What needs to go in the application in terms of granting it ownership for a more secure chmod setting. And in making this change what then is the status of the application (owner or user)

Thank you
borzoid is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-18-2011, 04:44 PM Re: File ownership
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
PHP usually runs under the "nobody" username so "nobody" will be the file "owner"
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-18-2011, 04:48 PM Re: File ownership
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And

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

Though you may have to make PHP run as "root" to get the elevated privileges
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-18-2011, 05:19 PM Re: File ownership
borzoid's Avatar
Webmaster Talker

Posts: 526
Name: Connie Taylor
Trades: 13
well I'm not sure about the whole superuser thing. I dont' want to have to set that up everytime I load the application.

With "nobody" as the file owner - just for comparison, if I upload an image via ftp - who is the owner?

I guess what I'm asking is how do I get the application to create and edit the files using 755 rather than 777 chmod
borzoid is offline
Reply With Quote
View Public Profile
 
Old 02-18-2011, 05:49 PM Re: File ownership
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The "owner" of FTP uploaded files is the user id of the control panel primary login.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-18-2011, 06:05 PM Re: File ownership
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
If your hosting is using the vsftp daemon you can set the ownership and permissions in vsftpd.conf.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-18-2011, 07:21 PM Re: File ownership
borzoid's Avatar
Webmaster Talker

Posts: 526
Name: Connie Taylor
Trades: 13
I'm sorry, I guess I'm not being clear.
borzoid is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to File ownership
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30817 seconds with 12 queries