[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#853845: unblock: ifupdown/0.8.19



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package ifupdown

A bug (#852976) was introduced recently that caused the return value of
"ifquery --state" to be inverted. This is problematic for scripts that
depend on it.

unblock ifupdown/0.8.19

-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (1001, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-2-amd64 (SMP w/12 CPU cores)
Locale: LANG=nl_NL.utf8, LC_CTYPE=nl_NL.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru ifupdown-0.8.18/debian/changelog ifupdown-0.8.19/debian/changelog
--- ifupdown-0.8.18/debian/changelog	2017-01-11 20:43:06.000000000 +0100
+++ ifupdown-0.8.19/debian/changelog	2017-01-30 14:32:18.000000000 +0100
@@ -1,3 +1,9 @@
+ifupdown (0.8.19) unstable; urgency=medium
+
+  * Fix exit code of ifquery --state. Closes: #852976
+
+ -- Guus Sliepen <guus@debian.org>  Mon, 30 Jan 2017 14:32:18 +0100
+
 ifupdown (0.8.18) unstable; urgency=medium
 
   [ Svante Signell ]
diff -Nru ifupdown-0.8.18/main.c ifupdown-0.8.19/main.c
--- ifupdown-0.8.18/main.c	2017-01-11 20:13:27.000000000 +0100
+++ ifupdown-0.8.19/main.c	2017-01-30 14:03:39.000000000 +0100
@@ -587,13 +587,13 @@
 	*argv += optind;
 }
 
-/* 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[]) {
+/* Report the state of interfaces. Return true if all reported interfaces are up, false otherwise */
+static bool do_state(int n_target_ifaces, char *target_iface[]) {
 	char **up_ifaces;
 	int n_up_ifaces;
 
 	read_all_state(&up_ifaces, &n_up_ifaces);
-	int ret = 0;
+	bool all_up = true;
 
 	if (n_target_ifaces == 0) {
 		for (int i = 0; i < n_up_ifaces; i++)
@@ -614,11 +614,11 @@
 			}
 
 			if (!found)
-				ret = 1;
+				all_up = false;
 		}
 	}
 
-	return ret;
+	return all_up;
 }
 
 /* Check non-option arguments and build a list of interfaces to act upon */

Reply to: