Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit bd03c192bf07697e5b4657bb4d6c85354d3a96ab Author: Sven Eckelmann sven@narfation.org Date: Sun Jan 22 13:21:11 2017 +0100
batctl: Allow to read gw_mode as normal user
The gw_mode 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
bd03c192bf07697e5b4657bb4d6c85354d3a96ab sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys.c b/sys.c index ac978bf..a695c18 100644 --- a/sys.c +++ b/sys.c @@ -328,8 +328,6 @@ int handle_gw_setting(char *mesh_iface, int argc, char **argv) } }
- check_root_or_die("batctl gw_mode"); - path_buff = malloc(PATH_BUFF_LEN); snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, mesh_iface);
@@ -386,6 +384,8 @@ int handle_gw_setting(char *mesh_iface, int argc, char **argv) goto out; }
+ check_root_or_die("batctl gw_mode"); + if (strcmp(argv[1], "client") == 0) gw_mode = GW_MODE_CLIENT; else if (strcmp(argv[1], "server") == 0)