Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-31-2003, 03:49 PM   #1
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
PHP help needed, please.

hi can someone help me with what i would assume small php code fix. i'm trying to add a CHMOD & CHOWN function to my upload.php file. right now all images that are uploaded by the script is being set to CHMOD 600 with a GRP and USER of "99".

I can't ftp in to edit or delete images since it says i don't have permission. so can someone the chmod to 0644 with a GRP and USER of 'missbot'

thanks in advance.

file is here www.nemxproject.com/upload.txt
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-31-2003, 03:52 PM   #2
JSA Matt
So Fucking Banned
 
Join Date: Aug 2003
Location: San Diego, CA
Posts: 5,464
http://us2.php.net/manual/en/function.chgrp.php
http://us2.php.net/manual/en/function.chmod.php
http://us2.php.net/manual/en/function.chown.php

php.net should be your next best friend.
JSA Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-31-2003, 03:57 PM   #3
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
yeah php.net is good. i just came from there. I guess i'm placing the function in the wrong place or somethign cause it was working. no errors were displayed yet the files still uploaded with a restricted chmod/grp/owner
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-31-2003, 04:07 PM   #4
JDog
Confirmed User
 
Join Date: Feb 2003
Location: Canby, OR
Posts: 7,453
Quote:
Originally posted by acctman
yeah php.net is good. i just came from there. I guess i'm placing the function in the wrong place or somethign cause it was working. no errors were displayed yet the files still uploaded with a restricted chmod/grp/owner
Sometimes the CHMOD doesn't work on some servers, you'll need to use the

PHP Code:
exec("chmod 666 /path/to/file/"); 
see if that works

jDoG
__________________
NSCash now powering ReelProfits.com
ALSO FEATURING: NSCash.com :: SoloDollars.com :: ReelProfits.com :: BiminiBucks.com :: VOD
PROGRAMS COMING SOON: Greedy Bucks :: Vengeance Cash
NOW OFFERING OVER 60 SITES
CONTACT :: JAMES SMITH :: CHIEF TECHNOLOGY OFFICER :: ICQ (711385133)
JDog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-31-2003, 04:25 PM   #5
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,143
An uprivileged user cannot chown a file to another user.

As for deleting files, you have permission to delete them if they are in a directory you have write access to, regardless of the permission on the file itself.
fuzebox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-31-2003, 05:19 PM   #6
EZRhino
Confirmed User
 
EZRhino's Avatar
 
Industry Role:
Join Date: Jul 2003
Location: couch
Posts: 6,258
After that learn ssh, life is easier once you get the basics down
EZRhino is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-02-2004, 03:13 AM   #7
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
hmm i still can't get the script to use the chmod i'm not receiving any errors. files are still being uploaded with 0600 chmod. anyone have any insight into why this is happening
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-02-2004, 03:22 AM   #8
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
Quote:
Originally posted by acctman
hmm i still can't get the script to use the chmod i'm not receiving any errors. files are still being uploaded with 0600 chmod. anyone have any insight into why this is happening
is your error reporting off?
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-02-2004, 03:49 AM   #9
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
error reporting seems to be working cause I left out a semi-colon and the script displayed the line error
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-02-2004, 03:50 AM   #10
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
Quote:
Originally posted by acctman
error reporting seems to be working cause I left out a semi-colon and the script displayed the line error
hmm no not necessarily... leaving out a semi colon is a parse error, and that will always be reported.. if your error reporting is off, it will hide the warnings, which would probably explain your chmod problems.
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-02-2004, 04:01 AM   #11
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
how would i go about checking to see if my error reporting is on
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-02-2004, 05:39 AM   #12
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Quote:
Originally posted by acctman
how would i go about checking to see if my error reporting is on
Your Webserver is running under a non-root userspace. Files which get uploaded will be owned by this user.

Since this isnt a _root_ user you cannot chown the file to another user on the machine using the php script, about the best you could do is chmod 755, so that only the webserver user can write to the file but everyone else on the system can read/execute it.

Right from Php.net/chown
"Attempts to change the owner of the file filename to user user (specified by name or number). Only the superuser may change the owner of a file. "
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-02-2004, 07:24 PM   #13
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
Quote:
Originally posted by notjoe


Your Webserver is running under a non-root userspace. Files which get uploaded will be owned by this user.

Since this isnt a _root_ user you cannot chown the file to another user on the machine using the php script, about the best you could do is chmod 755, so that only the webserver user can write to the file but everyone else on the system can read/execute it.

Right from Php.net/chown
"Attempts to change the owner of the file filename to user user (specified by name or number). Only the superuser may change the owner of a file. "
what if i had a separate script that would scan the /image folder and chmod all 600 files to 755, would something like that work?
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.