--- ifupdown-scripts-zg2-0.3.orig/scripts/ifupdown-scripts-zg2.d/vlan +++ ifupdown-scripts-zg2-0.3/scripts/ifupdown-scripts-zg2.d/vlan @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # $Header$ # Environment: --- ifupdown-scripts-zg2-0.3.orig/scripts/ifupdown-scripts-zg2.d/common-functions +++ ifupdown-scripts-zg2-0.3/scripts/ifupdown-scripts-zg2.d/common-functions @@ -1,6 +1,8 @@ #!/bin/bash # $Header$ +export LC_ALL=C + # set global vars, make statefile existent, and do basic sanity checks VERBOSE=${IF_VERBOSE:-} @@ -349,11 +351,16 @@ # it is possible that /usr is not yet mounted, we try to get by without /usr PATH="/sbin:/bin" -STATEDIR="/etc/network/run/ifupdown-scripts-zg2" +NWSTATE="/etc/network/run" +STATEDIR="$NWSTATE/ifupdown-scripts-zg2" STATEFILE="$STATEDIR/$IFACE.state" -# we assume that $STATEDIR's parents were created in a secure manner and -# that noone but root can write there +# check that noone but root can write to $NWSTATE + +if ! ls -nd $(readlink --canonicalize "$NWSTATE") | grep -q -- '^d....-..-. [[:digit:]]\+ 0 0 '; then + abort "$NWSTATE is not (or does not point to) a directory, or is writeable by non-root user" +fi + if ! [ -e "$STATEFILE" ]; then umask 022 if ! mkdir -p $STATEDIR; then --- ifupdown-scripts-zg2-0.3.orig/debian/control +++ ifupdown-scripts-zg2-0.3/debian/control @@ -1,7 +1,8 @@ Source: ifupdown-scripts-zg2 Section: net Priority: optional -Maintainer: Marc Haber +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Marc Haber Build-Depends: cdbs, debhelper (>= 7), automake Standards-Version: 3.8.1 Homepage: http://ftp.debian.org/debian/pool/main/i/ifupdown-scripts-zg2/ @@ -9,6 +10,7 @@ Package: ifupdown-scripts-zg2 Architecture: all Depends: ${misc:Depends}, ifupdown (>= 0.6.7), iproute, debianutils (>= 1.6) +Suggests: vlan Provides: ifupdown-scripts Description: Zugschlus' interface scripts for ifupdown's manual method This package contains a set of scripts that are called by ifupdown. --- ifupdown-scripts-zg2-0.3.orig/debian/ifupdown-scripts-zg2.dirs +++ ifupdown-scripts-zg2-0.3/debian/ifupdown-scripts-zg2.dirs @@ -1 +0,0 @@ -/var/lib/ifupdown-scripts-zg2 --- ifupdown-scripts-zg2-0.3.orig/debian/changelog +++ ifupdown-scripts-zg2-0.3/debian/changelog @@ -1,3 +1,52 @@ +ifupdown-scripts-zg2 (0.3-4.1ubuntu1) natty; urgency=low + + * Merge from debian unstable. Remaining changes: + - remove /var/lib/ifupdown-scripts-zg2 from debian/ifupdown-scripts-zg2.dirs + The file can't actually be removed as it is in the original tarball. + ( LP: #484131 ) + + -- Bhavani Shankar Sat, 04 Dec 2010 00:27:44 +0530 + +ifupdown-scripts-zg2 (0.3-4.1) unstable; urgency=low + + * Non-maintainer upload. + * Use bash for ifupdown-scripts-zg2.d/vlan too. Thanks to Joerg Friedrich. + Closes: #605232 + + -- Didier Raboud Mon, 29 Nov 2010 11:33:31 +0100 + +ifupdown-scripts-zg2 (0.3-4ubuntu1) lucid; urgency=low + + * remove /var/lib/ifupdown-scripts-zg2 from debian/ifupdown-scripts-zg2.dirs + The file can't actually be removed as it is in the original tarball. + ( LP: #484131 ) + + -- SevenMachines Thu, 19 Nov 2009 10:37:16 +0000 + +ifupdown-scripts-zg2 (0.3-4) unstable; urgency=low + + * remove debian/ifupdown-scripts-zg2.dirs which still created + /var/lib/ifupown-scripts-zg2. Thanks to Mika Prokop. Closes: #530640 + + -- Marc Haber Sun, 31 May 2009 09:02:44 +0200 + +ifupdown-scripts-zg2 (0.3-3) unstable; urgency=low + + * fix bug in migration code: make sure that + /etc/network/run/ifupdown-scripts-zg2 aktually exists before we move + files there. Thanks to Andras Barth. Closes: #529887 + + -- Marc Haber Fri, 22 May 2009 20:26:32 +0200 + +ifupdown-scripts-zg2 (0.3-2) unstable; urgency=low + + * move statedir check from postinst to avoid ifupdown pre-depends. + Thanks to Mika Prokop. + * do statedir check without /usr. + * add vlan to Suggests: + + -- Marc Haber Sat, 25 Apr 2009 08:12:50 +0200 + ifupdown-scripts-zg2 (0.3-1) unstable; urgency=low * move ATM support to examples, I do not use ATM any more and cannot @@ -153,3 +202,4 @@ * Initial Version. -- Marc Haber Fri, 23 Aug 2002 14:36:25 +0000 + --- ifupdown-scripts-zg2-0.3.orig/debian/ifupdown-scripts-zg2.postinst +++ ifupdown-scripts-zg2-0.3/debian/ifupdown-scripts-zg2.postinst @@ -5,29 +5,21 @@ [ -n "$IUDSZG2DEBUG" ] && set -x STATEPDIR="/etc/network/run" -STATEDIR="$STATEDIR/ifupdown-scripts-zg2" +STATEDIR="$STATEPDIR/ifupdown-scripts-zg2" OLDSTATEDIR="/var/lib/ifupdown-scripts-zg2" if [ "$1" = "configure" ]; then update-ifupdown-scripts-zg2.d-symlinks - # we should be doing this check in the scripts themselves, but - # since they might run early, we can't. So at least do it here. - if [ "$STATEPDIR/" != "$(find $STATEPDIR/ -mindepth 0 -maxdepth 0 -type d -and -user root -and -group root -and -not -perm +0022)" ]; then - echo >&2 "ERR: $STATEPDIR isn't a directory, or is writeable by non-root user" - exit 1 - fi - umask 022 - if ! mkdir -p $STATEDIR; then - echo >&2 "ERR: could not mkdir $STATEDIR" - exit 1 - fi - if [ "$STATEDIR/" != "$(find $STATEDIR/ -mindepth 0 -maxdepth 0 -type d -and -user root -and -group root -and -not -perm +0022)" ]; then - echo >&2 "ERR: $STATEDIR isn't a directory, or is writeable by non-root user" - exit 1 - fi if [ -d "$OLDSTATEDIR" ]; then # OLDSTATEDIR stll exists, migrate state files from there + if ! [ -d "$STATEPDIR" ]; then + echo >&2 "ERR: missing $STATEPDIR. Is ifupdown configured?" + exit 1 + fi + + [ -d "$STATEDIR" ] || mkdir -m 755 "$STATEDIR" + for file in $(ls ${OLDSTATEDIR}/*.state 2>/dev/null); do if ! [ -e "$STATEDIR/$(basename $file)" ]; then mv "$file" "$STATEDIR/$(basename $file)" @@ -41,7 +33,7 @@ echo >&2 "ERR: $OLDSTATEDIR not empty." exit 1 fi - rmdir $OLDSTATEDIR + rmdir "$OLDSTATEDIR" fi fi