Source: ifupdown
Version: 0.8.16
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

Now its time for a new set of patches for ifupdown. They are triggered by the
current FTBFS on GNU/Hurd due to the recent PATH_MAX usage in 0.8.16. It also
seems that version 0.8.15 was never built, since 0.8.16 was uploaded the same
day.

Attached are three patches:
make_clean.diff, reduce_global_vars.diff, hurd_tests.diff

* make_clean.diff removes the ./tests/*/state.* directories in the clean target.
* hurd_tests.diff updates the ifup tests and adds the corresponding ifdown
tests for GNU/Hurd.
* reduce_global_vars.diff avoids the PATH_MAX problem by dynamically assigning
strings to (non-static) variables: statedir, lockfile,  statefile, tmpstatefile
and removes them when no longer needed. These variables are the first global
variables to be replaced with local ones, passed in function argument lists
instead. Additionally the character string: interfaces is localized. 

My local changelog contains the following entries:

ifupdown (0.8.16.1) unstable; urgency=medium
  * Makefile: Add removal of tests/*/state.* directories in the clean target.
  * main.c Reduce the number of global variables by adding function arguments.
  * Fix FTBFS on GNU/Hurd due to PATH_MAX.
  * Update testcases for GNU/Hurd.

All 18 up/down Linux tests have been run in valgrind without any errors.
Additionally all 7 up/down Hurd tests pass (no valgrind available).

(In my opinion more global variables should either be incorporated in the
function argument lists, or moved to the header file header.h/other header
file(s))

Thanks!
Index: ifupdown-0.8.16/Makefile
===================================================================
--- ifupdown-0.8.16.orig/Makefile
+++ ifupdown-0.8.16/Makefile
@@ -34,6 +34,7 @@ clean :
 	rm -f $(patsubst %.defn,%.man,$(DEFNFILES))
 	rm -f ifup ifdown ifquery interfaces.5 ifdown.8 ifquery.8
 	-rm -f ./tests/*/*-res*
+	-rm -r ./tests/*/state.*
 
 distclean : clean
 
Index: ifupdown-0.8.16/config.c
===================================================================
--- ifupdown-0.8.16.orig/config.c
+++ ifupdown-0.8.16/config.c
@@ -860,9 +860,8 @@ static interfaces_file *read_interfaces_
 }
 
 interfaces_file *read_interfaces(const char *filename) {
-	interfaces_file *defn;
 
-	defn = calloc(1, sizeof *defn);
+	interfaces_file *defn = calloc(1, sizeof *defn);
 	if (defn == NULL)
 		return NULL;
 
Index: ifupdown-0.8.16/main.c
===================================================================
--- ifupdown-0.8.16.orig/main.c
+++ ifupdown-0.8.16/main.c
@@ -10,7 +10,6 @@
 #include <fnmatch.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <limits.h>
 
 #include "header.h"
 
@@ -21,12 +20,7 @@ bool verbose = false;
 bool no_loopback = false;
 bool ignore_failures = false;
 
-interfaces_file *defn;
-
-static char statedir[PATH_MAX] = RUN_DIR;
-static char lockfile[PATH_MAX] = RUN_DIR ".ifstate.lock";
-static char statefile[PATH_MAX] = RUN_DIR "ifstate";
-static char tmpstatefile[PATH_MAX] = RUN_DIR ".ifstate.tmp";
+interfaces_file *defn = NULL;
 
 static void usage() {
 	fprintf(stderr, "%s: Use --help for help\n", argv0);
@@ -103,7 +97,7 @@ static int lock_fd(int fd) {
 	return 0;
 }
 
-static FILE *lock_state() {
+static FILE *lock_state(const char *argv0, char *lockfile) {
 	FILE *lock_fp = fopen(lockfile, no_act ? "r" : "a+");
 
 	if (lock_fp == NULL) {
@@ -149,12 +143,14 @@ static void sanitize_file_name(char *nam
       *name = '.';
 }
 
-static bool is_locked(const char *iface) {
-	char filename[sizeof statefile + strlen(iface) + 2];
-	snprintf(filename, sizeof filename, "%s.%s", statefile, iface);
-	sanitize_file_name(filename + sizeof statefile);
+static bool is_locked(const char *iface, char *statefile) {
+	int len = strlen(statefile) + 1 + strlen(iface);
+	char *filename = malloc(len + 1);
+	snprintf(filename, strlen(filename) + 1, "%s.%s", statefile, iface);
+	sanitize_file_name(filename + strlen(statefile));
 
 	FILE *lock_fp = fopen(filename, "r");
+	free(filename);
 
 	if (lock_fp == NULL)
 		return false;
@@ -169,11 +165,12 @@ static bool is_locked(const char *iface)
 	return lock.l_type != F_UNLCK;
 }
 
-static FILE *lock_interface(const char *iface, char **state) {
-	char filename[sizeof statefile + strlen(iface) + 2];
+static FILE *lock_interface(const char *iface, char **state, char *statefile) {
+	int len = strlen(statefile) + 1 + strlen(iface);
+	char *filename = malloc(len + 1);
 	char *siface = strdup(iface);
 	sanitize_file_name(siface);
-	snprintf(filename, sizeof filename, "%s.%s", statefile, siface);
+	snprintf(filename, len + 1, "%s.%s", statefile, siface);
 	free(siface);
 
 	FILE *lock_fp = fopen(filename, no_act ? "r" : "a+");
@@ -181,8 +178,10 @@ static FILE *lock_interface(const char *
 	if (lock_fp == NULL) {
 		if (!no_act) {
 			fprintf(stderr, "%s: failed to open lockfile %s: %s\n", argv0, filename, strerror(errno));
+			free(filename);
 			exit(1);
 		} else {
+			free(filename);
 			return NULL;
 		}
 	}
@@ -191,6 +190,7 @@ static FILE *lock_interface(const char *
 
 	if (flags < 0 || fcntl(fileno(lock_fp), F_SETFD, flags | FD_CLOEXEC) < 0) {
 		fprintf(stderr, "%s: failed to set FD_CLOEXEC on lockfile %s: %s\n", argv0, filename, strerror(errno));
+		free(filename);
 		exit(1);
 	}
 
@@ -202,11 +202,13 @@ static FILE *lock_interface(const char *
 			if (fcntl(fileno(lock_fp), F_SETLKW, &lock) < 0) {
 				if (!no_act) {
 					fprintf(stderr, "%s: failed to lock lockfile %s: %s\n", argv0, filename, strerror(errno));
+					free(filename);
 					exit(1);
 				}
 			}
 		} else if (!no_act) {
 			fprintf(stderr, "%s: failed to lock lockfile %s: %s\n", argv0, filename, strerror(errno));
+			free(filename);
 			exit(1);
 		}
 	}
@@ -222,11 +224,12 @@ static FILE *lock_interface(const char *
 		}
 	}
 
+	free(filename);
 	return lock_fp;
 }
 
-static void read_all_state(char ***ifaces, int *n_ifaces) {
-	FILE *lock_fp = lock_state(argv0);
+static void read_all_state(char ***ifaces, int *n_ifaces, char *statefile, char *lockfile) {
+	FILE *lock_fp = lock_state(argv0, lockfile);
 	FILE *state_fp = fopen(statefile, no_act ? "r" : "a+");
 
 	*n_ifaces = 0;
@@ -274,7 +277,8 @@ static void read_all_state(char ***iface
 		fclose(lock_fp);
 }
 
-static void update_state(const char *iface, const char *state, FILE *lock_fp) {
+static void update_state(const char *iface, const char *state, FILE *lock_fp, char *lockfile, char *statefile, char *tmpstatefile) {
+
 	if (lock_fp && !no_act) {
 		rewind(lock_fp);
 		if(ftruncate(fileno(lock_fp), 0) == -1) {
@@ -285,7 +289,7 @@ static void update_state(const char *ifa
 		fflush(lock_fp);
 	}
 
-	lock_fp = lock_state(argv0);
+	lock_fp = lock_state(argv0, lockfile);
 	FILE *state_fp = fopen(statefile, no_act ? "r" : "a+");
 
 	if (state_fp == NULL) {
@@ -427,7 +431,6 @@ static bool force = false;
 static bool list = false;
 static bool state_query = false;
 static char *allow_class = NULL;
-static char *interfaces = "/etc/network/interfaces";
 char **no_auto_down_int = NULL;
 int no_auto_down_ints = 0;
 char **no_scripts_int = NULL;
@@ -465,7 +468,7 @@ static void parse_environment_variables(
 	}
 }
 
-static void parse_options(int *argc, char **argv[]) {
+static void parse_options(int *argc, char **argv[], char **statedir, char **interfaces) {
 	static const struct option long_opts[] = {
 		{"help", no_argument, NULL, 'h'},
 		{"version", no_argument, NULL, 'V'},
@@ -496,7 +499,7 @@ static void parse_options(int *argc, cha
 
 		switch (c) {
 		case 'i':
-			interfaces = strdup(optarg);
+			*interfaces = strdup(optarg);
 			break;
 
 		case 'v':
@@ -599,11 +602,8 @@ static void parse_options(int *argc, cha
 			parse_environment_variables();
 			break;
 
-		case 9:
-			snprintf(statedir, sizeof statedir, "%s", optarg);
-			snprintf(statefile, sizeof statefile, "%s/ifstate", optarg);
-			snprintf(tmpstatefile, sizeof tmpstatefile, "%s/.ifstate.tmp", optarg);
-			snprintf(lockfile, sizeof lockfile, "%s/.ifstate.lock", optarg);
+		case 9: /* --state-dir */
+			*statedir = strdup(optarg);
 			break;
 
 		default:
@@ -617,11 +617,11 @@ static void parse_options(int *argc, cha
 }
 
 /* Report the state of interfaces. Return 0 (success) if all reported interfaces are up, 1 (failure) otherwise */
-static int do_state(int n_target_ifaces, char *target_iface[]) {
+static int do_state(int n_target_ifaces, char *target_iface[], char *statefile, char *lockfile) {
 	char **up_ifaces;
 	int n_up_ifaces;
 
-	read_all_state(&up_ifaces, &n_up_ifaces);
+	read_all_state(&up_ifaces, &n_up_ifaces, statefile, lockfile);
 	int ret = 0;
 
 	if (n_target_ifaces == 0) {
@@ -651,7 +651,7 @@ static int do_state(int n_target_ifaces,
 }
 
 /* Check non-option arguments and build a list of interfaces to act upon */
-static void select_interfaces(int argc, char *argv[]) {
+static void select_interfaces(int argc, char *argv[], char *statefile, char *interfaces, char *lockfile, interfaces_file **defn) {
 	if (argc > 0 && (do_all || list)) {
 		fprintf(stderr, "%s: either use the --all/--list options, or specify interface(s), but not both\n", argv0);
 		usage();
@@ -665,21 +665,21 @@ static void select_interfaces(int argc,
 	if (do_all && (cmds == iface_query))
 		usage();
 
-	defn = read_interfaces(interfaces);
+	*defn = read_interfaces(interfaces);
 
-	if (!defn) {
+	if (!*defn) {
 		fprintf(stderr, "%s: couldn't read interfaces file \"%s\"\n", argv0, interfaces);
 		exit(1);
 	}
 
 	if (do_all || list) {
 		if ((cmds == iface_list) || (cmds == iface_up)) {
-			allowup_defn *autos = find_allowup(defn, allow_class ? allow_class : "auto");
+			allowup_defn *autos = find_allowup(*defn, allow_class ? allow_class : "auto");
 
 			target_iface = autos ? autos->interfaces : NULL;
 			n_target_ifaces = autos ? autos->n_interfaces : 0;
 		} else if (cmds == iface_down) {
-			read_all_state(&target_iface, &n_target_ifaces);
+		  read_all_state(&target_iface, &n_target_ifaces, statefile, lockfile);
 		} else {
 			fprintf(stderr, "%s: can't tell if interfaces are going up or down\n", argv0);
 			usage();
@@ -746,7 +746,7 @@ bool match_patterns(const char *string,
 }
 
 /* Check whether we should ignore the given interface */
-static bool ignore_interface(const char *iface) {
+static bool ignore_interface(const char *iface, interfaces_file *defn) {
 	/* If --allow is used, ignore interfaces that are not in the given class */
 	if (allow_class != NULL) {
 		allowup_defn *allowup = find_allowup(defn, allow_class);
@@ -781,7 +781,7 @@ static bool ignore_interface(const char
 }
 
 
-static bool do_interface(const char *target_iface) {
+static bool do_interface(const char *target_iface, char *statefile, char *tmpstatefile, char *lockfile, interfaces_file *defn) {
 	/* Split into physical and logical interface */
 
 	char iface[80], liface[80];
@@ -802,7 +802,7 @@ static bool do_interface(const char *tar
 
 	/* Check if we really want to process this interface */
 
-	if(ignore_interface(iface))
+	if(ignore_interface(iface, defn))
 		return true;
 
 	/* Check if this interface exists */
@@ -828,11 +828,14 @@ static bool do_interface(const char *tar
 	}
 
 	if (cmds != iface_up) {
-		char filename[sizeof statefile + strlen(iface) + 2];
-		snprintf(filename, sizeof filename, "%s.%s", statefile, iface);
-		sanitize_file_name(filename + sizeof statefile);
+		int len = strlen(statefile) + 1 + strlen(iface);
+		char *filename = malloc(len + 1);
+		snprintf(filename, len + 1, "%s.%s", statefile, iface);
+		sanitize_file_name(filename + strlen(statefile));
+
 		if (access(filename, R_OK) == 0)
 			found = true;
+		free(filename);
 	}
 
 	if (!found) {
@@ -849,7 +852,7 @@ static bool do_interface(const char *tar
 	snprintf(envname, sizeof envname, "IFUPDOWN_%s", siface);
 	free(siface);
 	char *envval = getenv(envname);
-	if(envval && is_locked(iface)) {
+	if(envval && is_locked(iface, statefile)) {
 		fprintf(stderr, "%s: recursion detected for interface %s in %s phase\n", argv0, iface, envval);
 		return false;
 	}
@@ -863,12 +866,12 @@ static bool do_interface(const char *tar
 		*pch = '\0';
 		snprintf(envname, sizeof envname, "IFUPDOWN_%s", piface);
 		char *envval = getenv(envname);
-		if(envval && is_locked(piface)) {
+		if(envval && is_locked(piface, statefile)) {
 			fprintf(stderr, "%s: recursion detected for parent interface %s in %s phase\n", argv0, piface, envval);
 			return false;
 		}
 
-		plock = lock_interface(piface, NULL);
+		plock = lock_interface(piface, NULL, statefile);
 	}
 
 	/* Start by locking this interface */
@@ -877,7 +880,7 @@ static bool do_interface(const char *tar
 	FILE *lock = NULL;
 	char *current_state = NULL;
 
-	lock = lock_interface(iface, &current_state);
+	lock = lock_interface(iface, &current_state, statefile);
 
 	/* If we are not forcing the command, then exit with success if it is a no-op */
 
@@ -947,9 +950,9 @@ static bool do_interface(const char *tar
 	/* Update the state file already? */
 
 	if (cmds == iface_up) {
-		update_state(iface, liface, lock);
+		update_state(iface, liface, lock, lockfile, statefile, tmpstatefile);
 	} else if (cmds == iface_down) {
-		update_state(iface, NULL, lock);
+		update_state(iface, NULL, lock, lockfile, statefile, tmpstatefile);
 	} else  {
 		assert(cmds == iface_list ||cmds == iface_query);
 	}
@@ -1157,22 +1160,22 @@ static bool do_interface(const char *tar
 
 	if (!okay && !force) {
 		fprintf(stderr, "Ignoring unknown interface %s=%s.\n", iface, liface);
-		update_state(iface, NULL, lock);
+		update_state(iface, NULL, lock, lockfile, statefile, tmpstatefile);
 	} else {
 		if (cmds == iface_up) {
 			if ((current_state == NULL) || (no_act)) {
 				if (failed == true) {
 					printf("Failed to bring up %s.\n", liface);
-					update_state(iface, NULL, lock);
+					update_state(iface, NULL, lock, lockfile, statefile, tmpstatefile);
 					goto end;
 				} else {
-					update_state(iface, liface, lock);
+					update_state(iface, liface, lock, lockfile, statefile, tmpstatefile);
 				}
 			} else {
-				update_state(iface, liface, lock);
+				update_state(iface, liface, lock, lockfile, statefile, tmpstatefile);
 			}
 		} else if (cmds == iface_down) {
-			update_state(iface, NULL, lock);
+			update_state(iface, NULL, lock, lockfile, statefile, tmpstatefile);
 		} else {
 			assert(cmds == iface_list ||cmds == iface_query);
 		}
@@ -1191,20 +1194,51 @@ end:
 }
 
 int main(int argc, char *argv[]) {
+
+	char *statedir = strdup(RUN_DIR), *statedir1 = NULL;
+	char *lockfile = strdup(RUN_DIR ".ifstate.lock");
+	char *statefile = strdup(RUN_DIR "ifstate");
+	char *tmpstatefile = strdup(RUN_DIR ".ifstate.tmp");
+	char *interfaces = "/etc/network/interfaces", *interfaces1 = NULL;
+
 	argv0 = argv[0];
 
 	check_stdio();
 
 	cmds = determine_command();
 
-	parse_options(&argc, &argv);
-
+	parse_options(&argc, &argv, &statedir1, &interfaces1);
+	if (statedir1 != NULL) {
+		int len1 = strlen(statedir1) + 1;
+		statedir = realloc(statedir, len1 + 1);
+		snprintf(statedir, len1 + 1, "%s%s", statedir1, "/");
+		free(statedir1);
+
+		char *str2 = ".ifstate.lock";
+		int len2 = strlen(str2);
+		lockfile = realloc(lockfile, len1 + len2 + 1);
+		snprintf(lockfile, len1 + len2 + 1, "%s%s", statedir, str2);
+
+		char *str3 = "ifstate";
+		int len3 = strlen(str3);
+		statefile = realloc(statefile, len1 + len3 + 1);
+		snprintf(statefile, len1 + len3 + 1, "%s%s", statedir, str3);
+
+		char *str4 = ".ifstate.tmp";
+		int len4 = strlen(str4);
+		tmpstatefile = realloc(tmpstatefile, len1 + len4 + 1);
+		snprintf(tmpstatefile, len1 + len4 + 1, "%s%s", statedir, str4);
+	}
 	mkdir(statedir, 0755);
 
 	if (state_query)
-		return do_state(argc, argv);
+		return do_state(argc, argv, statefile, lockfile);
 
-	select_interfaces(argc, argv);
+	if (interfaces1 != NULL) {
+		interfaces = interfaces1;
+	}
+
+	select_interfaces(argc, argv, statefile, interfaces, lockfile, &defn);
 
 	if (do_all)
 		do_pre_all();
@@ -1212,10 +1246,16 @@ int main(int argc, char *argv[]) {
 	bool success = true;
 
 	for (int i = 0; i < n_target_ifaces; i++)
-		success &= do_interface(target_iface[i]);
+		success &= do_interface(target_iface[i], statefile, tmpstatefile, lockfile, defn);
 
 	if (do_all)
 		do_post_all();
 
+	free(statedir);
+	free(lockfile);
+	free(statefile);
+	free(tmpstatefile);
+	free(interfaces);
+
 	return success ? 0 : 1;
 }
Index: ifupdown-0.8.16/tests/hurd/down.1
===================================================================
--- /dev/null
+++ ifupdown-0.8.16/tests/hurd/down.1
@@ -0,0 +1,5 @@
+exit code: 0
+====stdout====
+====stderr====
+/bin/run-parts --verbose /etc/network/if-down.d
+/bin/run-parts --verbose /etc/network/if-post-down.d
Index: ifupdown-0.8.16/tests/hurd/down.11
===================================================================
--- /dev/null
+++ ifupdown-0.8.16/tests/hurd/down.11
@@ -0,0 +1,5 @@
+exit code: 0
+====stdout====
+====stderr====
+/bin/run-parts --verbose /etc/network/if-down.d
+/bin/run-parts --verbose /etc/network/if-post-down.d
Index: ifupdown-0.8.16/tests/hurd/down.2
===================================================================
--- /dev/null
+++ ifupdown-0.8.16/tests/hurd/down.2
@@ -0,0 +1,5 @@
+exit code: 0
+====stdout====
+====stderr====
+/bin/run-parts --verbose /etc/network/if-down.d
+/bin/run-parts --verbose /etc/network/if-post-down.d
Index: ifupdown-0.8.16/tests/hurd/down.3
===================================================================
--- /dev/null
+++ ifupdown-0.8.16/tests/hurd/down.3
@@ -0,0 +1,5 @@
+exit code: 0
+====stdout====
+====stderr====
+/bin/run-parts --verbose /etc/network/if-down.d
+/bin/run-parts --verbose /etc/network/if-post-down.d
Index: ifupdown-0.8.16/tests/hurd/down.4
===================================================================
--- /dev/null
+++ ifupdown-0.8.16/tests/hurd/down.4
@@ -0,0 +1,7 @@
+exit code: 0
+====stdout====
+====stderr====
+Configuring interface /dev/eth0=work (inet)
+/bin/run-parts --verbose /etc/network/if-down.d
+inetutils-ifconfig --interface /dev/eth0 --down
+/bin/run-parts --verbose /etc/network/if-post-down.d
Index: ifupdown-0.8.16/tests/hurd/down.5
===================================================================
--- /dev/null
+++ ifupdown-0.8.16/tests/hurd/down.5
@@ -0,0 +1,5 @@
+exit code: 0
+====stdout====
+====stderr====
+/bin/run-parts --verbose /etc/network/if-down.d
+/bin/run-parts --verbose /etc/network/if-post-down.d
Index: ifupdown-0.8.16/tests/hurd/down.6
===================================================================
--- /dev/null
+++ ifupdown-0.8.16/tests/hurd/down.6
@@ -0,0 +1,5 @@
+exit code: 0
+====stdout====
+====stderr====
+/bin/run-parts --verbose /etc/network/if-down.d
+/bin/run-parts --verbose /etc/network/if-post-down.d
Index: ifupdown-0.8.16/tests/hurd/up.1
===================================================================
--- ifupdown-0.8.16.orig/tests/hurd/up.1
+++ ifupdown-0.8.16/tests/hurd/up.1
@@ -1,6 +1,11 @@
+exit code: 0
 ====stdout====
 ====stderr====
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+inetutils-ifconfig --interface lo --address 127.0.0.1 --up
+Configuring interface lo=lo (inet)
+/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
 Configuring interface /dev/eth0=/dev/eth0 (inet)
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
 
Index: ifupdown-0.8.16/tests/hurd/up.11
===================================================================
--- ifupdown-0.8.16.orig/tests/hurd/up.11
+++ ifupdown-0.8.16/tests/hurd/up.11
@@ -1,3 +1,4 @@
+exit code: 0
 ====stdout====
 ====stderr====
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
Index: ifupdown-0.8.16/tests/hurd/up.2
===================================================================
--- ifupdown-0.8.16.orig/tests/hurd/up.2
+++ ifupdown-0.8.16/tests/hurd/up.2
@@ -1,22 +1,27 @@
+exit code: 0
 ====stdout====
 ====stderr====
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+inetutils-ifconfig --interface lo --address 127.0.0.1 --up
+Configuring interface lo=lo (inet)
+/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
 Configuring interface /dev/eth0=/dev/eth0 (inet)
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
 
-inetutils-ifconfig --interface /dev/eth0 --address 1.2.3.4 --netmask 255.255.255.0           --up
+inetutils-ifconfig --interface /dev/eth0 --address 1.2.3.4 --netmask 255.255.255.0       --up
 
 /bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
 Configuring interface /dev/eth1=/dev/eth1 (inet)
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
 
-inetutils-ifconfig --interface /dev/eth1 --address 1.3.4.5 --netmask 255.255.255.0           --up
+inetutils-ifconfig --interface /dev/eth1 --address 1.3.4.5 --netmask 255.255.255.0       --up
 
 /bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
 Configuring interface /dev/eth2=/dev/eth2 (inet)
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
 
-inetutils-ifconfig --interface /dev/eth2 --address 1.4.5.6 --netmask 255.255.255.0           --up
+inetutils-ifconfig --interface /dev/eth2 --address 1.4.5.6 --netmask 255.255.255.0       --up
 
 /bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
 /bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
Index: ifupdown-0.8.16/tests/hurd/up.3
===================================================================
--- ifupdown-0.8.16.orig/tests/hurd/up.3
+++ ifupdown-0.8.16/tests/hurd/up.3
@@ -1,6 +1,11 @@
+exit code: 0
 ====stdout====
 ====stderr====
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+inetutils-ifconfig --interface lo --address 127.0.0.1 --up
+Configuring interface lo=lo (inet)
+/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
 Configuring interface /dev/eth0=/dev/eth0 (inet)
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
 
Index: ifupdown-0.8.16/tests/hurd/up.4
===================================================================
--- ifupdown-0.8.16.orig/tests/hurd/up.4
+++ ifupdown-0.8.16/tests/hurd/up.4
@@ -1,3 +1,4 @@
+exit code: 0
 ====stdout====
 ====stderr====
 Configuring interface /dev/eth0=work (inet)
Index: ifupdown-0.8.16/tests/hurd/up.5
===================================================================
--- ifupdown-0.8.16.orig/tests/hurd/up.5
+++ ifupdown-0.8.16/tests/hurd/up.5
@@ -1,6 +1,11 @@
+exit code: 0
 ====stdout====
 ====stderr====
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+inetutils-ifconfig --interface lo --address 127.0.0.1 --up
+Configuring interface lo=lo (inet)
+/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
 Configuring interface /dev/eth0=/dev/eth0 (inet)
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
 Warning: Option hwaddress: 00:DE:AD:00:BE:AF not yet supported
Index: ifupdown-0.8.16/tests/hurd/up.6
===================================================================
--- ifupdown-0.8.16.orig/tests/hurd/up.6
+++ ifupdown-0.8.16/tests/hurd/up.6
@@ -1,6 +1,11 @@
+exit code: 0
 ====stdout====
 ====stderr====
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+inetutils-ifconfig --interface lo --address 127.0.0.1 --up
+Configuring interface lo=lo (inet)
+/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
 Configuring interface /dev/eth0=/dev/eth0 (inet)
 /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
 Warning: Option hwaddress: 00:DE:AD:00:BE:AF not yet supported

Reply via email to