[PATCH] traceroute: delete the verification of root user

范星宇 isfanxy at 126.com
Sat Mar 1 07:57:49 UTC 2025


Hello,

The attached patch is to delete the judgment of whether it is the root user when using "traceroute -s".When we use "traceroute -s" command as a non-root regular user, a "you must be root" error occurs due to the validation of whether getuid() is equal to 0. Even if CAP_NET_RAW permission is configured by "setcap cap_net_raw+ep /bin/busybox", non-root users cannot use "traceroute -s" as well. We consider that finer grained permission control can be achieved through the capabilities(CAP) mechanism, rather than directly verifying whether it is a root user.Kindly check the patch.


---
*** 1070,1077 ****


  #else


  		len_and_sockaddr *source_lsa = xdotted2sockaddr(source, 0);

  #endif

- 		if (getuid() != 0)

- 			bb_simple_error_msg_and_die(bb_msg_you_must_be_root);

  		/* Ping4 does this (why?) */

  		if (af == AF_INET)

  			if (setsockopt(sndsock, IPPROTO_IP, IP_MULTICAST_IF,

--- 1070,1075 ----


Thanks & Regards,
Xingyu Fan


| |
范星宇
|
|
isfanxy at 126.com
|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20250301/8fa037b7/attachment.htm>


More information about the busybox mailing list