Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit 064fb90df5bcf15a00322f268c77fa2644e06083 Author: Sven Eckelmann sven@narfation.org Date: Sun Jan 22 13:21:12 2017 +0100
batctl: Allow to read sysfs settings as normal user
The sysfs files can be read by normal users. Only writing to these files is restricted. Don't artificially restrict access to these files by the batctl subcommands.
Signed-off-by: Sven Eckelmann sven@narfation.org Signed-off-by: Simon Wunderlich sw@simonwunderlich.de
064fb90df5bcf15a00322f268c77fa2644e06083 sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys.c b/sys.c index a695c18..65b438c 100644 --- a/sys.c +++ b/sys.c @@ -253,8 +253,6 @@ int handle_sys_setting(char *mesh_iface, int setting, int argc, char **argv) } }
- check_root_or_die("batctl"); - /* prepare the classic path */ path_buff = malloc(PATH_BUFF_LEN); snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, mesh_iface); @@ -272,6 +270,8 @@ int handle_sys_setting(char *mesh_iface, int setting, int argc, char **argv) goto out; }
+ check_root_or_die("batctl"); + if (!batctl_settings[setting].params) goto write_file;