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

Bug#774595: unblock: ifupdown/0.7.52



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

Please unblock package ifupdown.

This upload fixes a segfault introduced few uploads before,
see #774212 for details.

unblock ifupdown/0.7.52

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.12-1-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/mksh
diff -Nru ifupdown-0.7.51/config.c ifupdown-0.7.52/config.c
--- ifupdown-0.7.51/config.c	2014-11-29 13:53:44.000000000 +0100
+++ ifupdown-0.7.52/config.c	2015-01-02 21:35:33.000000000 +0100
@@ -135,6 +135,10 @@
 
     defn = read_interfaces_defn(defn, filename);
 
+    if (!defn) {
+        return NULL;
+    }
+
     if (!no_loopback) {
         interface_defn *lo_if = malloc(sizeof(interface_defn));
         if (!lo_if) {
@@ -187,8 +191,10 @@
     char *rest;
 
     f = fopen(filename, "r");
-    if (f == NULL)
-        return NULL;
+    if (f == NULL) {
+        fprintf(stderr, "warning: couldn't open interfaces file \"%s\"\n", filename);
+        return defn;
+    }
     line = 0;
 
     while (get_line(&buf, &buf_len, f, &line)) {
diff -Nru ifupdown-0.7.51/debian/changelog ifupdown-0.7.52/debian/changelog
--- ifupdown-0.7.51/debian/changelog	2014-12-14 15:02:30.000000000 +0100
+++ ifupdown-0.7.52/debian/changelog	2015-01-04 15:28:53.000000000 +0100
@@ -1,3 +1,10 @@
+ifupdown (0.7.52) unstable; urgency=medium
+
+  * Fix segfault when /e/n/i can't be read. Fail only when the file
+    has errors, issue a warning when it can't be opened (Closes: #774212).
+
+ -- Andrew Shadura <andrewsh@debian.org>  Sun, 04 Jan 2015 15:21:25 +0100
+
 ifupdown (0.7.51) unstable; urgency=medium
 
   [ Michael Biebl ]
diff -Nru ifupdown-0.7.51/debian/testbuild-linux ifupdown-0.7.52/debian/testbuild-linux
--- ifupdown-0.7.51/debian/testbuild-linux	2014-11-29 14:05:16.000000000 +0100
+++ ifupdown-0.7.52/debian/testbuild-linux	2015-01-02 21:39:39.000000000 +0100
@@ -515,6 +515,7 @@
 ====stderr====
 Parsing file /dev/null
 Parsing file tests/null
+warning: couldn't open interfaces file "tests/null"
 run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
 run-parts --exit-on-error --verbose /etc/network/if-up.d
 EOF
@@ -548,6 +549,32 @@
 run-parts --exit-on-error --verbose /etc/network/if-up.d
 EOF
 
+cat >tests/testcase.12 <<EOF
+auto lo eth0
+
+iface
+EOF
+cat >tests/up.12 <<EOF
+====stdout====
+====stderr====
+tests/testcase.12:3: too few parameters for iface line
+./ifup: couldn't read interfaces file "tests/testcase.12"
+EOF
+
+# don't create the input file for this testcase
+# cat >tests/testcase.13
+cat >tests/up.13 <<EOF
+====stdout====
+====stderr====
+warning: couldn't open interfaces file "tests/testcase.13"
+run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+ip link set up dev lo 2>/dev/null
+Configuring interface lo=lo (inet)
+run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+run-parts --exit-on-error --verbose /etc/network/if-up.d
+run-parts --exit-on-error --verbose /etc/network/if-up.d
+EOF
+
 result=true
 for test in 1 2 3 4 5 6 7 8 9 10; do
         args="$(cat tests/testcase.$test | sed -n 's/^# RUN: //p')"
@@ -568,8 +595,8 @@
         echo "=========="
 done
 
-for test in 11; do
-        args="$(cat tests/testcase.$test | sed -n 's/^# RUN: //p')"
+for test in 11 12 13; do
+        args="-a"
         ./ifup -nv --force -i tests/testcase.$test $args \
                 >tests/up-res-out.$test 2>tests/up-res-err.$test || 
                 true

Reply to: