[linux-merge]linux integration; annotated tag, batadv-net-for-davem-20170125, deleted. v4.10-rc1-1-g4ea33ef
by postmaster@open-mesh.org
The annotated tag, batadv-net-for-davem-20170125 has been deleted
was 24022b9119e2c68c988e1c1fceeef498e309c3ef
-----------------------------------------------------------------------
tag batadv-net-for-davem-20170125
Here is a batman-adv bugfix:
- fix reference count handling on fragmentation error, by Sven Eckelmann
-----BEGIN PGP SIGNATURE-----
iQJKBAABCgA0FiEE1ilQI7G+y+fdhnrfoSvjmEKSnqEFAliI0D8WHHN3QHNpbW9u
d3VuZGVybGljaC5kZQAKCRChK+OYQpKeoU2WD/9EdJuxSK0++Ka/sdXNEmy931dl
ojXukizbSIg5+vEs0GCP+E5btvCQkiz1e43AAljHjE4FTv4nu9BeHs7g4msQzZt1
7Pgy7A5wOz3UP/GN5QxEStGXYNmMeeKuaLklwxx+I619pMBX83bwlcfi8Xf40BWP
twmeyC11TCXbyyR7sH8nbDUiuZdP4soO3yr2WzTndHYui5UKTPlQ/5/VJLFtnIYw
ZDGYqAy7cg7wHO4khd2HaWuetIW4QIk59rqJX9pmwhDADuKL4XE9O9K3KawFH873
lYv226vc6d7Nc6mBfD0zDPXKImOsvi3padtVgXr2AYI8bBlh7eDp9NUFLITly8Jo
GIr8ABp5u6ZbN8A+16C5yHj5BZArQTe5EjZCS9yLLZQ0a9dXp4ZlEQuHSN9BJo05
CWYbpoj5Hunooh2EwOYfwWQa7kbDlDh/q7+qIqJcqhd+KT9cCHvPH3bsmi8gZMrh
fxyMouSX5LQmwnAgs/r4KUQ/5eCcf81o+SVTi/yvEf1Y9pfIqFna2IU/oREpjwY5
csFrY8Czc/O2E20+dzrCJAKK+Sa1U+WnUGlguqIQFIue/mMcOg6vvRcj8K2uz/7x
jsnfjA0ZsK2mRVpaWN/36RVcNyMQhrM35sVv7mnvwCWAViGBaPOzOzc+bv4fdzq0
8KOz8mx3qqU3ZIRKkw==
=xS4v
-----END PGP SIGNATURE-----
4ea33ef0f9e95b69db9131d7afd98563713e81b0 batman-adv: Decrease hardif refcnt on fragmentation send error
-----------------------------------------------------------------------
--
linux integration
5 years, 3 months
[linux-merge]linux integration; annotated tag, batadv-next-for-davem-20170125, created. batadv-next-for-davem-20170125
by postmaster@open-mesh.org
The annotated tag, batadv-next-for-davem-20170125 has been created
at c9ebbffb698d2549207a36d09841eb24ebbf4926 (tag)
tagging 03d17903cbfdc3bdf6e08c9fb6603936135bba5b (commit)
replaces v4.10-rc1
tagged by Simon Wunderlich
on Wed Jan 25 17:34:30 2017 +0100
- Shortlog ------------------------------------------------------------
This feature/cleanup patchset includes the following patches:
- bump version strings, by Simon Wunderlich
- Handle NET_XMIT_CN like NET_XMIT_SUCCESS, and a follow up code clean up,
by Gao Feng (2 patches)
- ignore self-generated loop detect MAC addresses in translation table,
by Simon Wunderlich
- install uapi batman_adv.h header, by Sven Eckelmann
- bump copyright years, by Sven Eckelmann
- Remove an unused variable in translation table code, by Sven Eckelmann
-----BEGIN PGP SIGNATURE-----
iQJKBAABCgA0FiEE1ilQI7G+y+fdhnrfoSvjmEKSnqEFAliI05cWHHN3QHNpbW9u
d3VuZGVybGljaC5kZQAKCRChK+OYQpKeoSBdD/wOqH7xr4o7sSb8L+7zZOuVHXF7
1zSnIPVSA6mnUrqYpeG22+J6SLFb9f7qaQNm3vLLjs3mhx9XDxbizF01bHSTbY3U
Jym/hvB1NNX13vtInbUfsnCeh6326nSK3aXKoCCMgH3PPY3GBwTzkhbRbZpV0Apw
rB8IqBwqcLapTDSbadHUB/AJaQyY30Sx3LSv6mZcJbyiRA9Mgrb3MLY9sr5RUi+u
wi+7BuJ8MicVl3m6DSNjserkJ9aKC+tsQH4GU8849zdVH3ZWBNI8j+meEXDASU/Y
TqGGMWHvtX3Jpltmkmm/65IuRS8cE6pptkjkxxwB8lgQJSfS6ZZPWRFn1EDix6Kr
vm1RIFiOjql2hCuVuwYclkesF65obzssXwW4rcdtK+KC2xPWEWxuCky4HNJFFxXM
nQX+Y6jz4fOBxrvv+NQknsUvquTB6DDLnNZl+Mr10z1h9Qhry4szDLkTpAQ+dAbT
+ON5Uvl4rdrjqUTodZKmD2cYSUrK/Ohazp8Za6BzKPnT78906WYjeqVVsRn7SiRC
bcz3XlYxDOZ84PVrqEtRUpo7J8cZIRHmbVNmo5VUUmUhycXq5x/eiGiQfyyrHUqe
sGmG2fv4JFrgqXfAh12kaQSqD1Y/yLxXtsPbmV5WXVEJ68lbq+uyTqWi30xxP9+b
Dq32C3u/94yrUQfr8Q==
=T74U
-----END PGP SIGNATURE-----
Gao Feng (2):
batman-adv: Treat NET_XMIT_CN as transmit successfully
batman-adv: Remove one condition check in batadv_route_unicast_packet
Simon Wunderlich (2):
batman-adv: Start new development cycle
batman-adv: don't add loop detect macs to TT
Sven Eckelmann (2):
batman-adv: update copyright years for 2017
batman-adv: Remove unused variable in batadv_tt_local_set_flags
-----------------------------------------------------------------------
--
linux integration
5 years, 3 months
[linux-merge]linux integration; annotated tag, batadv-net-for-davem-20170125, created. batadv-net-for-davem-20170125
by postmaster@open-mesh.org
The annotated tag, batadv-net-for-davem-20170125 has been created
at 24022b9119e2c68c988e1c1fceeef498e309c3ef (tag)
tagging 4ea33ef0f9e95b69db9131d7afd98563713e81b0 (commit)
replaces v4.10-rc1
tagged by Simon Wunderlich
on Wed Jan 25 17:20:15 2017 +0100
- Shortlog ------------------------------------------------------------
Here is a batman-adv bugfix:
- fix reference count handling on fragmentation error, by Sven Eckelmann
-----BEGIN PGP SIGNATURE-----
iQJKBAABCgA0FiEE1ilQI7G+y+fdhnrfoSvjmEKSnqEFAliI0D8WHHN3QHNpbW9u
d3VuZGVybGljaC5kZQAKCRChK+OYQpKeoU2WD/9EdJuxSK0++Ka/sdXNEmy931dl
ojXukizbSIg5+vEs0GCP+E5btvCQkiz1e43AAljHjE4FTv4nu9BeHs7g4msQzZt1
7Pgy7A5wOz3UP/GN5QxEStGXYNmMeeKuaLklwxx+I619pMBX83bwlcfi8Xf40BWP
twmeyC11TCXbyyR7sH8nbDUiuZdP4soO3yr2WzTndHYui5UKTPlQ/5/VJLFtnIYw
ZDGYqAy7cg7wHO4khd2HaWuetIW4QIk59rqJX9pmwhDADuKL4XE9O9K3KawFH873
lYv226vc6d7Nc6mBfD0zDPXKImOsvi3padtVgXr2AYI8bBlh7eDp9NUFLITly8Jo
GIr8ABp5u6ZbN8A+16C5yHj5BZArQTe5EjZCS9yLLZQ0a9dXp4ZlEQuHSN9BJo05
CWYbpoj5Hunooh2EwOYfwWQa7kbDlDh/q7+qIqJcqhd+KT9cCHvPH3bsmi8gZMrh
fxyMouSX5LQmwnAgs/r4KUQ/5eCcf81o+SVTi/yvEf1Y9pfIqFna2IU/oREpjwY5
csFrY8Czc/O2E20+dzrCJAKK+Sa1U+WnUGlguqIQFIue/mMcOg6vvRcj8K2uz/7x
jsnfjA0ZsK2mRVpaWN/36RVcNyMQhrM35sVv7mnvwCWAViGBaPOzOzc+bv4fdzq0
8KOz8mx3qqU3ZIRKkw==
=xS4v
-----END PGP SIGNATURE-----
Sven Eckelmann (1):
batman-adv: Decrease hardif refcnt on fragmentation send error
-----------------------------------------------------------------------
--
linux integration
5 years, 3 months
[batctl] master: batctl: Allow to read gw_mode as normal user (bd03c19)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit bd03c192bf07697e5b4657bb4d6c85354d3a96ab
Author: Sven Eckelmann <sven(a)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(a)narfation.org>
Signed-off-by: Simon Wunderlich <sw(a)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)
5 years, 3 months
[batctl] master: batctl: Allow to read sysfs settings as normal user (064fb90)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 064fb90df5bcf15a00322f268c77fa2644e06083
Author: Sven Eckelmann <sven(a)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(a)narfation.org>
Signed-off-by: Simon Wunderlich <sw(a)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;
5 years, 3 months
[batctl] master: batctl: Allow to read list of interfaces as normal user (515cf78)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 515cf780b4c6387edbe99aea626115735ae230db
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Jan 22 13:21:13 2017 +0100
batctl: Allow to read list of interfaces as normal user
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(a)narfation.org>
Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de>
>---------------------------------------------------------------
515cf780b4c6387edbe99aea626115735ae230db
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) &&
5 years, 3 months
[batctl] master: batctl: Make root privileges check function specific (894b25c)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 894b25c2be5f62f8eca2d71a37c5e2aa8a418789
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Jan 22 13:21:08 2017 +0100
batctl: Make root privileges check function specific
It is a long standing TODO to move the root check to each batctl
sub-application. This will allow later to make the checks specific to the
requirements for each function instead of disallowing the use of batctl for
non-root users completely.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de>
>---------------------------------------------------------------
894b25c2be5f62f8eca2d71a37c5e2aa8a418789
debug.c | 6 ++++++
interface.c | 2 ++
ioctl.c | 3 +++
main.c | 5 -----
ping.c | 2 ++
sys.c | 8 ++++++++
tcpdump.c | 2 ++
tp_meter.c | 2 ++
traceroute.c | 2 ++
translate.c | 2 ++
10 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/debug.c b/debug.c
index ee04928..07a91c4 100644
--- a/debug.c
+++ b/debug.c
@@ -219,6 +219,8 @@ int handle_debug_table(char *mesh_iface, int debug_table, int argc, char **argv)
}
}
+ check_root_or_die("batctl");
+
if (read_opt & UNICAST_ONLY && read_opt & MULTICAST_ONLY) {
fprintf(stderr, "Error - '-u' and '-m' are exclusive options\n");
debug_table_usage(debug_table);
@@ -270,6 +272,8 @@ int print_vis_info(char *mesh_iface)
char *debugfs_mnt;
FILE *fp;
+ check_root_or_die("batctl vis_data");
+
debugfs_mnt = debugfs_mount(NULL);
if (!debugfs_mnt) {
fprintf(stderr, "Error - can't mount or find debugfs\n");
@@ -318,6 +322,8 @@ int log_print(char *mesh_iface, int argc, char **argv)
}
}
+ check_root_or_die("batctl log");
+
debugfs_mnt = debugfs_mount(NULL);
if (!debugfs_mnt) {
fprintf(stderr, "Error - can't mount or find debugfs\n");
diff --git a/interface.c b/interface.c
index 8cc4f92..01ee6fc 100644
--- a/interface.c
+++ b/interface.c
@@ -324,6 +324,8 @@ int interface(char *mesh_iface, int argc, char **argv)
}
}
+ check_root_or_die("batctl interface");
+
rest_argc = argc - optind;
rest_argv = &argv[optind];
diff --git a/ioctl.c b/ioctl.c
index d95fc8d..838e11b 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -33,6 +33,7 @@
#include <linux/ethtool.h>
#include <stdint.h>
+#include "functions.h"
#include "ioctl.h"
/* code borrowed from ethtool */
@@ -104,6 +105,8 @@ int ioctl_statistics_get(char *mesh_iface)
struct ifreq ifr;
int fd = -1, ret = EXIT_FAILURE;
+ check_root_or_die("batctl statistics");
+
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, mesh_iface, sizeof(ifr.ifr_name));
ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
diff --git a/main.c b/main.c
index 2fc9b75..02d89c4 100644
--- a/main.c
+++ b/main.c
@@ -134,11 +134,6 @@ int main(int argc, char **argv)
exit(EXIT_SUCCESS);
}
- /* TODO: remove this generic check here and move it into the individual functions */
- /* check if user is root */
- if (strncmp(argv[1], "bisect", strlen("bisect")) != 0)
- check_root_or_die(argv[0]);
-
if ((strcmp(argv[1], "interface") == 0) || (strcmp(argv[1], "if") == 0)) {
ret = interface(mesh_iface, argc - 1, argv + 1);
diff --git a/ping.c b/ping.c
index 7e5c6fc..df6b0e2 100644
--- a/ping.c
+++ b/ping.c
@@ -133,6 +133,8 @@ int ping(char *mesh_iface, int argc, char **argv)
return EXIT_FAILURE;
}
+ check_root_or_die("batctl ping");
+
dst_string = argv[found_args];
bat_hosts_init(0);
bat_host = bat_hosts_find_by_name(dst_string);
diff --git a/sys.c b/sys.c
index 7817234..9dcb4f2 100644
--- a/sys.c
+++ b/sys.c
@@ -152,6 +152,8 @@ 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);
@@ -251,6 +253,8 @@ 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);
@@ -324,6 +328,8 @@ 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);
@@ -449,6 +455,8 @@ int handle_ra_setting(int argc, char **argv)
}
}
+ check_root_or_die("batctl routing_algo");
+
if (argc == 2) {
res = write_file(SYS_SELECTED_RA_PATH, "", argv[1], NULL);
goto out;
diff --git a/tcpdump.c b/tcpdump.c
index 3000343..4ede76b 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1255,6 +1255,8 @@ int tcpdump(int argc, char **argv)
return EXIT_FAILURE;
}
+ check_root_or_die("batctl tcpdump");
+
bat_hosts_init(read_opt);
signal(SIGINT, sig_handler);
diff --git a/tp_meter.c b/tp_meter.c
index 4f4122c..918fb79 100644
--- a/tp_meter.c
+++ b/tp_meter.c
@@ -432,6 +432,8 @@ int tp_meter(char *mesh_iface, int argc, char **argv)
return EXIT_FAILURE;
}
+ check_root_or_die("batctl throughputmeter");
+
dst_string = argv[found_args];
bat_hosts_init(read_opt);
bat_host = bat_hosts_find_by_name(dst_string);
diff --git a/traceroute.c b/traceroute.c
index e7c55ef..124ce7c 100644
--- a/traceroute.c
+++ b/traceroute.c
@@ -94,6 +94,8 @@ int traceroute(char *mesh_iface, int argc, char **argv)
return EXIT_FAILURE;
}
+ check_root_or_die("batctl traceroute");
+
dst_string = argv[found_args];
bat_hosts_init(read_opt);
bat_host = bat_hosts_find_by_name(dst_string);
diff --git a/translate.c b/translate.c
index 18bde4d..31da3a3 100644
--- a/translate.c
+++ b/translate.c
@@ -46,6 +46,8 @@ int translate(char *mesh_iface, int argc, char **argv)
return EXIT_FAILURE;
}
+ check_root_or_die("batctl translate");
+
dst_string = argv[1];
bat_hosts_init(0);
bat_host = bat_hosts_find_by_name(dst_string);
5 years, 3 months
[batctl] master: batctl: Allow to retrieve interface stats as non-root (10f278e)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 10f278e8ec5fcb6592c55ad7d7f0350d6a684522
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Jan 22 13:21:09 2017 +0100
batctl: Allow to retrieve interface stats as non-root
Standard users are usually able to retrieve interface statistics via the
SIOCETHTOOL ioctl. Don't artificially prevent users to retrieve the
statistics via batctl.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de>
>---------------------------------------------------------------
10f278e8ec5fcb6592c55ad7d7f0350d6a684522
ioctl.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/ioctl.c b/ioctl.c
index 838e11b..832a274 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -105,8 +105,6 @@ int ioctl_statistics_get(char *mesh_iface)
struct ifreq ifr;
int fd = -1, ret = EXIT_FAILURE;
- check_root_or_die("batctl statistics");
-
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, mesh_iface, sizeof(ifr.ifr_name));
ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
5 years, 3 months
[batctl] master: batctl: Allow to read loglevel as normal user (dece14e)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit dece14e2e027db4215dcad72c54e3b513f8a8ab2
Author: Sven Eckelmann <sven(a)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(a)narfation.org>
Signed-off-by: Simon Wunderlich <sw(a)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;
5 years, 3 months
[batctl] master: batctl: Use geteuid for checks of root privileges (86891b5)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 86891b51d4194beb04f5090ee3a5932cabf8acb9
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Jan 22 13:21:06 2017 +0100
batctl: Use geteuid for checks of root privileges
The getuid only shows the UID of the current user. But the EUID is relevant
for accessing the debugfs and sysfs files. This check is still to strict
when it comes to netlink but avoids a lot of bogus warnings like
Error received: Operation not permitted
Error - mesh has not been enabled yet
Activate your mesh by adding interfaces to batman-adv
when only the euid of the process was 0 but the interface was actually
working.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de>
>---------------------------------------------------------------
86891b51d4194beb04f5090ee3a5932cabf8acb9
functions.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/functions.c b/functions.c
index c1aaf12..2239440 100644
--- a/functions.c
+++ b/functions.c
@@ -1141,7 +1141,7 @@ void get_random_bytes(void *buf, size_t buflen)
void check_root_or_die(const char *cmd)
{
- if (getuid() || getgid()) {
+ if (geteuid() != 0) {
fprintf(stderr, "Error - you must be root to run '%s' !\n", cmd);
exit(EXIT_FAILURE);
}
5 years, 3 months