Skip to content

batctl: relax root privileges check

Sven Eckelmann batman 1 version In review

Get series with b4
b4 am 3266034.EiLA6asg3G@sven-edge

Versions newest first

  1. v1 Latest9 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9batctl: Move root privileges check in separate functionfunctions.c functions.h main.c+11 -40 replies
2/9batctl: Use geteuid for checks of root privilegesfunctions.c+1 -10 replies
3/9batctl: Return type of error on netlink_get_info errornetlink.c+4 -20 replies
4/9batctl: Make root privileges check function specificdebug.c interface.c ioctl.c +7 more+29 -50 replies
5/9batctl: Allow to retrieve interface stats as non-rootioctl.c+0 -20 replies
6/9batctl: Allow to read loglevel as normal usersys.c+2 -20 replies
7/9batctl: Allow to read gw_mode as normal usersys.c+2 -20 replies
8/9batctl: Allow to read sysfs settings as normal usersys.c+2 -20 replies
9/9batctl: Allow to read list of interfaces as normal userinterface.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [B.A.T.M.A.N.] [PATCH 0/9] batctl: relax root privileges check

Hi,

batctl has a "root" user check since the beginning of this tool. It even got a TODO comment in 58525b8330e9 ("batctl: adjust vis.c coding style"):

    /* TODO: remove this generic check here and move it into the individual functions */

This patchset is now trying to resolve this TODO.

* batctl: Move root privileges check in separate function
* batctl: Use geteuid for checks of root privileges
* batctl: Return type of error on netlink_get_info error
* batctl: Make root privileges check function specific
* batctl: Allow to retrieve interface stats as non-root
* batctl: Allow to read loglevel as normal user
* batctl: Allow to read gw_mode as normal user
* batctl: Allow to read sysfs settings as normal user
* batctl: Allow to read list of interfaces as normal user

"Return type of error on netlink_get_info error" may look a little bit odd in this list. But it was required in my initial test to avoid that "originators" and "gwl" try to start a debugfs access when the netlink function should have returned a "-EPERM" (but did return a -EOPNOTSUPP).

Kind regards,
Sven