You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mário Gamito <ga...@gmail.com> on 2008/04/04 12:12:25 UTC

[users@httpd] Problems with permissions

Hi,

I have this PHP code to add an alias in a DNS server (djbdns).

<?php

$username = 'foobar';
system('/etc/tinydns/root/add-alias' . ' ' . $username . ' ' . '192.168.1.1);
system ('make');

?>

If I run in the shell as root:

# php dns.php

all is well, the entry is created.

Os course, that running through Apache, it isn't, because Apache is
running under nobody.nobody

Here are the relevant permissions and ownership:

/etc/tinydns -> dtrwxr-sr-t -> root.root.
/etc/tinydns/root -> drwxr-sr-x -> root.root
/etc/tinydns/root/add-alias -> -rwx-r-xr-x -> root.root
/etc/tinydns/root/data -> -rw-r--r-- -> root.root (the file in which
the command add-alias inserts the data)

How do I turn this around so that Apache executes add-alias and make
command without compromising (at least too much) security ?

Any help would be appreciated.

Warm Regards,
Mário Gamito

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org