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

Bug#683771: marked as done (unblock: openvswitch/1.4.2+git20120612-8 (with an alternative))



Your message dated Tue, 04 Sep 2012 18:51:13 +0200
with message-id <50463181.50808@dogguy.org>
and subject line Re: Bug#683771: unblock: openvswitch/1.4.2+git20120612-8 (with an alternative)
has caused the Debian Bug report #683771,
regarding unblock: openvswitch/1.4.2+git20120612-8 (with an alternative)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
683771: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683771
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
User: release.debian.org@packages.debian.org
Usertags: unblock
Severity: normal

openvswitch 1.4.2+git20120612-2 is currently in wheezy.
openvswitch 1.4.2+git20120612-8, currently in sid, fixes the following
release-critical bugs:

        #680536 openvswitch - Fails to start without /etc/protocols
        #680537 openvswitch - Plays with iptables without consent
        #681880 openvswitch-switch - Automatic changed file in /etc/
        #681955 openvswitch-switch - Enabling brcompat breaks normal
           operation
        #682187 openvswitch-controller: unowned files after purge
           (policy 6.8, 10.8)
        #682384 odd s390 build failure for openvswitch
        #683665 openvswitch-pki: creates world writable directories:
           /var/lib/openvswitch/pki/*ca/incoming/

The changes for each of these is simple and straightforward, except
for #681880.  The changes for bug #681880 are much more extensive,
because they required a configuration file and its lockfile to move
from /etc/openvswitch to /var/lib/openvswitch for full technical
compliance with the Filesystem Hierarchy Standard.  We had to leave
symlinks behind for compatibility with external software that expects
to see that configuration file in its original location.

The Open vSwitch software wasn't really prepared for such a move,
especially since there are other files in /etc/openvswitch that must
*not* move due to other requirements in Debian policy.  The result is
that, although the new package works in what experience we have with
it so far, we have a lot less confidence in it than we did in the
previous version.

So, I have two alternatives to propose and I request that you please
choose one of them (or propose a third):

        1. Unblock 1.4.2+git20120612-8 to enter wheezy from unstable.
           We'll fix any fallout from the /etc -> /var configuration
           file move as it becomes reported during the transition.

        2. Reopen #681880 and mark it wheezy-ignore, and then allow us
           to upload a package that fixes all of the above
           release-critical bugs, except #681880, to
           testing-proposed-updates.

In either case, we'll have #681880 fixed for wheezy+1 (we are
currently working through it on the Open vSwitch master branch), but
I'll have greater confidence in the software's quality if we go with
#2.

(Note that upstream Open vSwitch is currently working on freezing
version 1.8.  The version 1.4 that is in wheezy is a specially frozen
"long term stable" release that we'd prefer not to destabilize.)

Thanks,

Ben.

P.S. I'm attaching a debdiff between the wheezy and sid versions.
I've omitted debian-changes-1.4.2+git20120612-8 from the debdiff
because it contains only changes in automatically generated files
(e.g. "configure").  Most of the debdiff consists of the
bug-681880-*.patch changes, which would disappear if we were to choose
alternative #2 above.  Here's the diffstat, which should make that
obvious:

 automake.mk                                                  |    2 
 changelog                                                    |   89 ++
 control                                                      |    2 
 openvswitch-controller.postrm                                |   44 +
 openvswitch-pki.postinst                                     |    7 
 openvswitch-switch.dirs                                      |    1 
 openvswitch-switch.init                                      |    2 
 openvswitch-switch.postinst                                  |   15 
 openvswitch-switch.postrm                                    |    6 
 openvswitch-switch.prerm                                     |   50 +
 patches/bug-681880-1-lockfile-Fix...a-dangling-symlink.patch |  158 +++++
 patches/bug-681880-2-ovsdb-Make-o...through-a-dangling.patch |   45 +
 patches/bug-681880-3-Make-the-loc...separately-configu.patch |  307 ++++++++++
 patches/bug-681880-4-tests-Slight...function-tests.patch     |  123 ++++
 patches/bug-681880-5-util-New-fun...patch                    |  265 ++++++++
 patches/bug-681880-6-lockfile-Be-...ockfiles-for-symli.patch |  120 +++
 patches/bug-681880-7-ovsdb-Do-not...egular-files-durin.patch |  159 +++++
 patches/bug-681880-8-Fix-a-typo-i...ch                       |   24 
 patches/bug-681880-9-dirs-dbdir-d...n-sysconfdir.patch       |  179 +++++
 patches/bug-681955-ovs-ctl-Start-...ch.patch                 |   37 +
 patches/bug-683665-use-mode-700-f...tch                      |   38 +
 patches/debian-changes-1.4.2+git20120612-6                   |   83 ++
 patches/series                                               |   16 
 rules                                                        |    1 
 24 files changed, 1768 insertions(+), 5 deletions(-)

diff -Nru openvswitch-1.4.2+git20120612/debian/automake.mk openvswitch-1.4.2+git20120612/debian/automake.mk
--- openvswitch-1.4.2+git20120612/debian/automake.mk	2012-06-12 10:17:04.000000000 -0700
+++ openvswitch-1.4.2+git20120612/debian/automake.mk	2012-07-27 11:26:18.000000000 -0700
@@ -21,6 +21,7 @@
 	debian/openvswitch-controller.install \
 	debian/openvswitch-controller.manpages \
 	debian/openvswitch-controller.postinst \
+	debian/openvswitch-controller.postrm \
 	debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in \
 	debian/openvswitch-datapath-dkms.postinst \
 	debian/openvswitch-datapath-dkms.prerm \
@@ -42,6 +43,7 @@
 	debian/openvswitch-switch.manpages \
 	debian/openvswitch-switch.postinst \
 	debian/openvswitch-switch.postrm \
+	debian/openvswitch-switch.prerm \
 	debian/openvswitch-switch.template \
 	debian/openvswitch-test.dirs \
 	debian/openvswitch-test.install \
diff -Nru openvswitch-1.4.2+git20120612/debian/changelog openvswitch-1.4.2+git20120612/debian/changelog
--- openvswitch-1.4.2+git20120612/debian/changelog	2012-06-19 09:40:53.000000000 -0700
+++ openvswitch-1.4.2+git20120612/debian/changelog	2012-08-02 14:22:26.000000000 -0700
@@ -1,3 +1,92 @@
+openvswitch (1.4.2+git20120612-8) unstable; urgency=low
+
+  * Apply further patches to fix bugs resulting from moving
+    /etc/openvswitch/conf.db to /var/lib/openvswitch in -7.
+    
+    This required applying the following bug fix patches:
+
+    bug-681880-3-Make-the-location-of-the-database-separately-configu.patch
+    bug-681880-4-tests-Slightly-generalize-utility-function-tests.patch
+    bug-681880-5-util-New-function-follow_symlinks.patch
+    bug-681880-6-lockfile-Be-more-forgiving-about-lockfiles-for-symli.patch
+    bug-681880-7-ovsdb-Do-not-replace-symlinks-by-regular-files-durin.patch
+    bug-681880-8-Fix-a-typo-in-commit-f973f2af2.patch
+    bug-681880-9-dirs-dbdir-default-must-be-based-on-sysconfdir.patch
+
+  * debian/rules: Configure /var/lib/openvswitch as the database directory
+    instead of working through symlinks.  (The symlinks are still created
+    for compatibility with people and existing software that are
+    accustomed to seeing the database in its original location, but the
+    Debian packages themselves never use the symlinks.)
+
+  * debian/openvswitch-switch.postrm: Also remove
+    /ec/openvswitch/system-id.conf and conf.db backups on purge.
+
+  * utilities/ovs-pki.in: Use mode 0700 instead of 0733 for
+    openvswitch-pki "incoming" directory, by applying
+    bug-683665-use-mode-700-for-pki-incoming-dir.patch.  See the patch for
+    complete rationale.  Closes: #683665.  Thanks to Andreas Beckmann
+    <debian@abeckmann.de> for reporting this bug.
+
+  * debian/openvswitch-pki.postinst: Change mode of existing "incoming"
+    directories to 0700 at configure time (see above).
+
+ -- Ben Pfaff <pfaffben@debian.org>  Wed, 01 Aug 2012 11:20:21 -0700
+
+openvswitch (1.4.2+git20120612-7) unstable; urgency=low
+
+  * Move /etc/openvswitch/conf.db to /var/lib/openvswitch, using symlinks.
+    Closes: #681880.  Thanks to Bastian Blank <waldi@debian.org> for
+    reporting this bug.
+    
+    This required applying the following bug fix patches:
+
+    bug-681880-1-lockfile-Fix-hang-locking-through-a-dangling-symlink.patch
+    bug-681880-2-ovsdb-Make-ovsdb-tool-create-work-through-a-dangling.patch
+
+  * Start the rest of OVS if bridge compatibility is enabled but the
+    kernel bridge module cannot be loaded.  Closes: #681955.  Thanks to
+    Bastian Blank <waldi@debian.org> for reporting this bug.
+    
+    This was fixed by applying the following bug fix patch:
+
+    bug-681955-ovs-ctl-Start-the-rest-of-Open-vSwitch.patch    
+
+ -- Ben Pfaff <pfaffben@debian.org>  Fri, 27 Jul 2012 12:36:03 -0700
+
+openvswitch (1.4.2+git20120612-6) unstable; urgency=low
+
+  * utilities/automake.mk: Fix duplicate mention of ovs-vsctl in
+    bin_PROGRAMS and bin_SCRIPTS; it should only have been in the former.
+    Closes: #682384.  Thanks to Bastian Blank <waldi@debian.org> for
+    reporting this bug.
+
+ -- Ben Pfaff <pfaffben@debian.org>  Mon, 23 Jul 2012 09:46:41 -0700
+
+openvswitch (1.4.2+git20120612-5) unstable; urgency=low
+
+  * debian/openvswitch-controller.postrm: Remove configuration files in
+    /etc/openvswitch-controller on purge.  Closes: #682187.  Thanks to
+    Andreas Beckmann <debian@abeckmann.de> for reporting this bug.
+
+ -- Ben Pfaff <pfaffben@debian.org>  Fri, 20 Jul 2012 22:33:19 -0700
+
+openvswitch (1.4.2+git20120612-4) unstable; urgency=low
+
+  * debian/openvswitch-switch.init: Do not modify iptables rules.  Closes:
+    #680537.  Thanks to Bastian Blank <waldi@debian.org> for reporting
+    this bug.
+
+ -- Ben Pfaff <pfaffben@debian.org>  Mon, 16 Jul 2012 12:56:37 -0700
+
+openvswitch (1.4.2+git20120612-3) unstable; urgency=low
+
+  * debian/control: Add "netbase" dependency to ensure that /etc/protocols
+    is available.  Closes: #680537.  Thanks to Bastian Blank <waldi@debian.org>
+    for reporting this bug.
+
+ -- Ben Pfaff <pfaffben@debian.org>  Mon, 09 Jul 2012 09:50:03 -0700
+
 openvswitch (1.4.2+git20120612-2) unstable; urgency=low
 
   * Apply upstream commit that enables DKMS to automatically build for the
diff -Nru openvswitch-1.4.2+git20120612/debian/control openvswitch-1.4.2+git20120612/debian/control
--- openvswitch-1.4.2+git20120612/debian/control	2012-05-07 20:05:48.000000000 -0700
+++ openvswitch-1.4.2+git20120612/debian/control	2012-07-09 09:50:14.000000000 -0700
@@ -66,7 +66,7 @@
 Package: openvswitch-switch
 Architecture: linux-any
 Suggests: openvswitch-datapath-module
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, openvswitch-common (= ${binary:Version}), module-init-tools, procps, uuid-runtime
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, openvswitch-common (= ${binary:Version}), module-init-tools, procps, uuid-runtime, netbase
 Description: Open vSwitch switch implementations
  Open vSwitch is a production quality, multilayer, software-based, Ethernet
  virtual switch. It is designed to enable massive network automation through
diff -Nru openvswitch-1.4.2+git20120612/debian/openvswitch-controller.postrm openvswitch-1.4.2+git20120612/debian/openvswitch-controller.postrm
--- openvswitch-1.4.2+git20120612/debian/openvswitch-controller.postrm	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/openvswitch-controller.postrm	2012-07-20 22:31:07.000000000 -0700
@@ -0,0 +1,44 @@
+#!/bin/sh
+# postrm script for openvswitch-controller
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge)
+        if cd /etc/openvswitch-controller; then
+            rm -f cacert.pem cert.pem privkey.pem req.pem
+            rm -f tmp-privkey.pem tmp-cert.pem tmp-req.pem
+        fi
+        ;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+        ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+        ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff -Nru openvswitch-1.4.2+git20120612/debian/openvswitch-pki.postinst openvswitch-1.4.2+git20120612/debian/openvswitch-pki.postinst
--- openvswitch-1.4.2+git20120612/debian/openvswitch-pki.postinst	2012-05-07 20:05:48.000000000 -0700
+++ openvswitch-1.4.2+git20120612/debian/openvswitch-pki.postinst	2012-08-02 10:41:49.000000000 -0700
@@ -30,6 +30,13 @@
         # Create certificate authorities.
         if test ! -e /var/lib/openvswitch/pki; then
             ovs-pki init
+        else
+	    for ca in switchca controllerca; do
+		dir=/var/lib/openvswitch/pki/$ca/incoming
+		if test -d $dir; then
+		    chmod 0700 $dir
+		fi
+	    done
         fi
         ;;
 
diff -Nru openvswitch-1.4.2+git20120612/debian/openvswitch-switch.dirs openvswitch-1.4.2+git20120612/debian/openvswitch-switch.dirs
--- openvswitch-1.4.2+git20120612/debian/openvswitch-switch.dirs	2012-06-12 10:17:04.000000000 -0700
+++ openvswitch-1.4.2+git20120612/debian/openvswitch-switch.dirs	2012-07-27 11:26:18.000000000 -0700
@@ -1,3 +1,4 @@
 /etc/openvswitch
 /etc/openvswitch-switch
 /usr/share/openvswitch/switch
+/var/lib/openvswitch
diff -Nru openvswitch-1.4.2+git20120612/debian/openvswitch-switch.init openvswitch-1.4.2+git20120612/debian/openvswitch-switch.init
--- openvswitch-1.4.2+git20120612/debian/openvswitch-switch.init	2012-06-12 10:17:04.000000000 -0700
+++ openvswitch-1.4.2+git20120612/debian/openvswitch-switch.init	2012-07-27 12:46:24.000000000 -0700
@@ -69,8 +69,6 @@
 	set "$@" --force-corefiles="$FORCE_COREFILES"
     fi
     "$@" || exit $?
-
-    ovs_ctl --protocol=gre enable-protocol
 }
 
 stop () {
diff -Nru openvswitch-1.4.2+git20120612/debian/openvswitch-switch.postinst openvswitch-1.4.2+git20120612/debian/openvswitch-switch.postinst
--- openvswitch-1.4.2+git20120612/debian/openvswitch-switch.postinst	2012-05-07 20:05:48.000000000 -0700
+++ openvswitch-1.4.2+git20120612/debian/openvswitch-switch.postinst	2012-07-27 12:48:09.000000000 -0700
@@ -33,6 +33,21 @@
                 fi
             done
 	fi
+
+	# Ensure that /etc/openvswitch/conf.db links to /var/lib/openvswitch,
+	# moving an existing file if there is one.
+	#
+	# Ditto for .conf.db.~lock~.
+	for base in conf.db .conf.db.~lock~; do
+	    new=/var/lib/openvswitch/$base
+	    old=/etc/openvswitch/$base
+	    if test -f $old && test ! -e $new; then
+		mv $old $new
+	    fi
+	    if test ! -e $old && test ! -h $old; then
+		ln -s $new $old
+	    fi
+	done
         ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
diff -Nru openvswitch-1.4.2+git20120612/debian/openvswitch-switch.postrm openvswitch-1.4.2+git20120612/debian/openvswitch-switch.postrm
--- openvswitch-1.4.2+git20120612/debian/openvswitch-switch.postrm	2012-03-21 08:50:44.000000000 -0700
+++ openvswitch-1.4.2+git20120612/debian/openvswitch-switch.postrm	2012-08-02 09:48:10.000000000 -0700
@@ -21,8 +21,10 @@
 
 case "$1" in
     purge)
-        rm -f /etc/openvswitch/conf.db
-        rm -f /etc/openvswitch/.conf.db.~lock~
+	for dir in /etc/openvswitch /var/lib/openvswitch; do
+	    rm -f $dir/conf.db $dir/conf.db.backup* $dir/.conf.db.~lock~
+	done
+	rm -f /etc/openvswitch/system-id.conf
         rm -f /etc/default/openvswitch-switch
         rm -f /var/log/openvswitch/ovs-vswitchd.log* || true
         rm -f /var/log/openvswitch/ovsdb-server.log* || true
diff -Nru openvswitch-1.4.2+git20120612/debian/openvswitch-switch.prerm openvswitch-1.4.2+git20120612/debian/openvswitch-switch.prerm
--- openvswitch-1.4.2+git20120612/debian/openvswitch-switch.prerm	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/openvswitch-switch.prerm	2012-07-27 11:26:20.000000000 -0700
@@ -0,0 +1,50 @@
+#!/bin/sh
+# prerm script for openvswitch-switch
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    upgrade)
+        # Ensure that conf.db and its lockfile in /etc/openvswitch are not
+        # dangling symlinks, because this caused ovsdb-server to hang at
+        # startup in versions of OVS older than 1.4.2+git20120612-7.
+        for base in conf.db .conf.db.~lock~; do
+            fn=/etc/openvswitch/$base
+            if test -h $fn && test ! -e $fn; then
+                rm -f $fn
+            fi
+        done
+        ;;
+
+    remove|deconfigure)
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681880-1-lockfile-Fix-hang-locking-through-a-dangling-symlink.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681880-1-lockfile-Fix-hang-locking-through-a-dangling-symlink.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681880-1-lockfile-Fix-hang-locking-through-a-dangling-symlink.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681880-1-lockfile-Fix-hang-locking-through-a-dangling-symlink.patch	2012-08-02 09:33:39.000000000 -0700
@@ -0,0 +1,158 @@
+From 0182975d0bbf29ceaf546a110f001efa1034beca Mon Sep 17 00:00:00 2001
+From: Ben Pfaff <blp@nicira.com>
+Date: Thu, 26 Jul 2012 14:36:24 -0700
+Subject: [PATCH 1/3] lockfile: Fix hang locking through a dangling symlink.
+
+open() with O_CREAT|O_EXCL yields EEXIST if the file being opened is a
+symlink.  lockfile_try_lock() interpreted that error code to mean that
+some other process had created the lock file in the meantime, so it went
+around its loop again, which found out the same thing, which led to a hang.
+
+This commit fixes the problem by dropping O_EXCL.  I don't see any reason
+that it's actually necessary.  That means that the loop itself is
+unnecessary, so this commit drops that too.
+
+Debian bug #681880.
+CC: 681880@bugs.debian.org
+Reported-by: Bastian Blank <waldi@debian.org>
+Signed-off-by: Ben Pfaff <blp@nicira.com>
+---
+ lib/lockfile.c        |   50 +++++++++++++++---------------------------------
+ tests/lockfile.at     |    1 +
+ tests/test-lockfile.c |   38 ++++++++++++++++++++++++++++++++++++-
+ 3 files changed, 54 insertions(+), 35 deletions(-)
+
+diff --git a/lib/lockfile.c b/lib/lockfile.c
+index e0f6328..c55be66 100644
+--- a/lib/lockfile.c
++++ b/lib/lockfile.c
+@@ -221,41 +221,23 @@ lockfile_try_lock(const char *name, bool block, struct lockfile **lockfilep)
+ 
+     *lockfilep = NULL;
+ 
+-    /* Open the lock file, first creating it if necessary. */
+-    for (;;) {
+-        /* Check whether we've already got a lock on that file. */
+-        if (!stat(name, &s)) {
+-            if (lockfile_find(s.st_dev, s.st_ino)) {
+-                return EDEADLK;
+-            }
+-        } else if (errno != ENOENT) {
+-            VLOG_WARN("%s: failed to stat lock file: %s",
+-                      name, strerror(errno));
+-            return errno;
+-        }
+-
+-        /* Try to open an existing lock file. */
+-        fd = open(name, O_RDWR);
+-        if (fd >= 0) {
+-            break;
+-        } else if (errno != ENOENT) {
+-            VLOG_WARN("%s: failed to open lock file: %s",
+-                      name, strerror(errno));
+-            return errno;
+-        }
+-
+-        /* Try to create a new lock file. */
+-        VLOG_INFO("%s: lock file does not exist, creating", name);
+-        fd = open(name, O_RDWR | O_CREAT | O_EXCL, 0600);
+-        if (fd >= 0) {
+-            break;
+-        } else if (errno != EEXIST) {
+-            VLOG_WARN("%s: failed to create lock file: %s",
+-                      name, strerror(errno));
+-            return errno;
++    /* Check whether we've already got a lock on that file. */
++    if (!stat(name, &s)) {
++        if (lockfile_find(s.st_dev, s.st_ino)) {
++            return EDEADLK;
+         }
++    } else if (errno != ENOENT) {
++        VLOG_WARN("%s: failed to stat lock file: %s",
++                  name, strerror(errno));
++        return errno;
++    }
+ 
+-        /* Someone else created the lock file.  Try again. */
++    /* Open the lock file. */
++    fd = open(name, O_RDWR | O_CREAT, 0600);
++    if (fd < 0) {
++        VLOG_WARN("%s: failed to open lock file: %s",
++                  name, strerror(errno));
++        return errno;
+     }
+ 
+     /* Get the inode and device number for the lock table. */
+diff --git a/tests/lockfile.at b/tests/lockfile.at
+index 9cc95a8..1fa0342 100644
+--- a/tests/lockfile.at
++++ b/tests/lockfile.at
+@@ -18,3 +18,4 @@ CHECK_LOCKFILE([lock_and_unlock_allows_other_process], [1])
+ CHECK_LOCKFILE([lock_timeout_gets_the_lock], [1])
+ CHECK_LOCKFILE([lock_timeout_runs_out], [1])
+ CHECK_LOCKFILE([lock_multiple], [0])
++CHECK_LOCKFILE([lock_symlink], [0])
+diff --git a/tests/test-lockfile.c b/tests/test-lockfile.c
+index d28c1b4..808ed1e 100644
+--- a/tests/test-lockfile.c
++++ b/tests/test-lockfile.c
+@@ -20,6 +20,7 @@
+ 
+ #include <errno.h>
+ #include <stdlib.h>
++#include <sys/stat.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
+ 
+@@ -214,6 +215,40 @@ run_lock_multiple(void)
+     lockfile_unlock(a);
+ }
+ 
++/* Checks that locking a dangling symlink works OK.  (It used to hang.) */
++static void
++run_lock_symlink(void)
++{
++    struct lockfile *a, *b, *dummy;
++    struct stat s;
++
++    /* Create a symlink .a.~lock~ pointing to .b.~lock~. */
++    CHECK(symlink(".b.~lock~", ".a.~lock~"), 0);
++    CHECK(lstat(".a.~lock~", &s), 0);
++    CHECK(S_ISLNK(s.st_mode) != 0, 1);
++    CHECK(stat(".a.~lock~", &s), -1);
++    CHECK(errno, ENOENT);
++    CHECK(stat(".b.~lock~", &s), -1);
++    CHECK(errno, ENOENT);
++
++    CHECK(lockfile_lock("a", 0, &a), 0);
++    CHECK(lockfile_lock("a", 0, &dummy), EDEADLK);
++    CHECK(lockfile_lock("b", 0, &dummy), EDEADLK);
++    lockfile_unlock(a);
++
++    CHECK(lockfile_lock("b", 0, &b), 0);
++    CHECK(lockfile_lock("b", 0, &dummy), EDEADLK);
++    CHECK(lockfile_lock("a", 0, &dummy), EDEADLK);
++    lockfile_unlock(b);
++
++    CHECK(lstat(".a.~lock~", &s), 0);
++    CHECK(S_ISLNK(s.st_mode) != 0, 1);
++    CHECK(stat(".a.~lock~", &s), 0);
++    CHECK(S_ISREG(s.st_mode) != 0, 1);
++    CHECK(stat(".b.~lock~", &s), 0);
++    CHECK(S_ISREG(s.st_mode) != 0, 1);
++}
++
+ static void
+ run_help(void)
+ {
+@@ -239,6 +274,7 @@ static const struct test tests[] = {
+     TEST(lock_timeout_gets_the_lock),
+     TEST(lock_timeout_runs_out),
+     TEST(lock_multiple),
++    TEST(lock_symlink),
+     TEST(help),
+     { NULL, NULL }
+ #undef TEST
+-- 
+1.7.2.5
+
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681880-2-ovsdb-Make-ovsdb-tool-create-work-through-a-dangling.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681880-2-ovsdb-Make-ovsdb-tool-create-work-through-a-dangling.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681880-2-ovsdb-Make-ovsdb-tool-create-work-through-a-dangling.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681880-2-ovsdb-Make-ovsdb-tool-create-work-through-a-dangling.patch	2012-08-02 09:33:39.000000000 -0700
@@ -0,0 +1,45 @@
+From 11d1cec1eeece689122022758b67396f875f901b Mon Sep 17 00:00:00 2001
+From: Ben Pfaff <blp@nicira.com>
+Date: Thu, 26 Jul 2012 14:42:58 -0700
+Subject: [PATCH 2/3] ovsdb: Make "ovsdb-tool create" work through a dangling symlink.
+
+open() with O_CREAT|O_EXCL yields EEXIST if the name passed in is a
+symlink, but we would like "ovsdb-tool create /etc/openvswitch/conf.db" to
+work if /etc/openvswitch/conf.db is a symlink to elsewhere in the file
+system.  This commit fixes the problem.  It introduces a theoretical race,
+but no one should be doing "ovsdb-tool create" in parallel anyhow; O_EXCL
+is just an idiot check here, not required to be fail-safe.
+
+Debian bug #681880.
+CC: 681880@bugs.debian.org
+Reported-by: Bastian Blank <waldi@debian.org>
+Signed-off-by: Ben Pfaff <blp@nicira.com>
+---
+ ovsdb/log.c |   13 +++++++++++--
+ 1 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/ovsdb/log.c b/ovsdb/log.c
+index ab4a150..9b882dc 100644
+--- a/ovsdb/log.c
++++ b/ovsdb/log.c
+@@ -95,7 +95,16 @@ ovsdb_log_open(const char *name, enum ovsdb_log_open_mode open_mode,
+     } else if (open_mode == OVSDB_LOG_READ_WRITE) {
+         flags = O_RDWR;
+     } else if (open_mode == OVSDB_LOG_CREATE) {
+-        flags = O_RDWR | O_CREAT | O_EXCL;
++        if (stat(name, &s) == -1 && errno == ENOENT
++            && lstat(name, &s) == 0 && S_ISLNK(s.st_mode)) {
++            /* 'name' is a dangling symlink.  We want to create the file that
++             * the symlink points to, but POSIX says that open() with O_EXCL
++             * must fail with EEXIST if the named file is a symlink.  So, we
++             * have to leave off O_EXCL and accept the race. */
++            flags = O_RDWR | O_CREAT;
++        } else {
++            flags = O_RDWR | O_CREAT | O_EXCL;
++        }
+     } else {
+         NOT_REACHED();
+     }
+-- 
+1.7.2.5
+
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681880-3-Make-the-location-of-the-database-separately-configu.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681880-3-Make-the-location-of-the-database-separately-configu.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681880-3-Make-the-location-of-the-database-separately-configu.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681880-3-Make-the-location-of-the-database-separately-configu.patch	2012-08-02 09:38:43.000000000 -0700
@@ -0,0 +1,307 @@
+From f973f2af2fd4452c8e182caf6a4346cf2a2a394e Mon Sep 17 00:00:00 2001
+From: Ben Pfaff <blp@nicira.com>
+Date: Fri, 27 Jul 2012 15:52:21 -0700
+Subject: [PATCH 1/7] Make the location of the database separately configurable.
+
+The default is unchanged, /etc/openvswitch/conf.db.
+
+This makes it possible to transition each Open vSwitch packaging from
+/etc/openvswitch/conf.db to /var/lib/openvswitch/conf.db independently.
+
+Signed-off-by: Ben Pfaff <blp@nicira.com>
+---
+ Makefile.am                                           |    1 +
+ configure.ac                                          |    1 +
+ lib/automake.mk                                       |    2 ++
+ lib/dirs.c.in                                         |    7 +++++++
+ lib/dirs.h                                            |    1 +
+ m4/openvswitch.m4                                     |   10 ++++++++++
+ ovsdb/ovsdb-server.1.in                               |    2 +-
+ ovsdb/ovsdb-server.c                                  |    2 +-
+ python/automake.mk                                    |    1 +
+ python/ovs/dirs.py                                    |    1 +
+ tests/ofproto-macros.at                               |    3 ++-
+ tests/ovs-monitor-ipsec.at                            |    1 +
+ tests/ovs-xapi-sync.at                                |    1 +
+ utilities/bugtool/ovs-bugtool.in                      |    2 +-
+ utilities/bugtool/plugins/system-logs/openvswitch.xml |    3 ++-
+ utilities/ovs-ctl.8                                   |    3 ++-
+ utilities/ovs-ctl.in                                  |    7 ++++---
+ utilities/ovs-lib.in                                  |    2 ++
+ 18 files changed, 41 insertions(+), 9 deletions(-)
+
+Index: b/Makefile.am
+===================================================================
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -96,6 +96,7 @@ SUFFIXES += .in
+ 	    sed \
+ 		-e 's,[@]PKIDIR[@],$(PKIDIR),g' \
+                 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
++                -e 's,[@]DBDIR[@],$(DBDIR),g' \
+                 -e 's,[@]PERL[@],$(PERL),g' \
+                 -e 's,[@]PYTHON[@],$(PYTHON),g' \
+                 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -61,6 +61,7 @@ AC_CHECK_HEADERS([mntent.h sys/statvfs.h
+ 
+ OVS_CHECK_PKIDIR
+ OVS_CHECK_RUNDIR
++OVS_CHECK_DBDIR
+ OVS_CHECK_BACKTRACE
+ OVS_CHECK_MALLOC_HOOKS
+ OVS_CHECK_VALGRIND
+Index: b/lib/automake.mk
+===================================================================
+--- a/lib/automake.mk
++++ b/lib/automake.mk
+@@ -271,6 +271,7 @@ lib/dirs.c: lib/dirs.c.in Makefile
+ 		-e 's,[@]srcdir[@],$(srcdir),g' \
+ 		-e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
+ 		-e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
++		-e 's,[@]DBDIR[@],"$(DBDIR)",g' \
+ 		-e 's,[@]bindir[@],"$(bindir)",g' \
+ 		-e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
+ 		-e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
+@@ -290,6 +291,7 @@ lib-install-data-local:
+ 	$(MKDIR_P) $(DESTDIR)$(RUNDIR)
+ 	$(MKDIR_P) $(DESTDIR)$(PKIDIR)
+ 	$(MKDIR_P) $(DESTDIR)$(LOGDIR)
++	$(MKDIR_P) $(DESTDIR)$(DBDIR)
+ 
+ if !USE_LINKER_SECTIONS
+ # All distributed sources, with names adjust properly for referencing
+Index: b/lib/dirs.c.in
+===================================================================
+--- a/lib/dirs.c.in
++++ b/lib/dirs.c.in
+@@ -66,6 +66,13 @@ ovs_logdir(void)
+ }
+ 
+ const char *
++ovs_dbdir(void)
++{
++    static struct directory d = { NULL, @DBDIR@, "OVS_DBDIR" };
++    return get_dir(&d);
++}
++
++const char *
+ ovs_bindir(void)
+ {
+     static struct directory d = { NULL, @bindir@, "OVS_BINDIR" };
+Index: b/lib/dirs.h
+===================================================================
+--- a/lib/dirs.h
++++ b/lib/dirs.h
+@@ -21,6 +21,7 @@ const char *ovs_sysconfdir(void); /* /us
+ const char *ovs_pkgdatadir(void); /* /usr/local/share/openvswitch */
+ const char *ovs_rundir(void);     /* /usr/local/var/run/openvswitch */
+ const char *ovs_logdir(void);     /* /usr/local/var/log/openvswitch */
++const char *ovs_dbdir(void);      /* /usr/local/etc/openvswitch */
+ const char *ovs_bindir(void);     /* /usr/local/bin */
+ 
+ #endif /* dirs.h */
+Index: b/m4/openvswitch.m4
+===================================================================
+--- a/m4/openvswitch.m4
++++ b/m4/openvswitch.m4
+@@ -132,6 +132,16 @@ AC_DEFUN([OVS_CHECK_LOGDIR],
+      [LOGDIR='${localstatedir}/log/${PACKAGE}'])
+    AC_SUBST([LOGDIR])])
+ 
++dnl Checks for the directory in which to store the Open vSwitch database.
++AC_DEFUN([OVS_CHECK_DBDIR],
++  [AC_ARG_WITH(
++     [dbdir],
++     AC_HELP_STRING([--with-dbdir=DIR],
++                    [directory used for conf.db [[SYSCONFDIR/PACKAGE]]]),
++     [DBDIR=$withval],
++     [DBDIR='${sysconfdir}/${PACKAGE}'])
++   AC_SUBST([DBDIR])])
++
+ dnl Defines HAVE_BACKTRACE if backtrace() is declared in <execinfo.h>
+ dnl and exists in libc.
+ AC_DEFUN([OVS_CHECK_BACKTRACE],
+Index: b/ovsdb/ovsdb-server.1.in
+===================================================================
+--- a/ovsdb/ovsdb-server.1.in
++++ b/ovsdb/ovsdb-server.1.in
+@@ -26,7 +26,7 @@ vSwitch database (OVSDB).  It supports J
+ over active or passive TCP/IP or Unix domain sockets.
+ .PP
+ The OVSDB file may be specified on the command line as \fIdatabase\fR.
+-The default is \fB@sysconfdir@/openvswitch/conf.db\fR.  The database
++The default is \fB@DBDIR@/conf.db\fR.  The database
+ file must already have been created and initialized using, for
+ example, \fBovsdb\-tool create\fR.
+ .
+Index: b/ovsdb/ovsdb-server.c
+===================================================================
+--- a/ovsdb/ovsdb-server.c
++++ b/ovsdb/ovsdb-server.c
+@@ -748,7 +748,7 @@ parse_options(int argc, char *argv[], ch
+ 
+     switch (argc) {
+     case 0:
+-        *file_namep = xasprintf("%s/openvswitch/conf.db", ovs_sysconfdir());
++        *file_namep = xasprintf("%s/conf.db", ovs_dbdir());
+         break;
+ 
+     case 1:
+Index: b/python/automake.mk
+===================================================================
+--- a/python/automake.mk
++++ b/python/automake.mk
+@@ -40,6 +40,7 @@ ovs-install-data-local:
+ 	 echo 'PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """$(pkgdatadir)""")' && \
+ 	 echo 'RUNDIR = os.environ.get("OVS_RUNDIR", """@RUNDIR@""")' && \
+ 	 echo 'LOGDIR = os.environ.get("OVS_LOGDIR", """@LOGDIR@""")' && \
++	 echo 'DBDIR = os.environ.get("OVS_DBDIR", """@DBDIR@""")' && \
+ 	 echo 'BINDIR = os.environ.get("OVS_BINDIR", """$(bindir)""")') \
+ 		> python/ovs/dirs.py.tmp
+ 	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs
+Index: b/python/ovs/dirs.py
+===================================================================
+--- a/python/ovs/dirs.py
++++ b/python/ovs/dirs.py
+@@ -5,4 +5,5 @@ import os
+ PKGDATADIR = os.environ.get("OVS_PKGDATADIR", "/usr/local/share/openvswitch")
+ RUNDIR = os.environ.get("OVS_RUNDIR", "/var/run")
+ LOGDIR = os.environ.get("OVS_LOGDIR", "/usr/local/var/log")
++LOGDIR = os.environ.get("OVS_DBDIR", "/usr/local/etc/openvswitch")
+ BINDIR = os.environ.get("OVS_BINDIR", "/usr/local/bin")
+Index: b/tests/ofproto-macros.at
+===================================================================
+--- a/tests/ofproto-macros.at
++++ b/tests/ofproto-macros.at
+@@ -5,13 +5,14 @@ m4_define([TESTABLE_LOG], [-vPATTERN:ANY
+ m4_define([OVS_VSWITCHD_START],
+   [OVS_RUNDIR=$PWD; export OVS_RUNDIR
+    OVS_LOGDIR=$PWD; export OVS_LOGDIR
++   OVS_DBDIR=`pwd`; export OVS_DBDIR
+    OVS_SYSCONFDIR=$PWD; export OVS_SYSCONFDIR
+    trap 'kill `cat ovsdb-server.pid ovs-vswitchd.pid`' 0
+ 
+    dnl Create database.
+    mkdir openvswitch
+    touch openvswitch/.conf.db.~lock~
+-   AT_CHECK([ovsdb-tool create openvswitch/conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema])
++   AT_CHECK([ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema])
+ 
+    dnl Start ovsdb-server.
+    AT_CHECK([ovsdb-server --detach --pidfile --log-file --remote=punix:$OVS_RUNDIR/db.sock], [0], [], [stderr])
+Index: b/tests/ovs-monitor-ipsec.at
+===================================================================
+--- a/tests/ovs-monitor-ipsec.at
++++ b/tests/ovs-monitor-ipsec.at
+@@ -3,6 +3,7 @@ AT_BANNER([ovs-monitor-ipsec])
+ AT_SETUP([ovs-monitor-ipsec])
+ AT_SKIP_IF([test $HAVE_PYTHON = no])
+ 
++OVS_DBDIR=`pwd`; export OVS_DBDIR
+ OVS_PKGDATADIR=`pwd`; export OVS_PKGDATADIR
+ cp "$top_srcdir/vswitchd/vswitch.ovsschema" .
+ 
+Index: b/tests/ovs-xapi-sync.at
+===================================================================
+--- a/tests/ovs-xapi-sync.at
++++ b/tests/ovs-xapi-sync.at
+@@ -8,6 +8,7 @@ cp "$top_srcdir/tests/MockXenAPI.py" Xen
+ PYTHONPATH=`pwd`:$PYTHONPATH
+ export PYTHONPATH
+ 
++OVS_DBDIR=`pwd`; export OVS_DBDIR
+ OVS_PKGDATADIR=`pwd`; export OVS_PKGDATADIR
+ cp "$top_srcdir/vswitchd/vswitch.ovsschema" .
+ 
+Index: b/utilities/bugtool/ovs-bugtool.in
+===================================================================
+--- a/utilities/bugtool/ovs-bugtool.in
++++ b/utilities/bugtool/ovs-bugtool.in
+@@ -115,7 +115,7 @@ OPENVSWITCH_LOG_DIR = '@LOGDIR@/'
+ OPENVSWITCH_DEFAULT_SWITCH = '/etc/default/openvswitch-switch' # Debian
+ OPENVSWITCH_SYSCONFIG_SWITCH = '/etc/sysconfig/openvswitch'    # RHEL
+ OPENVSWITCH_DEFAULT_CONTROLLER = '/etc/default/openvswitch-controller'
+-OPENVSWITCH_CONF_DB = '@sysconfdir@/openvswitch/conf.db'
++OPENVSWITCH_CONF_DB = '@DBDIR@/conf.db'
+ OPENVSWITCH_VSWITCHD_PID = '@RUNDIR@/ovs-vswitchd.pid'
+ COLLECTD_LOGS_DIR = '/var/lib/collectd/rrd'
+ VAR_LOG_DIR = '/var/log/'
+Index: b/utilities/bugtool/plugins/system-logs/openvswitch.xml
+===================================================================
+--- a/utilities/bugtool/plugins/system-logs/openvswitch.xml
++++ b/utilities/bugtool/plugins/system-logs/openvswitch.xml
+@@ -13,9 +13,10 @@
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+  USA.
+ 
+- Copyright (C) 2011 Nicira Networks.
++ Copyright (C) 2011, 2012 Nicira Networks.
+ -->
+ 
+ <collect>
+   <directory label="ovsdb-backups" pattern=".*/conf.db.backup[0-9][^/]*$">/etc/openvswitch</directory>
++  <directory label="ovsdb-backups2" pattern=".*/conf.db.backup[0-9][^/]*$">/var/lib/openvswitch</directory>
+ </collect>
+Index: b/utilities/ovs-ctl.8
+===================================================================
+--- a/utilities/ovs-ctl.8
++++ b/utilities/ovs-ctl.8
+@@ -361,6 +361,7 @@ that it runs.  \fBovs\-ctl\fR will add t
+ .
+ .IP "\fBOVS_LOGDIR\fR"
+ .IQ "\fBOVS_RUNDIR\fR"
++.IQ "\fBOVS_DBDIR\fR"
+ .IQ "\fBOVS_SYSCONFDIR\fR"
+ .IQ "\fBOVS_PKGDATADIR\fR"
+ .IQ "\fBOVS_BINDIR\fR"
+@@ -388,7 +389,7 @@ process ID.
+ The OVS database schema used to initialize the database (use
+ \fB\-\-db\-schema to override this location).
+ .
+-.IP "\fIsysconfdir\fB/openvswitch/conf.db\fR"
++.IP "\fIdbdir\fB/conf.db\fR"
+ The OVS database (use \fB\-\-db\-file\fR to override this location).
+ .
+ .IP "\fIrundir\fB/openvswitch/db.sock\fR"
+Index: b/utilities/ovs-ctl.in
+===================================================================
+--- a/utilities/ovs-ctl.in
++++ b/utilities/ovs-ctl.in
+@@ -371,7 +371,7 @@ set_defaults () {
+     OVS_VSWITCHD_PRIORITY=-10
+     OVS_BRCOMPATD_PRIORITY=-10
+ 
+-    DB_FILE=$etcdir/conf.db
++    DB_FILE=$dbdir/conf.db
+     DB_SOCK=$rundir/db.sock
+     DB_SCHEMA=$datadir/vswitch.ovsschema
+ 
+@@ -447,8 +447,9 @@ Other options:
+   -V, --version               display version information
+ 
+ Default directories with "configure" option and environment variable override:
+-  logs: @LOGDIR@ (--log-dir, OVS_LOGDIR)
+-  pidfiles and sockets: @RUNDIR@ (--run-dir, OVS_RUNDIR)
++  logs: @LOGDIR@ (--with-logdir, OVS_LOGDIR)
++  pidfiles and sockets: @RUNDIR@ (--with-rundir, OVS_RUNDIR)
++  conf.db: @DBDIR@ (--with-dbdir, OVS_DBDIR)
+   system configuration: @sysconfdir@ (--sysconfdir, OVS_SYSCONFDIR)
+   data files: @pkgdatadir@ (--pkgdatadir, OVS_PKGDATADIR)
+   user binaries: @bindir@ (--bindir, OVS_BINDIR)
+Index: b/utilities/ovs-lib.in
+===================================================================
+--- a/utilities/ovs-lib.in
++++ b/utilities/ovs-lib.in
+@@ -22,6 +22,8 @@
+ # All of these should be substituted by the Makefile at build time.
+ logdir=${OVS_LOGDIR-'@LOGDIR@'}                 # /var/log/openvswitch
+ rundir=${OVS_RUNDIR-'@RUNDIR@'}                 # /var/run/openvswitch
++dbdir=${OVS_DBDIR-'@DBDIR@'}                    # /etc/openvswitch
++                                                # or /var/lib/openvswitch
+ sysconfdir=${OVS_SYSCONFDIR-'@sysconfdir@'}     # /etc
+ etcdir=$sysconfdir/openvswitch                  # /etc/openvswitch
+ datadir=${OVS_PKGDATADIR-'@pkgdatadir@'}        # /usr/share/openvswitch
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681880-4-tests-Slightly-generalize-utility-function-tests.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681880-4-tests-Slightly-generalize-utility-function-tests.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681880-4-tests-Slightly-generalize-utility-function-tests.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681880-4-tests-Slightly-generalize-utility-function-tests.patch	2012-08-02 09:33:39.000000000 -0700
@@ -0,0 +1,123 @@
+From 8c2296a6d97ffc29c0b253eab084e92a82c198b4 Mon Sep 17 00:00:00 2001
+From: Ben Pfaff <blp@nicira.com>
+Date: Mon, 30 Jul 2012 09:35:32 -0700
+Subject: [PATCH 2/7] tests: Slightly generalize utility function tests.
+
+This will allow passing arguments in for an upcoming test.
+
+Signed-off-by: Ben Pfaff <blp@nicira.com>
+---
+ tests/library.at  |   10 +++++++---
+ tests/test-util.c |   44 ++++++++++++++++++++++++++++++++++++--------
+ 2 files changed, 43 insertions(+), 11 deletions(-)
+
+Index: b/tests/library.at
+===================================================================
+--- a/tests/library.at
++++ b/tests/library.at
+@@ -100,9 +100,13 @@ nibble   0   1   2   3   4   5   6   7
+ ])
+ AT_CLEANUP
+ 
+-AT_SETUP([test log_2_floor])
+-AT_CHECK([test-util])
+-AT_CLEANUP
++m4_foreach(
++  [testname],
++  [[ctz],
++   [log_2_floor]],
++  [AT_SETUP([testname[()] function])
++   AT_CHECK([test-util testname], [0], [], [])
++   AT_CLEANUP])
+ 
+ AT_SETUP([test unix socket -- short pathname])
+ AT_CHECK([test-unix-socket x])
+Index: b/tests/test-util.c
+===================================================================
+--- a/tests/test-util.c
++++ b/tests/test-util.c
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2011 Nicira Networks.
++ * Copyright (c) 2011, 2012 Nicira Networks.
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ 
++#include "command-line.h"
+ #include "random.h"
+ #include "util.h"
+ 
+@@ -35,6 +36,25 @@ check_log_2_floor(uint32_t x, int n)
+ }
+ 
+ static void
++test_log_2_floor(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
++{
++    int n;
++
++    for (n = 0; n < 32; n++) {
++        /* Check minimum x such that f(x) == n. */
++        check_log_2_floor(1 << n, n);
++
++        /* Check maximum x such that f(x) == n. */
++        check_log_2_floor((1 << n) | ((1 << n) - 1), n);
++
++        /* Check a random value in the middle. */
++        check_log_2_floor((random_uint32() & ((1 << n) - 1)) | (1 << n), n);
++    }
++
++    /* log_2_floor(0) is undefined, so don't check it. */
++}
++
++static void
+ check_ctz(uint32_t x, int n)
+ {
+     if (ctz(x) != n) {
+@@ -44,28 +64,36 @@ check_ctz(uint32_t x, int n)
+     }
+ }
+ 
+-int
+-main(void)
++static void
++test_ctz(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
+ {
+     int n;
+ 
+     for (n = 0; n < 32; n++) {
+         /* Check minimum x such that f(x) == n. */
+-        check_log_2_floor(1 << n, n);
+         check_ctz(1 << n, n);
+ 
+         /* Check maximum x such that f(x) == n. */
+-        check_log_2_floor((1 << n) | ((1 << n) - 1), n);
+         check_ctz(UINT32_MAX << n, n);
+ 
+         /* Check a random value in the middle. */
+-        check_log_2_floor((random_uint32() & ((1 << n) - 1)) | (1 << n), n);
+         check_ctz((random_uint32() | 1) << n, n);
+     }
+ 
+-    /* Check ctz(0).
+-     * (log_2_floor(0) is undefined.) */
++    /* Check ctz(0). */
+     check_ctz(0, 32);
++}
++
++static const struct command commands[] = {
++    {"ctz", 0, 0, test_ctz},
++    {"log_2_floor", 0, 0, test_log_2_floor},
++    {NULL, 0, 0, NULL},
++};
+ 
++int
++main(int argc, char *argv[])
++{
++    set_program_name(argv[0]);
++    run_command(argc - 1, argv + 1, commands);
+     return 0;
+ }
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681880-5-util-New-function-follow_symlinks.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681880-5-util-New-function-follow_symlinks.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681880-5-util-New-function-follow_symlinks.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681880-5-util-New-function-follow_symlinks.patch	2012-08-02 09:33:39.000000000 -0700
@@ -0,0 +1,265 @@
+From fee0c9631470e8eb10df25544f6661d0beb43a7a Mon Sep 17 00:00:00 2001
+From: Ben Pfaff <blp@nicira.com>
+Date: Mon, 30 Jul 2012 11:36:06 -0700
+Subject: [PATCH 3/7] util: New function follow_symlinks().
+
+It will acquire its first user in an upcoming commit.
+
+Signed-off-by: Ben Pfaff <blp@nicira.com>
+---
+ lib/util.c         |   85 +++++++++++++++++++++++++++++++++++++++++++++
+ lib/util.h         |    3 +
+ tests/file_name.at |   97 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ tests/test-util.c  |   13 ++++++
+ 4 files changed, 198 insertions(+)
+
+Index: b/lib/util.c
+===================================================================
+--- a/lib/util.c
++++ b/lib/util.c
+@@ -24,6 +24,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/stat.h>
+ #include <unistd.h>
+ #include "coverage.h"
+ #include "vlog.h"
+@@ -614,6 +615,90 @@ abs_file_name(const char *dir, const cha
+     }
+ }
+ 
++/* Like readlink(), but returns the link name as a null-terminated string in
++ * allocated memory that the caller must eventually free (with free()).
++ * Returns NULL on error, in which case errno is set appropriately. */
++char *
++xreadlink(const char *filename)
++{
++    size_t size;
++
++    for (size = 64; ; size *= 2) {
++        char *buf = xmalloc(size);
++        ssize_t retval = readlink(filename, buf, size);
++        int error = errno;
++
++        if (retval >= 0 && retval < size) {
++            buf[retval] = '\0';
++            return buf;
++        }
++
++        free(buf);
++        if (retval < 0) {
++            errno = error;
++            return NULL;
++        }
++    }
++}
++
++/* Returns a version of 'filename' with symlinks in the final component
++ * dereferenced.  This differs from realpath() in that:
++ *
++ *     - 'filename' need not exist.
++ *
++ *     - If 'filename' does exist as a symlink, its referent need not exist.
++ *
++ *     - Only symlinks in the final component of 'filename' are dereferenced.
++ *
++ * The caller must eventually free the returned string (with free()). */
++char *
++follow_symlinks(const char *filename)
++{
++    struct stat s;
++    char *fn;
++    int i;
++
++    fn = xstrdup(filename);
++    for (i = 0; i < 10; i++) {
++        char *linkname;
++        char *next_fn;
++
++        if (lstat(fn, &s) != 0 || !S_ISLNK(s.st_mode)) {
++            return fn;
++        }
++
++        linkname = xreadlink(fn);
++        if (!linkname) {
++            VLOG_WARN("%s: readlink failed (%s)", filename, strerror(errno));
++            return fn;
++        }
++
++        if (linkname[0] == '/') {
++            /* Target of symlink is absolute so use it raw. */
++            next_fn = linkname;
++        } else {
++            /* Target of symlink is relative so add to 'fn''s directory. */
++            char *dir = dir_name(fn);
++
++            if (!strcmp(dir, ".")) {
++                next_fn = linkname;
++            } else {
++                char *separator = dir[strlen(dir) - 1] == '/' ? "" : "/";
++                next_fn = xasprintf("%s%s%s", dir, separator, linkname);
++                free(linkname);
++            }
++
++            free(dir);
++        }
++
++        free(fn);
++        fn = next_fn;
++    }
++
++    VLOG_WARN("%s: too many levels of symlinks", filename);
++    free(fn);
++    return xstrdup(filename);
++}
+ 
+ /* Pass a value to this function if it is marked with
+  * __attribute__((warn_unused_result)) and you genuinely want to ignore
+Index: b/lib/util.h
+===================================================================
+--- a/lib/util.h
++++ b/lib/util.h
+@@ -201,6 +201,9 @@ char *dir_name(const char *file_name);
+ char *base_name(const char *file_name);
+ char *abs_file_name(const char *dir, const char *file_name);
+ 
++char *xreadlink(const char *filename);
++char *follow_symlinks(const char *filename);
++
+ void ignore(bool x OVS_UNUSED);
+ int log_2_floor(uint32_t);
+ int log_2_ceil(uint32_t);
+Index: b/tests/file_name.at
+===================================================================
+--- a/tests/file_name.at
++++ b/tests/file_name.at
+@@ -24,3 +24,100 @@ CHECK_FILE_NAME([dir/file], [dir], [file
+ CHECK_FILE_NAME([dir/file/], [dir], [file])
+ CHECK_FILE_NAME([dir/file//], [dir], [file])
+ CHECK_FILE_NAME([///foo], [/], [foo])
++
++AT_BANNER([test follow_symlinks function])
++
++m4_define([CHECK_FOLLOW],
++  [echo "check $1 -> $2"
++   AT_CHECK_UNQUOTED([test-util follow-symlinks "$1"], [0], [$2
++])
++   echo])
++
++AT_SETUP([follow_symlinks - relative symlinks])
++: > target
++ln -s target source
++AT_SKIP_IF([test ! -h source])
++CHECK_FOLLOW([source], [target])
++
++mkdir dir
++ln -s target2 dir/source2
++CHECK_FOLLOW([dir/source2], [dir/target2])
++
++mkdir dir/dir2
++ln -s dir/b a
++ln -s c dir/b
++ln -s dir2/d dir/c
++CHECK_FOLLOW([a], [dir/dir2/d])
++AT_CLEANUP
++
++AT_SETUP([follow_symlinks - absolute symlinks])
++: > target
++ln -s "`pwd`/target" source
++AT_SKIP_IF([test ! -h source])
++CHECK_FOLLOW([source], [`pwd`/target])
++
++mkdir dir
++ln -s "`pwd`/dir/target2" dir/source2
++CHECK_FOLLOW([dir/source2], [`pwd`/dir/target2])
++
++mkdir dir/dir2
++ln -s "`pwd`/dir/b" a
++ln -s "`pwd`/dir/c" dir/b
++ln -s "`pwd`/dir/dir2/d" dir/c
++CHECK_FOLLOW([a], [`pwd`/dir/dir2/d])
++AT_CLEANUP
++
++AT_SETUP([follow_symlinks - symlinks to directories])
++mkdir target
++ln -s target source
++AT_SKIP_IF([test ! -h source])
++ln -s target/ source2
++CHECK_FOLLOW([source], [target])
++CHECK_FOLLOW([source2], [target/])
++
++# follow_symlinks() doesn't expand symlinks in the middle of a name.
++: > source/x
++CHECK_FOLLOW([source/x], [source/x])
++AT_CLEANUP
++
++AT_SETUP([follow_symlinks - nonexistent targets])
++ln -s target source
++AT_SKIP_IF([test ! -h source])
++CHECK_FOLLOW([source], [target])
++CHECK_FOLLOW([target], [target])
++CHECK_FOLLOW([target], [target])
++AT_CLEANUP
++
++AT_SETUP([follow_symlinks - regular files])
++touch x
++CHECK_FOLLOW([x], [x])
++AT_CLEANUP
++
++AT_SETUP([follow_symlinks - device targets])
++AT_SKIP_IF([test ! -e /dev/null])
++AT_SKIP_IF([test ! -e /dev/full])
++ln -s /dev/null x
++ln -s /dev/full y
++CHECK_FOLLOW([x], [/dev/null])
++CHECK_FOLLOW([y], [/dev/full])
++AT_CLEANUP
++
++AT_SETUP([follow_symlinks - nonexistent files])
++CHECK_FOLLOW([nonexistent], [nonexistent])
++CHECK_FOLLOW([a/b/c], [a/b/c])
++CHECK_FOLLOW([/a/b/c], [/a/b/c])
++CHECK_FOLLOW([//a/b/c], [//a/b/c])
++AT_CLEANUP
++
++AT_SETUP([follow_symlinks - symlink loop])
++ln -s a b
++AT_SKIP_IF([test ! -h b])
++ln -s b a
++AT_SKIP_IF([test ! -h a])
++
++AT_CHECK([test-util follow-symlinks a], [0], [a
++], [stderr])
++AT_CHECK([sed 's/^[[^|]]*|//' stderr], [0],
++  [00001|util|WARN|a: too many levels of symlinks
++])
++AT_CLEANUP
+Index: b/tests/test-util.c
+===================================================================
+--- a/tests/test-util.c
++++ b/tests/test-util.c
+@@ -83,10 +83,23 @@ test_ctz(int argc OVS_UNUSED, char *argv
+     /* Check ctz(0). */
+     check_ctz(0, 32);
+ }
++
++static void
++test_follow_symlinks(int argc, char *argv[])
++{
++    int i;
++
++    for (i = 1; i < argc; i++) {
++        char *target = follow_symlinks(argv[i]);
++        puts(target);
++        free(target);
++    }
++}
+ 
+ static const struct command commands[] = {
+     {"ctz", 0, 0, test_ctz},
+     {"log_2_floor", 0, 0, test_log_2_floor},
++    {"follow-symlinks", 1, INT_MAX, test_follow_symlinks},
+     {NULL, 0, 0, NULL},
+ };
+ 
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681880-6-lockfile-Be-more-forgiving-about-lockfiles-for-symli.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681880-6-lockfile-Be-more-forgiving-about-lockfiles-for-symli.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681880-6-lockfile-Be-more-forgiving-about-lockfiles-for-symli.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681880-6-lockfile-Be-more-forgiving-about-lockfiles-for-symli.patch	2012-08-02 09:33:39.000000000 -0700
@@ -0,0 +1,120 @@
+From b1fdc5fb270c0ca21de4bbe5002aca4dd79e9911 Mon Sep 17 00:00:00 2001
+From: Ben Pfaff <blp@nicira.com>
+Date: Mon, 30 Jul 2012 14:41:13 -0700
+Subject: [PATCH 4/7] lockfile: Be more forgiving about lockfiles for symlinks.
+
+As the database is being transitioned from /etc to /var, there is a symlink
+from the old to the new location for the database and a symlink for its
+lockfile.  This works OK, but it would be more user-friendly to still work
+correctly in case the symlink for the lockfile isn't there (since its
+existence is non-obvious), so this commit implements that behavior.
+
+Signed-off-by: Ben Pfaff <blp@nicira.com>
+---
+ lib/lockfile.c        |   29 +++++++++++++++++++++--------
+ tests/lockfile.at     |    1 +
+ tests/test-lockfile.c |   30 ++++++++++++++++++++++++++++++
+ 3 files changed, 52 insertions(+), 8 deletions(-)
+
+diff --git a/lib/lockfile.c b/lib/lockfile.c
+index c55be66..7ac3465 100644
+--- a/lib/lockfile.c
++++ b/lib/lockfile.c
+@@ -59,16 +59,29 @@ static int lockfile_try_lock(const char *name, bool block,
+                              struct lockfile **lockfilep);
+ 
+ /* Returns the name of the lockfile that would be created for locking a file
+- * named 'file_name'.  The caller is responsible for freeing the returned
+- * name, with free(), when it is no longer needed. */
++ * named 'filename_'.  The caller is responsible for freeing the returned name,
++ * with free(), when it is no longer needed. */
+ char *
+-lockfile_name(const char *file_name)
++lockfile_name(const char *filename_)
+ {
+-    const char *slash = strrchr(file_name, '/');
+-    return (slash
+-            ? xasprintf("%.*s/.%s.~lock~",
+-                        (int) (slash - file_name), file_name, slash + 1)
+-            : xasprintf(".%s.~lock~", file_name));
++    char *filename;
++    const char *slash;
++    char *lockname;
++
++    /* If 'filename_' is a symlink, base the name of the lockfile on the
++     * symlink's target rather than the name of the symlink.  That way, if a
++     * file is symlinked, but there is no symlink for its lockfile, then there
++     * is only a single lockfile for both the source and the target of the
++     * symlink, not one for each. */
++    filename = follow_symlinks(filename_);
++    slash = strrchr(filename, '/');
++    lockname = (slash
++                ? xasprintf("%.*s/.%s.~lock~",
++                            (int) (slash - filename), filename, slash + 1)
++                : xasprintf(".%s.~lock~", filename));
++    free(filename);
++
++    return lockname;
+ }
+ 
+ /* Locks the configuration file against modification by other processes and
+diff --git a/tests/lockfile.at b/tests/lockfile.at
+index 1fa0342..602cfab 100644
+--- a/tests/lockfile.at
++++ b/tests/lockfile.at
+@@ -19,3 +19,4 @@ CHECK_LOCKFILE([lock_timeout_gets_the_lock], [1])
+ CHECK_LOCKFILE([lock_timeout_runs_out], [1])
+ CHECK_LOCKFILE([lock_multiple], [0])
+ CHECK_LOCKFILE([lock_symlink], [0])
++CHECK_LOCKFILE([lock_symlink_to_dir], [0])
+diff --git a/tests/test-lockfile.c b/tests/test-lockfile.c
+index 808ed1e..412010b 100644
+--- a/tests/test-lockfile.c
++++ b/tests/test-lockfile.c
+@@ -249,6 +249,35 @@ run_lock_symlink(void)
+     CHECK(S_ISREG(s.st_mode) != 0, 1);
+ }
+ 
++/* Checks that locking a file that is itself a symlink yields a lockfile in the
++ * directory that the symlink points to, named for the target of the
++ * symlink.
++ *
++ * (That is, if "a" is a symlink to "dir/b", then "a"'s lockfile is named
++ * "dir/.b.~lock".) */
++static void
++run_lock_symlink_to_dir(void)
++{
++    struct lockfile *a, *dummy;
++    struct stat s;
++
++    /* Create a symlink "a" pointing to "dir/b". */
++    CHECK(mkdir("dir", 0700), 0);
++    CHECK(symlink("dir/b", "a"), 0);
++    CHECK(lstat("a", &s), 0);
++    CHECK(S_ISLNK(s.st_mode) != 0, 1);
++
++    /* Lock 'a'. */
++    CHECK(lockfile_lock("a", 0, &a), 0);
++    CHECK(lstat("dir/.b.~lock~", &s), 0);
++    CHECK(S_ISREG(s.st_mode) != 0, 1);
++    CHECK(lstat(".a.~lock~", &s), -1);
++    CHECK(errno, ENOENT);
++    CHECK(lockfile_lock("dir/b", 0, &dummy), EDEADLK);
++
++    lockfile_unlock(a);
++}
++
+ static void
+ run_help(void)
+ {
+@@ -275,6 +304,7 @@ static const struct test tests[] = {
+     TEST(lock_timeout_runs_out),
+     TEST(lock_multiple),
+     TEST(lock_symlink),
++    TEST(lock_symlink_to_dir),
+     TEST(help),
+     { NULL, NULL }
+ #undef TEST
+-- 
+1.7.2.5
+
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681880-7-ovsdb-Do-not-replace-symlinks-by-regular-files-durin.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681880-7-ovsdb-Do-not-replace-symlinks-by-regular-files-durin.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681880-7-ovsdb-Do-not-replace-symlinks-by-regular-files-durin.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681880-7-ovsdb-Do-not-replace-symlinks-by-regular-files-durin.patch	2012-08-02 09:33:39.000000000 -0700
@@ -0,0 +1,159 @@
+From a35ae81c6f79ab24e621a9d155538f5b88c5c2ac Mon Sep 17 00:00:00 2001
+From: Ben Pfaff <blp@nicira.com>
+Date: Mon, 30 Jul 2012 14:55:10 -0700
+Subject: [PATCH 5/7] ovsdb: Do not replace symlinks by regular files during compaction.
+
+Signed-off-by: Ben Pfaff <blp@nicira.com>
+---
+ ovsdb/file.c          |    5 ++++-
+ ovsdb/ovsdb-tool.c    |   22 ++++++++++++++++------
+ tests/ovsdb-server.at |   15 ++++++++++++++-
+ tests/ovsdb-tool.at   |   14 +++++++++++++-
+ 4 files changed, 47 insertions(+), 9 deletions(-)
+
+Index: b/ovsdb/file.c
+===================================================================
+--- a/ovsdb/file.c
++++ b/ovsdb/file.c
+@@ -531,11 +531,14 @@ ovsdb_file_create(struct ovsdb *db, stru
+ {
+     long long int now = time_msec();
+     struct ovsdb_file *file;
++    char *deref_name;
+     char *abs_name;
+ 
+     /* Use the absolute name of the file because ovsdb-server opens its
+      * database before daemonize() chdirs to "/". */
+-    abs_name = abs_file_name(NULL, file_name);
++    deref_name = follow_symlinks(file_name);
++    abs_name = abs_file_name(NULL, deref_name);
++    free(deref_name);
+     if (!abs_name) {
+         *filep = NULL;
+         return ovsdb_io_error(0, "could not determine current "
+Index: b/ovsdb/ovsdb-tool.c
+===================================================================
+--- a/ovsdb/ovsdb-tool.c
++++ b/ovsdb/ovsdb-tool.c
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2009, 2010, 2011 Nicira Networks.
++ * Copyright (c) 2009, 2010, 2011, 2012 Nicira Networks.
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -181,16 +181,26 @@ do_create(int argc OVS_UNUSED, char *arg
+ }
+ 
+ static void
+-compact_or_convert(const char *src_name, const char *dst_name,
++compact_or_convert(const char *src_name_, const char *dst_name_,
+                    const struct ovsdb_schema *new_schema,
+                    const char *comment)
+ {
++    char *src_name, *dst_name;
+     struct lockfile *src_lock;
+     struct lockfile *dst_lock;
+-    bool in_place = dst_name == NULL;
++    bool in_place = dst_name_ == NULL;
+     struct ovsdb *db;
+     int retval;
+ 
++    /* Dereference symlinks for source and destination names.  In the in-place
++     * case this ensures that, if the source name is a symlink, we replace its
++     * target instead of replacing the symlink by a regular file.  In the
++     * non-in-place, this has the same effect for the destination name. */
++    src_name = follow_symlinks(src_name_);
++    dst_name = (in_place
++                ? xasprintf("%s.tmp", src_name)
++                : follow_symlinks(dst_name_));
++
+     /* Lock the source, if we will be replacing it. */
+     if (in_place) {
+         retval = lockfile_lock(src_name, 0, &src_lock);
+@@ -200,9 +210,6 @@ compact_or_convert(const char *src_name,
+     }
+ 
+     /* Get (temporary) destination and lock it. */
+-    if (in_place) {
+-        dst_name = xasprintf("%s.tmp", src_name);
+-    }
+     retval = lockfile_lock(dst_name, 0, &dst_lock);
+     if (retval) {
+         ovs_fatal(retval, "%s: failed to lock lockfile", dst_name);
+@@ -226,6 +233,9 @@ compact_or_convert(const char *src_name,
+     }
+ 
+     lockfile_unlock(dst_lock);
++
++    free(src_name);
++    free(dst_name);
+ }
+ 
+ static void
+Index: b/tests/ovsdb-server.at
+===================================================================
+--- a/tests/ovsdb-server.at
++++ b/tests/ovsdb-server.at
+@@ -254,8 +254,15 @@ AT_SETUP([compacting online])
+ AT_KEYWORDS([ovsdb server compact])
+ AT_DATA([schema], [ORDINAL_SCHEMA
+ ])
+-touch .db.~lock~
++dnl Make sure that "ovsdb-tool create" works with a dangling symlink for
++dnl the database and the lockfile, creating the target of each symlink rather
++dnl than replacing the symlinks with regular files.
++mkdir dir
++ln -s dir/db db
++ln -s dir/.db.~lock~ .db.~lock~
++AT_SKIP_IF([test ! -h db || test ! -h .db.~lock~])
+ AT_CHECK([ovsdb-tool create db schema], [0], [ignore], [ignore])
++dnl Start ovsdb-server.
+ AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --unixctl=$PWD/unixctl --remote=punix:socket --log-file=$PWD/ovsdb-server.log db], [0], [ignore], [ignore])
+ AT_CAPTURE_FILE([ovsdb-server.log])
+ dnl Do a bunch of random transactions that put crap in the database log.
+@@ -324,6 +331,12 @@ _uuid                                nam
+ dnl Now compact the database in-place.
+ AT_CHECK([[ovs-appctl -t $PWD/unixctl ovsdb-server/compact]],
+   [0], [], [ignore], [test ! -e pid || kill `cat pid`])
++dnl Make sure that "db" is still a symlink to dir/db instead of getting
++dnl replaced by a regular file, ditto for .db.~lock~.
++AT_CHECK([test -h db])
++AT_CHECK([test -h .db.~lock~])
++AT_CHECK([test -f dir/db])
++AT_CHECK([test -f dir/.db.~lock~])
+ dnl We can't fully re-check the contents of the database log, because the
+ dnl order of the records is not predictable, but there should only be 4 lines
+ dnl in it now.
+Index: b/tests/ovsdb-tool.at
+===================================================================
+--- a/tests/ovsdb-tool.at
++++ b/tests/ovsdb-tool.at
+@@ -52,7 +52,14 @@ AT_SETUP([ovsdb-tool compact])
+ AT_KEYWORDS([ovsdb file positive])
+ AT_DATA([schema], [ORDINAL_SCHEMA
+ ])
+-touch .db.~lock~
++dnl Make sure that "ovsdb-tool create" works with a dangling symlink,
++dnl creating the target of the symlink rather than replacing the symlink
++dnl with a regular file, and that the lockfile gets created relative to
++dnl the symlink's target.
++mkdir dir
++: > dir/.db.~lock~
++ln -s dir/db db
++AT_SKIP_IF([test ! -h db])
+ AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
+ dnl Do a bunch of random transactions that put crap in the database log.
+ AT_CHECK(
+@@ -120,6 +127,11 @@ _uuid                                nam
+ dnl Now compact the database in-place.
+ touch .db.tmp.~lock~
+ AT_CHECK([[ovsdb-tool compact db]], [0], [], [ignore])
++dnl Make sure that "db" is still a symlink to dir/db instead of getting
++dnl replaced by a regular file.
++AT_CHECK([test ! -e .db.~lock])
++AT_CHECK([test -h db])
++AT_CHECK([test -f dir/db])
+ dnl We can't fully re-check the contents of the database log, because the
+ dnl order of the records is not predictable, but there should only be 4 lines
+ dnl in it now.
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681880-8-Fix-a-typo-in-commit-f973f2af2.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681880-8-Fix-a-typo-in-commit-f973f2af2.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681880-8-Fix-a-typo-in-commit-f973f2af2.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681880-8-Fix-a-typo-in-commit-f973f2af2.patch	2012-08-02 14:17:58.000000000 -0700
@@ -0,0 +1,24 @@
+From be867c2fedbdd8ff9bd8f4129e3c6e64a7eb3e3d Mon Sep 17 00:00:00 2001
+From: Mehak Mahajan <mmahajan@nicira.com>
+Date: Wed, 1 Aug 2012 19:57:03 -0700
+Subject: [PATCH] Fix a typo in commit f973f2af2.
+
+Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
+---
+ python/ovs/dirs.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/python/ovs/dirs.py b/python/ovs/dirs.py
+index a5717fc..e4b37f9 100644
+--- a/python/ovs/dirs.py
++++ b/python/ovs/dirs.py
+@@ -5,5 +5,5 @@ import os
+ PKGDATADIR = os.environ.get("OVS_PKGDATADIR", "/usr/local/share/openvswitch")
+ RUNDIR = os.environ.get("OVS_RUNDIR", "/var/run")
+ LOGDIR = os.environ.get("OVS_LOGDIR", "/usr/local/var/log")
+-LOGDIR = os.environ.get("OVS_DBDIR", "/usr/local/etc/openvswitch")
++DBDIR = os.environ.get("OVS_DBDIR", "/usr/local/etc/openvswitch")
+ BINDIR = os.environ.get("OVS_BINDIR", "/usr/local/bin")
+-- 
+1.7.2.5
+
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681880-9-dirs-dbdir-default-must-be-based-on-sysconfdir.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681880-9-dirs-dbdir-default-must-be-based-on-sysconfdir.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681880-9-dirs-dbdir-default-must-be-based-on-sysconfdir.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681880-9-dirs-dbdir-default-must-be-based-on-sysconfdir.patch	2012-08-02 17:12:54.000000000 -0700
@@ -0,0 +1,179 @@
+From 678198995adc4c57e35f83bbdfcd91b979ae1622 Mon Sep 17 00:00:00 2001
+From: Ben Pfaff <blp@nicira.com>
+Date: Thu, 2 Aug 2012 16:01:49 -0700
+Subject: [PATCH] dirs: dbdir default must be based on sysconfdir.
+
+Some in-tree and out-of-tree code sets the OVS_SYSCONFDIR environment
+variable to control where /etc files go (mostly for test purposes).  When
+the database directory (dbdir) was split off from the sysconfdir, the
+configure-time default continued to be based on the sysconfdir, but
+overriding the sysconfdir at runtime with OVS_SYSCONFDIR didn't have any
+effect on the dbdir, which caused a visible change in behavior for code
+that set the OVS_SYSCONFDIR environment variable.  This commit reverts that
+change in behavior, by basing the dbdir on OVS_SYSCONFDIR if that
+environment variable is set (but the OVS_DBDIR environment variable is
+not).
+
+Signed-off-by: Ben Pfaff <blp@nicira.com>
+---
+ lib/dirs.c.in               |   15 +++++++++++++--
+ python/automake.mk          |   29 +++++++++++++++++++++++------
+ python/ovs/dirs.py          |   20 ++++++++++++--------
+ python/ovs/dirs.py.template |   17 +++++++++++++++++
+ utilities/ovs-lib.in        |   11 +++++++++--
+ 5 files changed, 74 insertions(+), 18 deletions(-)
+ create mode 100644 python/ovs/dirs.py.template
+
+Index: b/lib/dirs.c.in
+===================================================================
+--- a/lib/dirs.c.in
++++ b/lib/dirs.c.in
+@@ -18,6 +18,7 @@
+ #include <config.h>
+ #include "dirs.h"
+ #include <stdlib.h>
++#include "util.h"
+ 
+ struct directory {
+     const char *value;          /* Actual value; NULL if not yet determined. */
+@@ -68,8 +69,18 @@ ovs_logdir(void)
+ const char *
+ ovs_dbdir(void)
+ {
+-    static struct directory d = { NULL, @DBDIR@, "OVS_DBDIR" };
+-    return get_dir(&d);
++    static const char *dbdir;
++    if (!dbdir) {
++        dbdir = getenv("OVS_DBDIR");
++        if (!dbdir || !dbdir[0]) {
++            char *sysconfdir = getenv("OVS_SYSCONFDIR");
++
++            dbdir = (sysconfdir
++                     ? xasprintf("%s/openvswitch", sysconfdir)
++                     : @DBDIR@);
++        }
++    }
++    return dbdir;
+ }
+ 
+ const char *
+Index: b/python/automake.mk
+===================================================================
+--- a/python/automake.mk
++++ b/python/automake.mk
+@@ -36,12 +36,15 @@ if HAVE_PYTHON
+ nobase_pkgdata_DATA = $(ovs_pyfiles) $(ovstest_pyfiles)
+ ovs-install-data-local:
+ 	$(MKDIR_P) python/ovs
+-	(echo "import os" && \
+-	 echo 'PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """$(pkgdatadir)""")' && \
+-	 echo 'RUNDIR = os.environ.get("OVS_RUNDIR", """@RUNDIR@""")' && \
+-	 echo 'LOGDIR = os.environ.get("OVS_LOGDIR", """@LOGDIR@""")' && \
+-	 echo 'DBDIR = os.environ.get("OVS_DBDIR", """@DBDIR@""")' && \
+-	 echo 'BINDIR = os.environ.get("OVS_BINDIR", """$(bindir)""")') \
++	sed \
++		-e '/^##/d' \
++                -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
++                -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
++                -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
++                -e 's,[@]bindir[@],$(bindir),g' \
++                -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
++                -e 's,[@]DBDIR[@],$(DBDIR),g' \
++		< $(srcdir)/python/ovs/dirs.py.template \
+ 		> python/ovs/dirs.py.tmp
+ 	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs
+ 	$(INSTALL_DATA) python/ovs/dirs.py.tmp $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
+@@ -55,3 +58,17 @@ install-data-local: ovs-install-data-loc
+ UNINSTALL_LOCAL += ovs-uninstall-local
+ ovs-uninstall-local:
+ 	rm -f $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
++
++ALL_LOCAL += $(srcdir)/python/ovs/dirs.py
++$(srcdir)/python/ovs/dirs.py: python/ovs/dirs.py.template
++	sed \
++		-e '/^##/d' \
++                -e 's,[@]pkgdatadir[@],/usr/local/share/openvswitch,g' \
++                -e 's,[@]RUNDIR[@],/var/run,g' \
++                -e 's,[@]LOGDIR[@],/usr/local/var/log,g' \
++                -e 's,[@]bindir[@],/usr/local/bin,g' \
++                -e 's,[@]sysconfdir[@],/usr/local/etc,g' \
++                -e 's,[@]DBDIR[@],/usr/local/etc/openvswitch,g' \
++		< $? > $@.tmp
++	mv $@.tmp $@
++EXTRA_DIST += python/ovs/dirs.py python/ovs/dirs.py.template
+Index: b/python/ovs/dirs.py
+===================================================================
+--- a/python/ovs/dirs.py
++++ b/python/ovs/dirs.py
+@@ -1,9 +1,13 @@
+-# These are the default directories.  They will be replaced by the
+-# configured directories at install time.
+-
+ import os
+-PKGDATADIR = os.environ.get("OVS_PKGDATADIR", "/usr/local/share/openvswitch")
+-RUNDIR = os.environ.get("OVS_RUNDIR", "/var/run")
+-LOGDIR = os.environ.get("OVS_LOGDIR", "/usr/local/var/log")
+-DBDIR = os.environ.get("OVS_DBDIR", "/usr/local/etc/openvswitch")
+-BINDIR = os.environ.get("OVS_BINDIR", "/usr/local/bin")
++PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """/usr/local/share/openvswitch""")
++RUNDIR = os.environ.get("OVS_RUNDIR", """/var/run""")
++LOGDIR = os.environ.get("OVS_LOGDIR", """/usr/local/var/log""")
++BINDIR = os.environ.get("OVS_BINDIR", """/usr/local/bin""")
++
++DBDIR = os.environ.get("OVS_DBDIR")
++if not DBDIR:
++    sysconfdir = os.environ.get("OVS_SYSCONFDIR")
++    if sysconfdir:
++        DBDIR = "%s/openvswitch" % sysconfdir
++    else:
++        DBDIR = """/usr/local/etc/openvswitch"""
+Index: b/python/ovs/dirs.py.template
+===================================================================
+--- /dev/null
++++ b/python/ovs/dirs.py.template
+@@ -0,0 +1,17 @@
++## The @variables@ in this file are replaced by default directories for
++## use in python/ovs/dirs.py in the source directory and replaced by the
++## configured directories for use in the installed python/ovs/dirs.py.
++##
++import os
++PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """@pkgdatadir@""")
++RUNDIR = os.environ.get("OVS_RUNDIR", """@RUNDIR@""")
++LOGDIR = os.environ.get("OVS_LOGDIR", """@LOGDIR@""")
++BINDIR = os.environ.get("OVS_BINDIR", """@bindir@""")
++
++DBDIR = os.environ.get("OVS_DBDIR")
++if not DBDIR:
++    sysconfdir = os.environ.get("OVS_SYSCONFDIR")
++    if sysconfdir:
++        DBDIR = "%s/openvswitch" % sysconfdir
++    else:
++        DBDIR = """@DBDIR@"""
+Index: b/utilities/ovs-lib.in
+===================================================================
+--- a/utilities/ovs-lib.in
++++ b/utilities/ovs-lib.in
+@@ -22,14 +22,21 @@
+ # All of these should be substituted by the Makefile at build time.
+ logdir=${OVS_LOGDIR-'@LOGDIR@'}                 # /var/log/openvswitch
+ rundir=${OVS_RUNDIR-'@RUNDIR@'}                 # /var/run/openvswitch
+-dbdir=${OVS_DBDIR-'@DBDIR@'}                    # /etc/openvswitch
+-                                                # or /var/lib/openvswitch
+ sysconfdir=${OVS_SYSCONFDIR-'@sysconfdir@'}     # /etc
+ etcdir=$sysconfdir/openvswitch                  # /etc/openvswitch
+ datadir=${OVS_PKGDATADIR-'@pkgdatadir@'}        # /usr/share/openvswitch
+ bindir=${OVS_BINDIR-'@bindir@'}                 # /usr/bin
+ sbindir=${OVS_SBINDIR-'@sbindir@'}              # /usr/sbin
+ 
++# /etc/openvswitch or /var/lib/openvswitch
++if test X"$OVS_DBDIR" != X; then
++    dbdir=$OVS_DBDIR
++elif test X"$OVS_SYSCONFDIR" != X; then
++    dbdir=$OVS_SYSCONFDIR/openvswitch
++else
++    dbdir='@DBDIR@'
++fi
++
+ VERSION='@VERSION@'
+ case @BUILDNR@ in
+     [1-9]*) BUILDNR='+build@BUILDNR@' ;;
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-681955-ovs-ctl-Start-the-rest-of-Open-vSwitch.patch openvswitch-1.4.2+git20120612/debian/patches/bug-681955-ovs-ctl-Start-the-rest-of-Open-vSwitch.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-681955-ovs-ctl-Start-the-rest-of-Open-vSwitch.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-681955-ovs-ctl-Start-the-rest-of-Open-vSwitch.patch	2012-08-02 09:33:39.000000000 -0700
@@ -0,0 +1,37 @@
+From 1d960e27d88625baae03a4bd3b60c7647f6aea6a Mon Sep 17 00:00:00 2001
+From: Ben Pfaff <blp@nicira.com>
+Date: Thu, 26 Jul 2012 15:41:34 -0700
+Subject: [PATCH] ovs-ctl: Start the rest of Open vSwitch if loading brcompat module fails.
+
+This may be more useful in practice than failing the entire OVS startup
+sequence.
+
+Debian bug #681955.
+CC: 681955@bugs.debian.org
+Reported-by: Bastian Blank <waldi@debian.org>
+Signed-off-by: Ben Pfaff <blp@nicira.com>
+---
+ utilities/ovs-ctl.in |    7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
+index 552cef3..59c2a31 100755
+--- a/utilities/ovs-ctl.in
++++ b/utilities/ovs-ctl.in
+@@ -64,7 +64,12 @@ insert_brcompat_mod_if_required () {
+ insert_mod_if_required () {
+     insert_openvswitch_mod_if_required || return 1
+     if test X"$BRCOMPAT" = Xyes; then
+-        insert_brcompat_mod_if_required || return 1
++        if insert_brcompat_mod_if_required; then
++            :
++        else
++            log_warning_msg "could not load brcompat module, disabling bridge compatibility"
++            BRCOMPAT=no
++        fi
+     fi
+ }
+ 
+-- 
+1.7.2.5
+
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/bug-683665-use-mode-700-for-pki-incoming-dir.patch openvswitch-1.4.2+git20120612/debian/patches/bug-683665-use-mode-700-for-pki-incoming-dir.patch
--- openvswitch-1.4.2+git20120612/debian/patches/bug-683665-use-mode-700-for-pki-incoming-dir.patch	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/bug-683665-use-mode-700-for-pki-incoming-dir.patch	2012-08-02 10:30:30.000000000 -0700
@@ -0,0 +1,38 @@
+Subject: Use mode 0700 for ovs-pki incoming directory, instead of 0733.
+
+Andreas Beckmann <debian@abeckmann.de> reported in bug #683665 that
+the openvswitch-pki package creates a world-writable directory during
+installation.  I believe that the intended use of this directory is
+safe, because the file names are supposed to be the SHA-1 hash of a
+freshly generated SSL client certificate, but the feature in question
+is one that has not been widely used in Open vSwitch.  I'm not aware of
+even a single user, the intended client software is not packaged
+for Debian, and I intend to remove the feature from a later version
+of Open vSwitch entirely.  Therefore, this patch simply changes the
+directory's permissions to be only writable by root.
+
+---
+ utilities/ovs-pki.in |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: b/utilities/ovs-pki.in
+===================================================================
+--- a/utilities/ovs-pki.in
++++ b/utilities/ovs-pki.in
+@@ -1,6 +1,6 @@
+ #! /bin/sh
+ 
+-# Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks, Inc.
++# Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks, Inc.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+@@ -214,7 +214,7 @@ if test "$command" = "init"; then
+ 
+         mkdir -p certs crl newcerts
+         mkdir -p -m 0700 private
+-        mkdir -p -m 0733 incoming
++        mkdir -p -m 0700 incoming
+         touch index.txt
+         test -e crlnumber || echo 01 > crlnumber
+         test -e serial || echo 01 > serial
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/debian-changes-1.4.2+git20120612-6 openvswitch-1.4.2+git20120612/debian/patches/debian-changes-1.4.2+git20120612-6
--- openvswitch-1.4.2+git20120612/debian/patches/debian-changes-1.4.2+git20120612-6	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/debian-changes-1.4.2+git20120612-6	2012-08-02 09:33:39.000000000 -0700
@@ -0,0 +1,83 @@
+Description: Upstream changes introduced in version 1.4.2+git20120612-6
+ This patch has been created by dpkg-source during the package build.
+ Here's the last changelog entry, hopefully it gives details on why
+ those changes were made:
+ .
+ openvswitch (1.4.2+git20120612-6) unstable; urgency=low
+ .
+   * utilities/automake.mk: Fix duplicate mention of ovs-vsctl in
+     bin_PROGRAMS and bin_SCRIPTS; it should only have been in the former.
+     Closes: #682384.  Thanks to Bastian Blank <waldi@debian.org> for
+     reporting this bug.
+ .
+ The person named in the Author field signed this changelog entry.
+Author: Ben Pfaff <pfaffben@debian.org>
+Bug-Debian: http://bugs.debian.org/682384
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+--- openvswitch-1.4.2+git20120612.orig/Makefile.in
++++ openvswitch-1.4.2+git20120612/Makefile.in
+@@ -687,6 +687,7 @@ am__noinst_HEADERS_DIST = CodingStyle DE
+ 	debian/openvswitch-controller.install \
+ 	debian/openvswitch-controller.manpages \
+ 	debian/openvswitch-controller.postinst \
++	debian/openvswitch-controller.postrm \
+ 	debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in \
+ 	debian/openvswitch-datapath-dkms.postinst \
+ 	debian/openvswitch-datapath-dkms.prerm \
+@@ -1030,6 +1031,7 @@ EXTRA_DIST = CodingStyle DESIGN INSTALL.
+ 	debian/openvswitch-controller.install \
+ 	debian/openvswitch-controller.manpages \
+ 	debian/openvswitch-controller.postinst \
++	debian/openvswitch-controller.postrm \
+ 	debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in \
+ 	debian/openvswitch-datapath-dkms.postinst \
+ 	debian/openvswitch-datapath-dkms.prerm \
+@@ -1092,8 +1094,8 @@ EXTRA_DIST = CodingStyle DESIGN INSTALL.
+ 	xenserver/usr_share_openvswitch_scripts_sysconfig.template \
+ 	$(ovs_pyfiles) python/ovs/dirs.py $(ovstest_pyfiles) \
+ 	python/compat/uuid.py python/compat/argparse.py
+-bin_SCRIPTS = utilities/ovs-pki utilities/ovs-vsctl \
+-	utilities/ovs-parse-leaks $(am__append_12)
++bin_SCRIPTS = utilities/ovs-pki utilities/ovs-parse-leaks \
++	$(am__append_12)
+ DIST_HOOKS = check-debian-changelog-version
+ dist_man_MANS = utilities/ovs-ctl.8 vswitchd/ovs-vswitchd.conf.db.5
+ dist_pkgdata_DATA = 
+--- openvswitch-1.4.2+git20120612.orig/datapath/Makefile.in
++++ openvswitch-1.4.2+git20120612/datapath/Makefile.in
+@@ -299,9 +299,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefi
+ 	      exit 1;; \
+ 	  esac; \
+ 	done; \
+-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign datapath/Makefile'; \
++	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu datapath/Makefile'; \
+ 	$(am__cd) $(top_srcdir) && \
+-	  $(AUTOMAKE) --foreign datapath/Makefile
++	  $(AUTOMAKE) --gnu datapath/Makefile
+ .PRECIOUS: Makefile
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ 	@case '$?' in \
+--- openvswitch-1.4.2+git20120612.orig/utilities/automake.mk
++++ openvswitch-1.4.2+git20120612/utilities/automake.mk
+@@ -4,7 +4,7 @@ bin_PROGRAMS += \
+ 	utilities/ovs-dpctl \
+ 	utilities/ovs-ofctl \
+ 	utilities/ovs-vsctl
+-bin_SCRIPTS += utilities/ovs-pki utilities/ovs-vsctl utilities/ovs-parse-leaks
++bin_SCRIPTS += utilities/ovs-pki utilities/ovs-parse-leaks
+ if HAVE_PYTHON
+ bin_SCRIPTS += \
+ 	utilities/ovs-pcap \
diff -Nru openvswitch-1.4.2+git20120612/debian/patches/series openvswitch-1.4.2+git20120612/debian/patches/series
--- openvswitch-1.4.2+git20120612/debian/patches/series	1969-12-31 16:00:00.000000000 -0800
+++ openvswitch-1.4.2+git20120612/debian/patches/series	2012-08-02 17:14:47.000000000 -0700
@@ -0,0 +1,16 @@
+debian-changes-1.4.2+git20120612-6
+
+bug-681955-ovs-ctl-Start-the-rest-of-Open-vSwitch.patch
+
+bug-681880-1-lockfile-Fix-hang-locking-through-a-dangling-symlink.patch
+bug-681880-2-ovsdb-Make-ovsdb-tool-create-work-through-a-dangling.patch
+bug-681880-3-Make-the-location-of-the-database-separately-configu.patch
+bug-681880-4-tests-Slightly-generalize-utility-function-tests.patch
+bug-681880-5-util-New-function-follow_symlinks.patch
+bug-681880-6-lockfile-Be-more-forgiving-about-lockfiles-for-symli.patch
+bug-681880-7-ovsdb-Do-not-replace-symlinks-by-regular-files-durin.patch
+bug-681880-8-Fix-a-typo-in-commit-f973f2af2.patch
+bug-681880-9-dirs-dbdir-default-must-be-based-on-sysconfdir.patch
+
+bug-683665-use-mode-700-for-pki-incoming-dir.patch
+debian-changes-1.4.2+git20120612-8
diff -Nru openvswitch-1.4.2+git20120612/debian/rules openvswitch-1.4.2+git20120612/debian/rules
--- openvswitch-1.4.2+git20120612/debian/rules	2012-06-12 10:17:04.000000000 -0700
+++ openvswitch-1.4.2+git20120612/debian/rules	2012-08-02 09:33:42.000000000 -0700
@@ -48,6 +48,7 @@
 		test -e Makefile || \
 		../configure --prefix=/usr --localstatedir=/var --enable-ssl \
 			--sysconfdir=/etc $(BUILD_NUMBER_OPTION) \
+			--with-dbdir=/var/lib/openvswitch \
 			CFLAGS="$(CFLAGS)" $(DATAPATH_CONFIGURE_OPTS))
 	touch configure-stamp
 

--- End Message ---
--- Begin Message ---
On 07/08/12 06:57, Ben Pfaff wrote:
On Fri, Aug 03, 2012 at 11:21:08AM -0700, Ben Pfaff wrote:
Package: release.debian.org
User: release.debian.org@packages.debian.org
Usertags: unblock
Severity: normal

openvswitch 1.4.2+git20120612-2 is currently in wheezy.
openvswitch 1.4.2+git20120612-8, currently in sid, fixes the following
release-critical bugs:

         #680536 openvswitch - Fails to start without /etc/protocols
         #680537 openvswitch - Plays with iptables without consent
         #681880 openvswitch-switch - Automatic changed file in /etc/
         #681955 openvswitch-switch - Enabling brcompat breaks normal
            operation
         #682187 openvswitch-controller: unowned files after purge
            (policy 6.8, 10.8)
         #682384 odd s390 build failure for openvswitch
         #683665 openvswitch-pki: creates world writable directories:
            /var/lib/openvswitch/pki/*ca/incoming/

openvswitch 1.4.2+git20120612-9 that is now in sid fixes the following
"important" bug:

         #684057 openvswitch-switch - Does not start with upstream
            openvswitch module



Unblocked.

Regards,

--
Mehdi Dogguy مهدي الدڤي
http://dogguy.org/

--- End Message ---

Reply to: