batctl: relax root privileges check
Get series with b4
b4 am 3266034.EiLA6asg3G@sven-edgeVersions newest first
- v1 Latest9 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | batctl: Move root privileges check in separate functionfunctions.c functions.h main.c | +11 | 0 replies | |
| 2/9 | batctl: Use geteuid for checks of root privilegesfunctions.c | +1 | 0 replies | |
| 3/9 | batctl: Return type of error on netlink_get_info errornetlink.c | +4 | 0 replies | |
| 4/9 | batctl: Make root privileges check function specificdebug.c interface.c ioctl.c +7 more | +29 | 0 replies | |
| 5/9 | batctl: Allow to retrieve interface stats as non-rootioctl.c | +0 | 0 replies | |
| 6/9 | batctl: Allow to read loglevel as normal usersys.c | +2 | 0 replies | |
| 7/9 | batctl: Allow to read gw_mode as normal usersys.c | +2 | 0 replies | |
| 8/9 | batctl: Allow to read sysfs settings as normal usersys.c | +2 | 0 replies | |
| 9/9 | batctl: Allow to read list of interfaces as normal userinterface.c | +2 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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