All,

Here's the second change for this, this time in the radvd.hotplug script. This 
needed to be tweaked slightly so it only issued a HUP to the unprivileged 
process.

Index: radvd.hotplug
===================================================================
--- radvd.hotplug       (revision 28379)
+++ radvd.hotplug       (working copy)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 if [ "$ACTION" = ifup ]; then
-       killall -HUP radvd 2>/dev/null
+        start-stop-daemon -q -K -s HUP -p /var/run/radvd/radvd.pid
 fi


Again, any input is appreciated.

Thanks,
Adam

On Oct 8, 2011, at 2:17 PM, Adam Gensler wrote:

> All,
> 
> This is my first try at a patch and also my first attempt at parsing 
> /etc/config files in OpenWRT. If I've goofed something up please let me know. 
> The purpose of this change is to allow users to config radvd to run in 
> unprivileged mode. Per the radvd man page:
> 
> radvd(8) - Linux man page
> http://linux.die.net/man/8/radvd
> 
> -u username, --username username
> If specified, drops root privileges and changes user ID to username and group 
> ID to the primary group of username. This is recommended for security 
> reasons. You might also need to use -p to point to a file in a username 
> -writable directory (e.g. /var/run/radvd/radvd.pid).
> 
> This patch can parse three new fields in /etc/config/radvd, under "config 
> radvd", specifically:
> option secure_mode    1
> option username               'nobody'
> option group          'nogroup'
> 
> I think the above is fairly self explanatory. When run with the "-u" option, 
> radvd spawns two processes, one with root privileges for interface 
> configuration purposes and another, unprivileged process, for everything else.
> 
> With none of these options configured radvd will operate as it always has.
> 
> Any suggestions and / or input would be appreciated. As I said, this is my 
> first crack at working with OpenWRT so there's a possibility I did something 
> incorrect.
> 
> Thanks in advance,
> Adam
> <radvd.init.patch>

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to