iproute2/iproute2-2.6.29-1-flushcheckuid.diff
OBS User autobuild 57ce5340c3 Accepting request 17722 from network:utilities
Copy from network:utilities/iproute2 based on submit request 17722 from user adrianSuSE

OBS-URL: https://build.opensuse.org/request/show/17722
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/iproute2?expand=0&rev=20
2009-08-13 21:25:48 +00:00

35 lines
798 B
Diff

Index: ip/ipaddress.c
===================================================================
--- ip/ipaddress.c.orig
+++ ip/ipaddress.c
@@ -589,6 +589,12 @@
if (flush) {
int round = 0;
char flushb[4096-512];
+ uid_t uid = getuid();
+
+ if(uid) {
+ fprintf(stderr, "Not sufficient rights to flush\n");
+ exit(EXIT_FAILURE);
+ }
filter.flushb = flushb;
filter.flushp = 0;
Index: ip/iproute.c
===================================================================
--- ip/iproute.c.orig
+++ ip/iproute.c
@@ -1153,6 +1153,12 @@
int round = 0;
char flushb[4096-512];
time_t start = time(0);
+ uid_t uid = getuid();
+
+ if(uid) {
+ fprintf(stderr, "Not sufficient rights to flush\n");
+ exit(EXIT_FAILURE);
+ }
if (filter.tb == -1) {
if (do_ipv6 != AF_INET6) {