From c20d46856e18f50672c8b12af712922ae02a1fd6 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 14 Jan 2010 19:19:10 +0000 Subject: [PATCH] [packages] quagga: fix mini_fo assertion triggered by cross-fs link() (#5960) SVN-Revision: 19136 --- net/quagga/Makefile | 4 +- net/quagga/patches/150-no-cross-fs-link.patch | 40 +++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 net/quagga/patches/150-no-cross-fs-link.patch diff --git a/net/quagga/Makefile b/net/quagga/Makefile index 3bab669a8c..97ce8cda51 100644 --- a/net/quagga/Makefile +++ b/net/quagga/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2009 OpenWrt.org +# Copyright (C) 2006-2010 OpenWrt.org # # 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 PKG_VERSION:=0.98.6 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_MD5SUM:=b0d4132039953a0214256873b7d23d68 PKG_SOURCE_URL:=http://www.quagga.net/download/ \ diff --git a/net/quagga/patches/150-no-cross-fs-link.patch b/net/quagga/patches/150-no-cross-fs-link.patch new file mode 100644 index 0000000000..53ba92967b --- /dev/null +++ b/net/quagga/patches/150-no-cross-fs-link.patch @@ -0,0 +1,40 @@ +--- a/lib/command.c ++++ b/lib/command.c +@@ -2567,6 +2567,13 @@ + unlink (config_file_tmp); + return CMD_WARNING; + } ++ ++#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, +@@ -2586,7 +2593,23 @@ + unlink (config_file_tmp); + return CMD_WARNING; + } ++#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); -- 2.30.2