You are not logged in.
Pages: 1
I have created a very small page which simply posts a url to a text file. This works fine when I "chmod 777" the file. However, when I use "chmod 775" no text is written to the file. The "http" user owns the file. Another, likely related, issue is my normal user is part of the "http" group and is unable to modify this file.
<?php
$url = $_POST['url'];
if($url){exec("echo $url >> todo");}
?>
<form method="post" action="">
gimme dat url: <input type="text" name="url"><br>
<input type="submit" value="gogogo">
</form>
This is the output of ls -l for the directory:
drwxr-xr-x 2 http http 4096 Oct 18 23:21 chunes
-rw-r--r-- 1 http http 195 Oct 18 23:20 index.php
-rwxrwxr-x 1 http http 0 Oct 18 23:50 todo
Realizing this is probably something dumb, could someone help me through it?
Thanks!
Offline
Alright, after trying again the form worked and successfully submitted the url to the text file. (no idea why it didn't before)
However, my user is still not able to modify the file:
[sarloth@minerva ~]$ touch /srv/http/snake/todo
touch: cannot touch `/srv/http/snake/todo': Permission denied
My username is listed in /etc/group:
http:x:33:sarloth
and of course, http:http still owns the file:
[sarloth@minerva ~]$ ls -l /srv/http/snake/
total 8
drwxr-xr-x 2 http http 4096 Oct 18 23:21 chunes
-rw-r--r-- 1 http http 195 Oct 18 23:20 index.php
-rwxrwxr-x 1 http http 0 Oct 19 01:07 todo
Offline
Pages: 1