From 9b2dbe00100d4e1077404b9d781f35adad979467 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Thu, 24 May 2018 16:06:03 +0200 Subject: netreport functionality dropped This concept is quite outdated, and not sane to use at all. --- src/Makefile | 10 +------- src/netreport.c | 72 --------------------------------------------------------- 2 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 src/netreport.c (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 193d5af2..8825e45b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -21,7 +21,7 @@ CC = gcc CFLAGS += $(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE -fPIE LDFLAGS += $(RPM_LD_FLAGS) -pie -z relro -z now -PROGS = consoletype genhostid netreport rename_device usernetctl usleep +PROGS = consoletype genhostid rename_device usernetctl usleep all: $(PROGS) @@ -32,7 +32,6 @@ install: all install -m 0755 build/usleep $(DESTDIR)$(bindir) install -m 0755 build/consoletype $(DESTDIR)$(sbindir) install -m 0755 build/genhostid $(DESTDIR)$(sbindir) - install -m 0755 build/netreport $(DESTDIR)$(sbindir) install -m 0755 build/usernetctl $(DESTDIR)$(sbindir) install -m 0755 build/rename_device $(DESTDIR)$(libdir)/udev @@ -53,13 +52,6 @@ build/genhostid.o: genhostid.c $(CC) $(CFLAGS) -c -o $@ $^ -netreport: build/netreport.o - $(CC) $(LDFLAGS) -o build/$@ $^ - -build/netreport.o: netreport.c - $(CC) $(CFLAGS) -c -o $@ $^ - - rename_device: build/rename_device.o $(CC) $(LDFLAGS) -o build/$@ $^ `pkg-config glib-2.0 --libs` diff --git a/src/netreport.c b/src/netreport.c deleted file mode 100644 index 204a77d7..00000000 --- a/src/netreport.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 1997-2002 Red Hat, Inc. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -#include -#include -#include -#include -#include -#include - -/* this will be running setgid root, so be careful! */ - -static void -usage(void) { - fprintf(stderr, "usage: netreport [-r]\n"); - exit(1); -} - -#define ADD 1 -#define DEL 0 -int main(int argc, char ** argv) { - int action = ADD; - /* more than long enough for "/run/netreport/\0" */ - char netreport_name[64]; - int netreport_file; - - if (argc > 2) { - usage(); - } - - if (argc > 1) { - if (argc == 2 && strcmp(argv[1], "-r") == 0) { - action = DEL; - } else { - usage(); - } - } - - snprintf(netreport_name, sizeof(netreport_name), - "/run/netreport/%d", getppid()); - if (action == ADD) { - netreport_file = open(netreport_name, - O_EXCL|O_CREAT|O_WRONLY|O_TRUNC|O_NOFOLLOW, 0); - if (netreport_file == -1) { - if (errno != EEXIST) { - perror("Could not create netreport file"); - exit (1); - } - } else { - close(netreport_file); - } - } else { - /* ignore errors; not much we can do, won't hurt anything */ - unlink(netreport_name); - } - - return 0; -} -- cgit v1.2.1