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 --- 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;