Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit dece14e2e027db4215dcad72c54e3b513f8a8ab2 Author: Sven Eckelmann sven@narfation.org Date: Sun Jan 22 13:21:10 2017 +0100
batctl: Allow to read loglevel as normal user
The loglevel sysfs file can be read by normal users. Only writing to this file is restricted. Don't artificially restrict access to this file by the batctl subcommand.
Signed-off-by: Sven Eckelmann sven@narfation.org Signed-off-by: Simon Wunderlich sw@simonwunderlich.de
dece14e2e027db4215dcad72c54e3b513f8a8ab2 sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys.c b/sys.c index 9dcb4f2..ac978bf 100644 --- a/sys.c +++ b/sys.c @@ -152,12 +152,12 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) } }
- check_root_or_die("batctl loglevel"); - path_buff = malloc(PATH_BUFF_LEN); snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, mesh_iface);
if (argc != 1) { + check_root_or_die("batctl loglevel"); + for (i = 1; i < argc; i++) { if (strcmp(argv[i], "none") == 0) { log_level = 0;