[packages] quagga-unstable: fix mini_fo assertion triggered by cross-fs link() (...
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 14 Jan 2010 19:19:22 +0000 (19:19 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 14 Jan 2010 19:19:22 +0000 (19:19 +0000)
SVN-Revision: 19137

net/quagga-unstable/Makefile
net/quagga-unstable/patches/150-no-cross-fs-link.patch [new file with mode: 0644]

index a8c597dba3a85ce9a50c7abd5b23f5cd43b468f0..2088495826c374e002f96f8ac644f1088e01a1c7 100644 (file)
@@ -1,5 +1,5 @@
 #
 #
-# Copyright (C) 2009 OpenWrt.org
+# Copyright (C) 2009-2010 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=quagga-unstable
 PKG_VERSION:=0.99.15
 
 PKG_NAME:=quagga-unstable
 PKG_VERSION:=0.99.15
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=quagga-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.quagga.net/download/ \
 
 PKG_SOURCE:=quagga-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.quagga.net/download/ \
diff --git a/net/quagga-unstable/patches/150-no-cross-fs-link.patch b/net/quagga-unstable/patches/150-no-cross-fs-link.patch
new file mode 100644 (file)
index 0000000..ec66786
--- /dev/null
@@ -0,0 +1,40 @@
+--- a/lib/command.c
++++ b/lib/command.c
+@@ -2601,6 +2601,13 @@
+                VTY_NEWLINE);
+         goto finished;
+       }
++
++#if 0
++  /* This code fails on UNION MOUNTs and similar filesystems if the
++   * config file is still on the RO layer. Hardlinks across layers
++   * will not work and cause quagga to fail saving the configuration...
++   * should use rename() to move files around...
++   */
+   if (link (config_file, config_file_sav) != 0)
+     {
+       vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
+@@ -2614,7 +2621,23 @@
+               VTY_NEWLINE);
+       goto finished;
+     }
++#else
++  /* And this is the code that hopefully does work */
++  if (rename (config_file, config_file_sav) != 0)
++    {
++      vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
++              VTY_NEWLINE);
++      goto finished;
++    }
++  sync ();
++#endif
++
++#if 0
++  /* same here. Please no cross-filesystem hardlinks... */
+   if (link (config_file_tmp, config_file) != 0)
++#else
++  if (rename (config_file_tmp, config_file) != 0)
++#endif
+     {
+       vty_out (vty, "Can't save configuration file %s.%s", config_file,
+              VTY_NEWLINE);