httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mário Gamito" <gam...@gmail.com>
Subject [users@httpd] Problems with permissions
Date Fri, 04 Apr 2008 10:12:25 GMT
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


Mime
View raw message