View Full Version : chmod directory threw php ?
chad777
09-15-2002, 09:08 AM
I am working on a hack for vbulletin and another program integration. The only problem I am having is
I run this command in one of the scripts:
chmod ("$p_directory/dir i am making", 0755);
but I get and error like this when testing the script
Warning: chmod failed: Operation not permitted on line xx
is there another command I can use to chmod ?
or do I have to do something to my server to allow php to chmod ?
Any ideas will help thanks
assassingod
09-15-2002, 09:23 AM
Cant you just CHMOD the directory through your FTP?
chad777
09-15-2002, 09:25 AM
yeah I probadly could but for this script to work it has to beable to chmod threw the script in order to make a directory for the user
assassingod
09-15-2002, 09:27 AM
Oh I see:p
Sorry, I dont kno anymore (PHP Beginner)
chad777
09-15-2002, 09:30 AM
Yeah I am too ...this will be my first full script ever doing kinda easy when you do enough research then you run into little problems that just get you so well lol you know.
everything works great except for this part :(
Kind of a bummer if I can't that part working :(
assassingod
09-15-2002, 09:33 AM
Stupid question but does $p_directory exsist for your hack? Maybe thats why it doesnt work?
chad777
09-15-2002, 09:35 AM
:) yeah it exsist ...I also tried just make it without a varible
like /home/name/bla/dir
but that don't work either :(
assassingod
09-15-2002, 09:39 AM
I was just about to suggest replacing the varible with the proper dir name. *Cant think of anything else*
chad777
09-15-2002, 06:53 PM
That makes a direcory in the web dir (like public_html)right ?
This will be making a directory outside the public like in the /etc dir.
DrkFusion
09-15-2002, 06:59 PM
I made the script do this
Lets pretend I name the sub food, so i put food in the field of the form and press submit and then the script does the following
Make a directory in /home/ called food,
then makes a folder in /home/food/ called public_html and chmods both of those folders to 777, and then in the directory
/home/food/public_html/ it creates a file called index.html that says The Subdomain food has been successfully created.
I have a live demo for you if you want.
Regards
Drk
chad777
09-15-2002, 07:13 PM
yeah that might work ....let me try real quick
chad777
09-15-2002, 07:34 PM
nope didn't work. It is not making a directory in the web root :(
i am not trying to make a dir. see able by web users.
here I will show you the code
chmod ("$p_directory/passwd", 0755);
chmod ("$p_directory/shadow", 0755);
chmod ("$p_directory/quota", 0755);
it is actually chmoding those files ! :)
this is for v2.0 of my neomail login hack.
this will let people sign and have there webmail accoutn created auto.
yes there is more then just that to this script, but that is what I am trying to do as of now
chad777
09-15-2002, 07:36 PM
$p_directory is a dir. that is specified early in the script
chad777
09-15-2002, 07:39 PM
well on my servers i have openwebmail and neomail. every user account gets neomail by default.
chad777
09-15-2002, 07:54 PM
so could i change ownership with the script ? I wouldn't really wnat to do that it seems like it would security risk :(
maybe i should just make something that would post to a private forum that they want and email address and then just make it and give them a link to the login script once it is created :(
chad777
09-15-2002, 08:28 PM
how to change ownership?
DrkFusion
09-15-2002, 08:33 PM
I think its like chown();
Not sure on that, but It should be that.
chad777
09-15-2002, 08:40 PM
k :) i will tell you if it works :) i think i am going to take a break for now
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.