[B.A.T.M.A.N.] [PATCH 9/9] batctl: Allow to read list of interfaces as normal user

Sven Eckelmann
2017-01-22T12:21:13Z

The list of interfaces attached to a batman-adv interface can be read by a
normal user via rtnetlink or sysfs. Only modifying this list requires more
acesss. Don't artificially restrict access to this information by the
batctl sucommand.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
interface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/interface.c b/interface.c
index 01ee6fc..5a57be6 100644
--- a/interface.c
+++ b/interface.c
@@ -324,14 +324,14 @@ int interface(char *mesh_iface, int argc, char **argv)
}
}

- check_root_or_die("batctl interface");
-
rest_argc = argc - optind;
rest_argv = &argv[optind];

if (rest_argc == 0)
return print_interfaces(mesh_iface);

+ check_root_or_die("batctl interface");
+
if ((strcmp(rest_argv[0], "add") != 0) && (strcmp(rest_argv[0], "a") != 0) &&
(strcmp(rest_argv[0], "del") != 0) && (strcmp(rest_argv[0], "d") != 0) &&
(strcmp(rest_argv[0], "create") != 0) && (strcmp(rest_argv[0], "c") != 0) &&
--
2.11.0