[PATCH] ping: try SOCK_DGRAM if no root privileges

Michael Conrad mconrad at intellitree.com
Fri Jan 10 17:06:27 UTC 2014


On 1/10/2014 12:37 AM, Laurent Bercot wrote:
>
>  You're performing too much work copying your argument list. :P
>  The wrapper should be entirely transparent: busybox shouldn't
> even notice it has been run through it, so it should be called
> with the exact same argv. Here's what I do
> [...]

If you didn't want to have to maintain the list within the binary, and 
want to depend on the filesystem to declare which applets are allowed, 
you could write the wrapper to stat "/bin/$NAME" to verify that it (and 
"/" and "/bin") are
   * owned by root
   * not writable by other users
   * on the root filesystem (compare device number to device number of "/")
   * has set-uid bit

This would be authorization-by-the-filesystem that you could rely on, 
and is intuitive to configure.

It's a lot more code to write, but would still be a small binary.

-Mike



More information about the busybox mailing list