summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2012-05-04 20:00:41 +0000
committerParabola <dev@list.parabolagnulinux.org>2012-05-04 20:00:41 +0000
commitb2c353d874b85e06f355a9419852e2616613c7d0 (patch)
treef0773e0a930d308198ef5036d4f74e7f53015e6e /core
parent0a24fb835cac4007388213ad0afb15257b035b14 (diff)
Fri May 4 20:00:31 UTC 2012
Diffstat (limited to 'core')
-rw-r--r--core/binutils/binutils-2.22-ld-13621.patch27
-rw-r--r--core/dnsutils/trusted-key.key2
-rw-r--r--core/expat/CVE-2009-3560.patch13
-rw-r--r--core/expat/CVE-2009-3720.patch12
-rw-r--r--core/gcc/gcc-4.6.2-cloog-0.17.patch36
-rw-r--r--core/gcc/gcc-hash-style-both.patch122
-rw-r--r--core/glibc/glibc-2.10-dont-build-timezone.patch13
-rw-r--r--core/gmp/538dfce27f41.patch38
-rw-r--r--core/inetutils/domainname3
-rw-r--r--core/inetutils/rexec.xinetd10
-rw-r--r--core/iproute2/fix-ip-l.patch27
-rw-r--r--core/iproute2/remove-libnl-headers.patch31
-rw-r--r--core/libarchive/interpret-non-posix-zips.patch165
-rw-r--r--core/libarchive/skip-fiemap-on-unavail.patch41
-rw-r--r--core/libarchive/test-with-zip-mtime.patch23
-rw-r--r--core/lilo/PKGBUILD40
-rw-r--r--core/lilo/lilo.conf28
-rw-r--r--core/lilo/lilo.install5
-rw-r--r--core/nfs-utils/kernel-3.0-segfault.patch53
-rw-r--r--core/openssl/disable-tls12-client.patch36
-rw-r--r--core/openssl/vpaes.patch69
-rw-r--r--core/pkg-config/autoconf-2.66.patch12
-rw-r--r--core/sqlite3/PKGBUILD88
-rw-r--r--core/sqlite3/license.txt33
-rw-r--r--core/tzdata/Makefile.patch140
-rw-r--r--core/tzdata/PKGBUILD47
-rw-r--r--core/udev/0001-reinstate-TIMEOUT-handling.patch126
-rw-r--r--core/util-linux/stable-fixes-2.21.patch1516
28 files changed, 0 insertions, 2756 deletions
diff --git a/core/binutils/binutils-2.22-ld-13621.patch b/core/binutils/binutils-2.22-ld-13621.patch
deleted file mode 100644
index ffb2ab825..000000000
--- a/core/binutils/binutils-2.22-ld-13621.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/bfd/linker.c b/bfd/linker.c
-index c51c5df..0404474 100644
---- a/bfd/linker.c
-+++ b/bfd/linker.c
-@@ -3208,6 +3208,12 @@ fix_syms (struct bfd_link_hash_entry *h, void *data)
- op = op1;
- }
-
-+ /* Refuse to choose a section for which we are out of bounds. */
-+ /* ??? This may make most of the above moot. */
-+ if (h->u.def.value < op->vma
-+ || h->u.def.value > op->vma + op->size)
-+ op = bfd_abs_section_ptr;
-+
- h->u.def.value -= op->vma;
- h->u.def.section = op;
- }
-index 95b7ef4..a9c05f9 100644
---- a/ld/testsuite/ld-elf/warn2.d
-+++ b/ld/testsuite/ld-elf/warn2.d
-@@ -13,5 +13,5 @@
- # construct and that the symbol still appears as expected.
-
- #...
-- +[0-9]+: +[0-9a-f]+ +20 +OBJECT +GLOBAL +DEFAULT +[1-9] Foo
-+ +[0-9]+: +[0-9a-f]+ +20 +OBJECT +GLOBAL +DEFAULT +ABS Foo
- #pass
diff --git a/core/dnsutils/trusted-key.key b/core/dnsutils/trusted-key.key
deleted file mode 100644
index 866cadda2..000000000
--- a/core/dnsutils/trusted-key.key
+++ /dev/null
@@ -1,2 +0,0 @@
-. 172800 IN DNSKEY 256 3 8 AwEAAZ/NErKzyMlImJ+2HTmK9qeH2sLUywlsF+mJbTP5GKoYFHoU2vn2 Zqr261Lk7a6jfBKYny5GX7BDRJcVvig36TgOinE9QP5KVS0RxdrOl98g KLwFMORfNf/wjCwjPdEl1GgaGYl0npJ4c+x+o6aa/xmDKJo9zUlpvb7B LxbJ7HwF
-. 172800 IN DNSKEY 257 3 8 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjF FVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoX bfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaD X6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpz W5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relS Qageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulq QxA+Uk1ihz0=
diff --git a/core/expat/CVE-2009-3560.patch b/core/expat/CVE-2009-3560.patch
deleted file mode 100644
index 5fe9c36c8..000000000
--- a/core/expat/CVE-2009-3560.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -urNad trunk~/lib/xmlparse.c trunk/lib/xmlparse.c
---- trunk~/lib/xmlparse.c 2007-05-08 04:25:35.000000000 +0200
-+++ trunk/lib/xmlparse.c 2009-12-29 21:57:22.141732904 +0100
-@@ -3703,6 +3703,9 @@
- return XML_ERROR_UNCLOSED_TOKEN;
- case XML_TOK_PARTIAL_CHAR:
- return XML_ERROR_PARTIAL_CHAR;
-+ case -XML_TOK_PROLOG_S:
-+ tok = -tok;
-+ break;
- case XML_TOK_NONE:
- #ifdef XML_DTD
- /* for internal PE NOT referenced between declarations */
diff --git a/core/expat/CVE-2009-3720.patch b/core/expat/CVE-2009-3720.patch
deleted file mode 100644
index 65d16431f..000000000
--- a/core/expat/CVE-2009-3720.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urNad trunk~/lib/xmltok_impl.c trunk/lib/xmltok_impl.c
---- trunk~/lib/xmltok_impl.c 2006-11-26 18:34:46.000000000 +0100
-+++ trunk/lib/xmltok_impl.c 2009-10-22 21:42:41.000000000 +0200
-@@ -1744,7 +1744,7 @@
- const char *end,
- POSITION *pos)
- {
-- while (ptr != end) {
-+ while (ptr < end) {
- switch (BYTE_TYPE(enc, ptr)) {
- #define LEAD_CASE(n) \
- case BT_LEAD ## n: \
diff --git a/core/gcc/gcc-4.6.2-cloog-0.17.patch b/core/gcc/gcc-4.6.2-cloog-0.17.patch
deleted file mode 100644
index 0503a05ed..000000000
--- a/core/gcc/gcc-4.6.2-cloog-0.17.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -Naur gcc-4.6-20120120-orig/configure gcc-4.6-20120120/configure
---- gcc-4.6-20120120-orig/configure 2011-12-18 20:03:44.000000000 +1000
-+++ gcc-4.6-20120120/configure 2012-02-03 17:55:14.885990135 +1000
-@@ -6049,8 +6049,8 @@
- LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${ppllibs}"
-
- if test "${cloog_org}" = yes ; then
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.16.1 of CLooG" >&5
--$as_echo_n "checking for version 0.16.1 of CLooG... " >&6; }
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.17 of CLooG" >&5
-+$as_echo_n "checking for version 0.17 of CLooG... " >&6; }
- if test "${gcc_cv_cloog_ct_0_14_0+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
-@@ -6061,8 +6061,7 @@
- main ()
- {
- #if CLOOG_VERSION_MAJOR != 0 \
-- || CLOOG_VERSION_MINOR != 16 \
-- || CLOOG_VERSION_REVISION < 1
-+ || CLOOG_VERSION_MINOR != 17
- choke me
- #endif
- ;
-diff -Naur gcc-4.6-20120120-orig/gcc/graphite-clast-to-gimple.c gcc-4.6-20120120/gcc/graphite-clast-to-gimple.c
---- gcc-4.6-20120120-orig/gcc/graphite-clast-to-gimple.c 2011-03-13 08:05:38.000000000 +1000
-+++ gcc-4.6-20120120/gcc/graphite-clast-to-gimple.c 2012-02-03 17:51:47.943463879 +1000
-@@ -1367,7 +1367,7 @@
- /* Change cloog output language to C. If we do use FORTRAN instead, cloog
- will stop e.g. with "ERROR: unbounded loops not allowed in FORTRAN.", if
- we pass an incomplete program to cloog. */
-- options->language = LANGUAGE_C;
-+ options->language = CLOOG_LANGUAGE_C;
-
- /* Enable complex equality spreading: removes dummy statements
- (assignments) in the generated code which repeats the
diff --git a/core/gcc/gcc-hash-style-both.patch b/core/gcc/gcc-hash-style-both.patch
deleted file mode 100644
index 8b59f4535..000000000
--- a/core/gcc/gcc-hash-style-both.patch
+++ /dev/null
@@ -1,122 +0,0 @@
---- gcc/config/alpha/linux-elf.h.orig 2010-12-09 23:27:07.000000000 +1000
-+++ gcc/config/alpha/linux-elf.h 2011-03-11 10:01:47.770000457 +1000
-@@ -41,7 +41,7 @@
-
- #define ELF_DYNAMIC_LINKER LINUX_DYNAMIC_LINKER
-
--#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
-+#define LINK_SPEC "-m elf64alpha --hash-style=both %{G*} %{relax:-relax} \
- %{O*:-O3} %{!O*:-O1} \
- %{shared:-shared} \
- %{!shared: \
---- gcc/config/i386/linux64.h.orig 2011-03-03 08:35:36.000000000 +1000
-+++ gcc/config/i386/linux64.h 2011-03-11 10:01:47.770000457 +1000
-@@ -78,7 +78,7 @@
- %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
-
- #undef LINK_SPEC
--#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} \
-+#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} --hash-style=both \
- %{shared:-shared} \
- %{!shared: \
- %{!static: \
---- gcc/config/i386/linux.h.orig 2011-01-15 04:45:06.000000000 +1000
-+++ gcc/config/i386/linux.h 2011-03-11 10:01:47.770000457 +1000
-@@ -104,7 +104,7 @@
- { "dynamic_linker", LINUX_DYNAMIC_LINKER }
-
- #undef LINK_SPEC
--#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
-+#define LINK_SPEC "-m %(link_emulation) --hash-style=both %{shared:-shared} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
---- gcc/config/ia64/linux.h.orig 2010-12-09 23:27:07.000000000 +1000
-+++ gcc/config/ia64/linux.h 2011-03-11 10:01:47.770000457 +1000
-@@ -64,7 +64,7 @@
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
-
- #undef LINK_SPEC
--#define LINK_SPEC "\
-+#define LINK_SPEC "--hash-style=both \
- %{shared:-shared} \
- %{!shared: \
- %{!static: \
---- gcc/config/rs6000/linux64.h.orig 2011-02-11 03:30:10.000000000 +1000
-+++ gcc/config/rs6000/linux64.h 2011-03-11 10:03:34.280000457 +1000
-@@ -389,11 +389,11 @@
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
-
-
--#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
-+#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux --hash-style=both %{!shared: %{!static: \
- %{rdynamic:-export-dynamic} \
- -dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}"
-
--#define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
-+#define LINK_OS_LINUX_SPEC64 "-m elf64ppc --hash-style=both %{!shared: %{!static: \
- %{rdynamic:-export-dynamic} \
- -dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}"
-
---- gcc/config/rs6000/sysv4.h.orig 2011-01-28 04:36:03.000000000 +1000
-+++ gcc/config/rs6000/sysv4.h 2011-03-11 10:01:47.773333792 +1000
-@@ -830,7 +830,7 @@
- #define LINUX_DYNAMIC_LINKER \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
-
--#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
-+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=both %{!shared: %{!static: \
- %{rdynamic:-export-dynamic} \
- -dynamic-linker " LINUX_DYNAMIC_LINKER "}}"
-
---- gcc/config/s390/linux.h.orig 2010-12-09 23:27:07.000000000 +1000
-+++ gcc/config/s390/linux.h 2011-03-11 10:01:47.770000457 +1000
-@@ -77,7 +77,7 @@
-
- #undef LINK_SPEC
- #define LINK_SPEC \
-- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
-+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --hash-style=both \
- %{shared:-shared} \
- %{!shared: \
- %{static:-static} \
---- gcc/config/sparc/linux64.h.orig 2011-02-17 23:57:21.000000000 +1000
-+++ gcc/config/sparc/linux64.h 2011-03-11 10:01:47.770000457 +1000
-@@ -113,7 +113,7 @@
- { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
- { "link_arch", LINK_ARCH_SPEC },
-
--#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,%R/usr/lib %{shared:-shared} \
-+#define LINK_ARCH32_SPEC "-m elf32_sparc --hash-style=both -Y P,%R/usr/lib %{shared:-shared} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
-@@ -121,7 +121,7 @@
- %{static:-static}} \
- "
-
--#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
-+#define LINK_ARCH64_SPEC "-m elf64_sparc --hash-style=both -Y P,%R/usr/lib64 %{shared:-shared} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
-@@ -193,7 +193,7 @@
- #else /* !SPARC_BI_ARCH */
-
- #undef LINK_SPEC
--#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
-+#define LINK_SPEC "-m elf64_sparc --hash-style=both -Y P,%R/usr/lib64 %{shared:-shared} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
---- gcc/config/sparc/linux.h.orig 2011-01-27 06:30:12.000000000 +1000
-+++ gcc/config/sparc/linux.h 2011-03-11 10:01:47.770000457 +1000
-@@ -74,7 +74,7 @@
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
-
- #undef LINK_SPEC
--#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
-+#define LINK_SPEC "-m elf32_sparc --hash-style=both -Y P,/usr/lib %{shared:-shared} \
- %{!mno-relax:%{!r:-relax}} \
- %{!shared: \
- %{!static: \
diff --git a/core/glibc/glibc-2.10-dont-build-timezone.patch b/core/glibc/glibc-2.10-dont-build-timezone.patch
deleted file mode 100644
index d3abeff17..000000000
--- a/core/glibc/glibc-2.10-dont-build-timezone.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-timezone data has been split into the package sys-libs/timezone-data
-
---- glibc-2.4/Makeconfig
-+++ glibc-2.4/Makeconfig
-@@ -931,7 +931,7 @@
- stdlib stdio-common libio malloc string wcsmbs time dirent \
- grp pwd posix io termios resource misc socket sysvipc gmon \
- gnulib iconv iconvdata wctype manual shadow gshadow po argp \
-- crypt nss localedata timezone rt conform debug \
-+ crypt nss localedata rt conform debug \
- $(add-on-subdirs) $(dlfcn) $(binfmt-subdir)
-
- ifndef avoid-generated
diff --git a/core/gmp/538dfce27f41.patch b/core/gmp/538dfce27f41.patch
deleted file mode 100644
index 2e0a1af50..000000000
--- a/core/gmp/538dfce27f41.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-
-# HG changeset patch
-# User Torbjorn Granlund <tege@gmplib.org>
-# Date 1310730221 -7200
-# Node ID 538dfce27f410b910d5e2f011119269e224d16a3
-# Parent 03ed209dd7efd4f4fff0ce297bb3a8f7e7ba2366
-(mpn_dcpi1_bdiv_q): Get mpn_sub_1 size argument right.
-
-diff -r 03ed209dd7ef -r 538dfce27f41 mpn/generic/dcpi1_bdiv_q.c
---- a/mpn/generic/dcpi1_bdiv_q.c Thu Jun 16 12:22:24 2011 +0200
-+++ b/mpn/generic/dcpi1_bdiv_q.c Fri Jul 15 13:43:41 2011 +0200
-@@ -7,7 +7,7 @@
- SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
- GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-
--Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
-+Copyright 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
-
- This file is part of the GNU MP Library.
-
-@@ -28,7 +28,6 @@
- #include "gmp-impl.h"
-
-
--
- mp_size_t
- mpn_dcpi1_bdiv_q_n_itch (mp_size_t n)
- {
-@@ -130,7 +129,7 @@
- qn = nn - qn;
- while (qn > dn)
- {
-- mpn_sub_1 (np + dn, np + dn, qn, cy);
-+ mpn_sub_1 (np + dn, np + dn, qn - dn, cy);
- cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp);
- qp += dn;
- np += dn;
-
diff --git a/core/inetutils/domainname b/core/inetutils/domainname
deleted file mode 100644
index a1b8a8c31..000000000
--- a/core/inetutils/domainname
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec /usr/bin/hostname -d "$@"
diff --git a/core/inetutils/rexec.xinetd b/core/inetutils/rexec.xinetd
deleted file mode 100644
index 4659e4745..000000000
--- a/core/inetutils/rexec.xinetd
+++ /dev/null
@@ -1,10 +0,0 @@
-service exec
-{
- flags = REUSE
- socket_type = stream
- wait = no
- user = root
- server = /usr/sbin/rexecd
- log_on_failure += USERID
- disable = yes
-}
diff --git a/core/iproute2/fix-ip-l.patch b/core/iproute2/fix-ip-l.patch
deleted file mode 100644
index 7f1749cbb..000000000
--- a/core/iproute2/fix-ip-l.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 5aa08f6bf4107f8aec43c0678466a314dbd0d054 Mon Sep 17 00:00:00 2001
-From: Stephen Hemminger <shemminger@vyatta.com>
-Date: Fri, 20 Jan 2012 08:16:02 -0800
-Subject: [PATCH] ip: make 'ip l' be 'ip link'
-
-Restore compatiablity for those lazy typists.
----
- ip/ip.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/ip/ip.c b/ip/ip.c
-index 7b4bacb..20dc3b5 100644
---- a/ip/ip.c
-+++ b/ip/ip.c
-@@ -72,8 +72,8 @@ static const struct cmd {
- { "neighbour", do_ipneigh },
- { "ntable", do_ipntable },
- { "ntbl", do_ipntable },
-- { "l2tp", do_ipl2tp },
- { "link", do_iplink },
-+ { "l2tp", do_ipl2tp },
- { "tunnel", do_iptunnel },
- { "tunl", do_iptunnel },
- { "tuntap", do_iptuntap },
---
-1.7.6.5
-
diff --git a/core/iproute2/remove-libnl-headers.patch b/core/iproute2/remove-libnl-headers.patch
deleted file mode 100644
index 921e1fa82..000000000
--- a/core/iproute2/remove-libnl-headers.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 13603f6a9e46f08576f6284a0ef1ce1fbf94ffe0 Mon Sep 17 00:00:00 2001
-From: Stephen Hemminger <shemminger@vyatta.com>
-Date: Tue, 10 Jan 2012 08:50:49 -0800
-Subject: [PATCH] iplt2p: remove unused libnl headers
-
-Leftover from change to original code.
----
- ip/ipl2tp.c | 7 -------
- 1 files changed, 0 insertions(+), 7 deletions(-)
-
-diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c
-index 042ddb4..97f98b6 100644
---- a/ip/ipl2tp.c
-+++ b/ip/ipl2tp.c
-@@ -23,13 +23,6 @@
- #include <linux/if_arp.h>
- #include <linux/ip.h>
-
--#include <netlink/netlink.h>
--#include <netlink/genl/genl.h>
--#include <netlink/genl/family.h>
--#include <netlink/genl/mngt.h>
--#include <netlink/genl/ctrl.h>
--#include <netlink/utils.h>
--
- #include <linux/genetlink.h>
- #include <linux/l2tp.h>
-
---
-1.7.6.5
-
diff --git a/core/libarchive/interpret-non-posix-zips.patch b/core/libarchive/interpret-non-posix-zips.patch
deleted file mode 100644
index 63bc439d9..000000000
--- a/core/libarchive/interpret-non-posix-zips.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-Index: libarchive/archive_read_support_format_zip.c
-===================================================================
---- libarchive/archive_read_support_format_zip.c (revision 4189)
-+++ libarchive/archive_read_support_format_zip.c (revision 4190)
-@@ -217,14 +217,13 @@
- }
-
- /*
-- * TODO: This is a performance sink because it forces
-- * the read core to drop buffered data from the start
-- * of file, which will then have to be re-read again
-- * if this bidder loses.
-+ * TODO: This is a performance sink because it forces the read core to
-+ * drop buffered data from the start of file, which will then have to
-+ * be re-read again if this bidder loses.
- *
-- * Consider passing in the winning bid value to subsequent
-- * bidders so that this bidder in particular can avoid
-- * seeking if it knows it's going to lose anyway.
-+ * We workaround this a little by passing in the best bid so far so
-+ * that later bidders can do nothing if they know they'll never
-+ * outbid. But we can certainly do better...
- */
- static int
- archive_read_format_zip_seekable_bid(struct archive_read *a, int best_bid)
-@@ -311,19 +310,29 @@
- external_attributes = archive_le32dec(p + 38);
- zip_entry->local_header_offset = archive_le32dec(p + 42);
-
-+ /* If we can't guess the mode, leave it zero here;
-+ when we read the local file header we might get
-+ more information. */
-+ zip_entry->mode = 0;
- if (zip_entry->system == 3) {
- zip_entry->mode = external_attributes >> 16;
-- } else {
-- zip_entry->mode = AE_IFREG | 0777;
- }
-
-- /* Do we need to parse filename here? */
-- /* Or can we wait until we read the local header? */
-+ /* We don't read the filename until we get to the
-+ local file header. Reading it here would speed up
-+ table-of-contents operations (removing the need to
-+ find and read local file header to get the
-+ filename) at the cost of requiring a lot of extra
-+ space. */
-+ /* We don't read the extra block here. We assume it
-+ will be duplicated at the local file header. */
- __archive_read_consume(a,
- 46 + filename_length + extra_length + comment_length);
- }
-
-- /* TODO: Sort zip entries. */
-+ /* TODO: Sort zip entries by file offset so that we
-+ can optimize get_next_header() to use skip instead of
-+ seek. */
-
- return ARCHIVE_OK;
- }
-@@ -434,6 +443,11 @@
- return (30);
- }
-
-+ /* TODO: It's worth looking ahead a little bit for a valid
-+ * PK signature. In particular, that would make it possible
-+ * to read some UUEncoded SFX files or SFX files coming from
-+ * a network socket. */
-+
- return (0);
- }
-
-Index: libarchive/test/test_compat_zip_6.zip.uu
-===================================================================
---- libarchive/test/test_compat_zip_6.zip.uu (revision 0)
-+++ libarchive/test/test_compat_zip_6.zip.uu (revision 4190)
-@@ -0,0 +1,10 @@
-+begin 755 test_compat_zip_6.zip
-+M4$L#!`H``````'@3-T`````````````````6````3F5W($9O;&1E<B].97<@
-+M1F]L9&5R+U!+`P0*``````!\$S=`%4-8OPL````+````*P```$YE=R!&;VQD
-+M97(O3F5W($9O;&1E<B].97<@5&5X="!$;V-U;65N="YT>'1S;VUE('1E>'0-
-+M"E!+`0(4"PH``````'@3-T`````````````````6````````````$```````
-+M``!.97<@1F]L9&5R+TYE=R!&;VQD97(O4$L!`A0+"@``````?!,W0!5#6+\+
-+M````"P```"L``````````0`@````-````$YE=R!&;VQD97(O3F5W($9O;&1E
-+M<B].97<@5&5X="!$;V-U;65N="YT>'102P4&``````(``@"=````B```````
-+`
-+end
-Index: libarchive/test/test_compat_zip.c
-===================================================================
---- libarchive/test/test_compat_zip.c (revision 4189)
-+++ libarchive/test/test_compat_zip.c (revision 4190)
-@@ -348,6 +348,53 @@
- free(p);
- }
-
-+/*
-+ * Issue 225: Errors extracting MSDOS Zip archives with directories.
-+ */
-+static void
-+compat_zip_6_verify(struct archive *a)
-+{
-+ struct archive_entry *ae;
-+
-+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
-+ assertEqualString("New Folder/New Folder/", archive_entry_pathname(ae));
-+ assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
-+ assertEqualInt(1327314468, archive_entry_mtime(ae));
-+ assertEqualInt(0, archive_entry_size(ae));
-+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
-+ assertEqualString("New Folder/New Folder/New Text Document.txt", archive_entry_pathname(ae));
-+ assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
-+ assertEqualInt(1327314476, archive_entry_mtime(ae));
-+ assertEqualInt(11, archive_entry_size(ae));
-+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
-+}
-+
-+static void
-+test_compat_zip_6(void)
-+{
-+ const char *refname = "test_compat_zip_6.zip";
-+ struct archive *a;
-+ void *p;
-+ size_t s;
-+
-+ extract_reference_file(refname);
-+ p = slurpfile(&s, refname);
-+
-+ assert((a = archive_read_new()) != NULL);
-+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
-+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
-+ assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, s, 7));
-+ compat_zip_6_verify(a);
-+ assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
-+
-+ assert((a = archive_read_new()) != NULL);
-+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
-+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
-+ assertEqualIntA(a, ARCHIVE_OK, read_open_memory(a, p, s, 7));
-+ compat_zip_6_verify(a);
-+ assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
-+}
-+
- DEFINE_TEST(test_compat_zip)
- {
- test_compat_zip_1();
-@@ -355,6 +402,7 @@
- test_compat_zip_3();
- test_compat_zip_4();
- test_compat_zip_5();
-+ test_compat_zip_6();
- }
-
-
-Index: Makefile.am
-===================================================================
---- Makefile.am (revision 4189)
-+++ Makefile.am (revision 4190)
-@@ -462,6 +462,7 @@
- libarchive/test/test_compat_zip_3.zip.uu \
- libarchive/test/test_compat_zip_4.zip.uu \
- libarchive/test/test_compat_zip_5.zip.uu \
-+ libarchive/test/test_compat_zip_6.zip.uu \
- libarchive/test/test_fuzz_1.iso.Z.uu \
- libarchive/test/test_fuzz.cab.uu \
- libarchive/test/test_fuzz.lzh.uu \
diff --git a/core/libarchive/skip-fiemap-on-unavail.patch b/core/libarchive/skip-fiemap-on-unavail.patch
deleted file mode 100644
index d054aea4e..000000000
--- a/core/libarchive/skip-fiemap-on-unavail.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 293687358e2c52213a3f077bb3d8f860ea5bfda9 Mon Sep 17 00:00:00 2001
-From: Michihiro NAKAJIMA <ggcueroad@gmail.com>
-Date: Mon, 6 Feb 2012 04:51:16 +0900
-Subject: [PATCH] Fix issue 238. Skip the setup sparse on linux without a
- check of errno if ioctl(,FS_IOC_FIEMAP,) failed because the
- errno is not fixed , for example, some file system returns
- ENOTTY, another returns EOPNOTSUPP, or EINVAL and so on. We
- cannot decide what errno exactly indicates an unsupported
- error.
-
----
- libarchive/archive_read_disk_entry_from_file.c | 13 +++----------
- 1 file changed, 3 insertions(+), 10 deletions(-)
-
-diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
-index eef42ef74..6415008 100644
---- a/libarchive/archive_read_disk_entry_from_file.c
-+++ b/libarchive/archive_read_disk_entry_from_file.c
-@@ -859,16 +859,9 @@ setup_sparse(struct archive_read_disk *a,
-
- r = ioctl(fd, FS_IOC_FIEMAP, fm);
- if (r < 0) {
-- /* When errno is ENOTTY, it is better we should
-- * return ARCHIVE_OK because an earlier version
-- *(<2.6.28) cannot perfom FS_IOC_FIEMAP.
-- * We should also check if errno is EOPNOTSUPP,
-- * it means "Operation not supported". */
-- if (errno != ENOTTY && errno != EOPNOTSUPP) {
-- archive_set_error(&a->archive, errno,
-- "FIEMAP failed");
-- exit_sts = ARCHIVE_FAILED;
-- }
-+ /* When something error happens, it is better we
-+ * should return ARCHIVE_OK because an earlier
-+ * version(<2.6.28) cannot perfom FS_IOC_FIEMAP. */
- goto exit_setup_sparse;
- }
- if (fm->fm_mapped_extents == 0)
---
-1.7.9.2
-
diff --git a/core/libarchive/test-with-zip-mtime.patch b/core/libarchive/test-with-zip-mtime.patch
deleted file mode 100644
index 79e2f3c7e..000000000
--- a/core/libarchive/test-with-zip-mtime.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Index: libarchive/test/test_compat_zip.c
-===================================================================
---- libarchive/test/test_compat_zip.c (revision 4197)
-+++ libarchive/test/test_compat_zip.c (revision 4198)
-@@ -359,12 +359,16 @@
- assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
- assertEqualString("New Folder/New Folder/", archive_entry_pathname(ae));
- assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
-- assertEqualInt(1327314468, archive_entry_mtime(ae));
-+ /* Zip timestamps are local time, so vary by time zone. */
-+ /* TODO: A more complex assert would work here; we could
-+ verify that it's within +/- 24 hours of a particular value. */
-+ /* assertEqualInt(1327314468, archive_entry_mtime(ae)); */
- assertEqualInt(0, archive_entry_size(ae));
- assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
- assertEqualString("New Folder/New Folder/New Text Document.txt", archive_entry_pathname(ae));
- assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
-- assertEqualInt(1327314476, archive_entry_mtime(ae));
-+ /* Zip timestamps are local time, so vary by time zone. */
-+ /* assertEqualInt(1327314476, archive_entry_mtime(ae)); */
- assertEqualInt(11, archive_entry_size(ae));
- assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
- }
diff --git a/core/lilo/PKGBUILD b/core/lilo/PKGBUILD
deleted file mode 100644
index 8202e1853..000000000
--- a/core/lilo/PKGBUILD
+++ /dev/null
@@ -1,40 +0,0 @@
-# $Id: PKGBUILD 134681 2011-08-07 15:40:03Z tpowa $
-# Maintainer: Eric Belanger <eric@archlinux.org>
-# Contributor: judd <jvinet@zeroflux.org>
-
-pkgname=lilo
-pkgver=23.2
-pkgrel=3
-pkgdesc="A bootloader for Linux"
-arch=('i686' 'x86_64')
-url="https://alioth.debian.org/projects/lilo/"
-license=('BSD')
-# While lilo should stay in the base category,
-# it usually makes no sense if it is installed
-# with pacman -S base, therefore, don't add
-# the base group here.
-#groups=('base')
-backup=('etc/lilo.conf')
-depends=('device-mapper' 'coreutils')
-makedepends=('bin86' 'sharutils')
-optdepends=('perl: to use keytab-lilo')
-install=lilo.install
-options=('!makeflags')
-source=("http://lilo.alioth.debian.org/ftp/sources/${pkgname}-${pkgver}.tar.gz"
- 'lilo.conf')
-md5sums=('51b9b9db665d3b8724919e3d46054d12'
- 'ca2d8cd9b63f11444861939b42df29c1')
-
-build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
- export LC_ALL=C
- make all
-}
-
-package() {
- cd "${srcdir}/${pkgname}-${pkgver}"
- make DESTDIR="${pkgdir}" install
-
- install -D -m644 "${srcdir}/lilo.conf" "${pkgdir}/etc/lilo.conf"
- install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
-}
diff --git a/core/lilo/lilo.conf b/core/lilo/lilo.conf
deleted file mode 100644
index 9d42a2333..000000000
--- a/core/lilo/lilo.conf
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# /etc/lilo.conf
-#
-
-boot=/dev/hda
-# This line often fixes L40 errors on bootup
-# disk=/dev/hda bios=0x80
-
-default=arch
-timeout=50
-lba32
-prompt
-
-image=/boot/vmlinuz-linux
- label=arch
- root=/dev/hda3
- initrd=/boot/initramfs-linux.img
- read-only
-
-image=/boot/vmlinuz-linux
- label=arch-fallback
- root=/dev/hda3
- initrd=/boot/initramfs-linux-fallback.img
- read-only
-
-#other=/dev/hda1
-# label=dos
-
diff --git a/core/lilo/lilo.install b/core/lilo/lilo.install
deleted file mode 100644
index 7375fddf8..000000000
--- a/core/lilo/lilo.install
+++ /dev/null
@@ -1,5 +0,0 @@
-post_upgrade() {
- echo
- echo "If you use the LILO bootloader, you should run 'lilo' after upgrading."
- echo
-}
diff --git a/core/nfs-utils/kernel-3.0-segfault.patch b/core/nfs-utils/kernel-3.0-segfault.patch
deleted file mode 100644
index 3dba94a05..000000000
--- a/core/nfs-utils/kernel-3.0-segfault.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-mount.nfs segfaults if kernel version number does not contain
-at least 3 components delimited with a dot.
-
-Avoid this by matching up to three unsigned integers inialised
-to zero, separated by dots.
-
-A version that does not start with an integer is probably a future
-version where the versioning evolved to another scheme.
-Return UINT_MAX which is guaranteed to be higher than existing
-versions. This would also make it possible to easily identify
-versions that do not start with an integer.
-
-Signed-off-by: Luk Claes <luk@...>
----
- utils/mount/version.h | 16 +++++++++-------
- 1 files changed, 9 insertions(+), 7 deletions(-)
-
-diff --git a/utils/mount/version.h b/utils/mount/version.h
-index af61a6f..531cf68 100644
---- a/utils/mount/version.h
-+++ b/utils/mount/version.h
-@@ -23,8 +23,8 @@
- #ifndef _NFS_UTILS_MOUNT_VERSION_H
- #define _NFS_UTILS_MOUNT_VERSION_H
-
--#include <stdlib.h>
--#include <string.h>
-+#include <stdio.h>
-+#include <limits.h>
-
- #include <sys/utsname.h>
-
-@@ -37,14 +37,16 @@ static inline unsigned int MAKE_VERSION(unsigned int p, unsigned int q,
- static inline unsigned int linux_version_code(void)
- {
- struct utsname my_utsname;
-- unsigned int p, q, r;
-+ unsigned int p, q = 0, r = 0;
-
-+ /* UINT_MAX as backward compatibility code should not be run */
- if (uname(&my_utsname))
-- return 0;
-+ return UINT_MAX;
-
-- p = (unsigned int)atoi(strtok(my_utsname.release, "."));
-- q = (unsigned int)atoi(strtok(NULL, "."));
-- r = (unsigned int)atoi(strtok(NULL, "."));
-+ /* UINT_MAX as future versions might not start with an integer */
-+ if (sscanf(my_utsname.release, "%u.%u.%u", &p, &q, &r) < 1)
-+ return UINT_MAX;
-+
- return MAKE_VERSION(p, q, r);
- }
diff --git a/core/openssl/disable-tls12-client.patch b/core/openssl/disable-tls12-client.patch
deleted file mode 100644
index edb87e77f..000000000
--- a/core/openssl/disable-tls12-client.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Index: openssl/ssl/t1_lib.c
-RCS File: /v/openssl/cvs/openssl/ssl/t1_lib.c,v
-rcsdiff -q -kk '-r1.64.2.14.2.31' '-r1.64.2.14.2.32' -u '/v/openssl/cvs/openssl/ssl/t1_lib.c,v' 2>/dev/null
---- t1_lib.c 2012/02/27 16:38:10 1.64.2.14.2.31
-+++ t1_lib.c 2012/03/21 21:32:57 1.64.2.14.2.32
-@@ -544,7 +544,7 @@
- }
- skip_ext:
-
-- if (TLS1_get_version(s) >= TLS1_2_VERSION)
-+ if (TLS1_get_client_version(s) >= TLS1_2_VERSION)
- {
- if ((size_t)(limit - ret) < sizeof(tls12_sigalgs) + 6)
- return NULL;
-Index: openssl/ssl/s23_clnt.c
-RCS File: /v/openssl/cvs/openssl/ssl/s23_clnt.c,v
-rcsdiff -q -kk '-r1.43.2.4.2.5' '-r1.43.2.4.2.6' -u '/v/openssl/cvs/openssl/ssl/s23_clnt.c,v' 2>/dev/null
---- s23_clnt.c 2011/05/19 18:22:15 1.43.2.4.2.5
-+++ s23_clnt.c 2012/03/29 19:08:54 1.43.2.4.2.6
-@@ -287,12 +287,14 @@
-
- if (ssl2_compat && ssl23_no_ssl2_ciphers(s))
- ssl2_compat = 0;
--
-+#ifndef OPENSSL_NO_TLS1_2_CLIENT
- if (!(s->options & SSL_OP_NO_TLSv1_2))
- {
- version = TLS1_2_VERSION;
- }
-- else if (!(s->options & SSL_OP_NO_TLSv1_1))
-+ else
-+#endif
-+ if (!(s->options & SSL_OP_NO_TLSv1_1))
- {
- version = TLS1_1_VERSION;
- }
diff --git a/core/openssl/vpaes.patch b/core/openssl/vpaes.patch
deleted file mode 100644
index 2688b0c0a..000000000
--- a/core/openssl/vpaes.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-Index: openssl/crypto/aes/asm/vpaes-x86.pl
-RCS File: /v/openssl/cvs/openssl/crypto/aes/asm/vpaes-x86.pl,v
-rcsdiff -q -kk '-r1.5.4.4' '-r1.5.4.5' -u '/v/openssl/cvs/openssl/crypto/aes/asm/vpaes-x86.pl,v' 2>/dev/null
---- vpaes-x86.pl 2011/12/15 22:20:26 1.5.4.4
-+++ vpaes-x86.pl 2012/03/31 16:55:18 1.5.4.5
-@@ -843,6 +843,8 @@
- &mov ($out,&wparam(1)); # out
- &mov ($round,&wparam(2)); # len
- &mov ($key,&wparam(3)); # key
-+ &sub ($round,16);
-+ &jc (&label("cbc_abort"));
- &lea ($base,&DWP(-56,"esp"));
- &mov ($const,&wparam(4)); # ivp
- &and ($base,-16);
-@@ -853,7 +855,6 @@
- &mov (&DWP(48,"esp"),$base);
-
- &mov (&DWP(0,"esp"),$out); # save out
-- &sub ($round,16);
- &mov (&DWP(4,"esp"),$key) # save key
- &mov (&DWP(8,"esp"),$const); # save ivp
- &mov ($out,$round); # $out works as $len
-@@ -896,6 +897,7 @@
- &mov ($base,&DWP(8,"esp")); # restore ivp
- &mov ("esp",&DWP(48,"esp"));
- &movdqu (&QWP(0,$base),"xmm1"); # write IV
-+&set_label("cbc_abort");
- &function_end("${PREFIX}_cbc_encrypt");
-
- &asm_finish();
-Index: openssl/crypto/aes/asm/vpaes-x86_64.pl
-RCS File: /v/openssl/cvs/openssl/crypto/aes/asm/vpaes-x86_64.pl,v
-rcsdiff -q -kk '-r1.4.4.2' '-r1.4.4.3' -u '/v/openssl/cvs/openssl/crypto/aes/asm/vpaes-x86_64.pl,v' 2>/dev/null
---- vpaes-x86_64.pl 2011/11/14 21:01:17 1.4.4.2
-+++ vpaes-x86_64.pl 2012/03/31 16:55:18 1.4.4.3
-@@ -263,7 +263,7 @@
- pshufb %xmm2, %xmm4 # 4 = sbou
- pxor %xmm0, %xmm4 # 4 = sb1u + k
- movdqa 0x70(%r10), %xmm0 # 0 : sbot
-- movdqa .Lk_sr-.Lk_dsbd(%r11), %xmm2
-+ movdqa -0x160(%r11), %xmm2 # .Lk_sr-.Lk_dsbd=-0x160
- pshufb %xmm3, %xmm0 # 0 = sb1t
- pxor %xmm4, %xmm0 # 0 = A
- pshufb %xmm2, %xmm0
-@@ -869,6 +869,8 @@
- ___
- ($len,$key)=($key,$len);
- $code.=<<___;
-+ sub \$16,$len
-+ jc .Lcbc_abort
- ___
- $code.=<<___ if ($win64);
- lea -0xb8(%rsp),%rsp
-@@ -887,7 +889,6 @@
- $code.=<<___;
- movdqu ($ivp),%xmm6 # load IV
- sub $inp,$out
-- sub \$16,$len
- call _vpaes_preheat
- cmp \$0,${enc}d
- je .Lcbc_dec_loop
-@@ -932,6 +933,7 @@
- .Lcbc_epilogue:
- ___
- $code.=<<___;
-+.Lcbc_abort:
- ret
- .size ${PREFIX}_cbc_encrypt,.-${PREFIX}_cbc_encrypt
- ___
diff --git a/core/pkg-config/autoconf-2.66.patch b/core/pkg-config/autoconf-2.66.patch
deleted file mode 100644
index 14cabdf9f..000000000
--- a/core/pkg-config/autoconf-2.66.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur pkg-config-0.25-old//pkg.m4 pkg-config-0.25/pkg.m4
---- pkg-config-0.25-old//pkg.m4 2009-12-07 06:39:02.000000000 +1000
-+++ pkg-config-0.25/pkg.m4 2010-07-15 14:44:37.466942978 +1000
-@@ -135,7 +135,7 @@
- Consider adjusting the PKG_CONFIG_PATH environment variable if you
- installed software in a non-standard prefix.
-
--_PKG_TEXT])dnl
-+_PKG_TEXT])[]dnl
- ])
- elif test $pkg_failed = untried; then
- AC_MSG_RESULT([no])
diff --git a/core/sqlite3/PKGBUILD b/core/sqlite3/PKGBUILD
deleted file mode 100644
index 9d37721f3..000000000
--- a/core/sqlite3/PKGBUILD
+++ /dev/null
@@ -1,88 +0,0 @@
-# $Id: PKGBUILD 154652 2012-03-30 14:26:35Z andyrtr $
-# Maintainer: Andreas Radke <andyrtr@archlinux.org>
-# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
-
-pkgbase="sqlite3"
-pkgname=('sqlite3' 'sqlite3-tcl' 'sqlite3-doc')
-_amalgamationver=3071100
-_amalgamationver2=${_amalgamationver/00/}
-_docver=${_amalgamationver} #3070700
-#pkgver=${_amalgamationver2//0/.}
-pkgver=3.7.11
-pkgrel=1
-pkgdesc="A C library that implements an SQL database engine"
-arch=('i686' 'x86_64')
-license=('custom')
-url="http://www.sqlite.org/"
-makedepends=('tcl' 'readline>=6.0.00')
-source=( # tarball containing the amalgamation for SQLite 3.7.5 together with a configure script and makefile for building it; includes now also the Tcl Extension Architecture (TEA)
- http://www.sqlite.org/sqlite-autoconf-$_amalgamationver.tar.gz
- #http://www.sqlite.org/sqlite-doc-${_amalgamationver}.zip
- http://www.sqlite.org/sqlite-doc-${_docver}.zip
- license.txt)
-options=('!libtool' '!emptydirs')
-md5sums=('0552d71bda98ebdcaea305cd6058221b'
- 'c1fb48beff33612b2c7f5ae6ab17a601'
- 'c1cdbc5544034d9012e421e75a5e4890')
-
-build() {
- export CFLAGS="$CFLAGS -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_SECURE_DELETE"
-
- # build sqlite
- cd "$srcdir"/sqlite-autoconf-$_amalgamationver
- ./configure --prefix=/usr \
- --disable-static
- make
-
- # build the tcl extension
- cd "$srcdir"/sqlite-autoconf-$_amalgamationver/tea
- ./configure --prefix=/usr \
- --with-system-sqlite
- make
-
-}
-
-package_sqlite3() {
-
- pkgdesc="A C library that implements an SQL database engine"
- depends=('readline>=6.0.00')
- conflicts=('sqlite')
- replaces=('sqlite')
-
- cd ${srcdir}/sqlite-autoconf-$_amalgamationver
- make DESTDIR=${pkgdir} install
-
- # license
- install -D -m644 ${srcdir}/license.txt ${pkgdir}/usr/share/licenses/${pkgname}/license.txt
-}
-
-package_sqlite3-tcl() {
-
- pkgdesc="sqlite3 Tcl Extension Architecture (TEA)"
- depends=('sqlite3>=3.7.5')
-
- cd ${srcdir}/sqlite-autoconf-$_amalgamationver/tea
- make DESTDIR=${pkgdir} install
-}
-
-package_sqlite3-doc() {
- pkgdesc="most of the static HTML files that comprise this website, including all of the SQL Syntax and the C/C++ interface specs and other miscellaneous documentation"
- #arch=('any') - not yet supported
-
- #cd ${srcdir}/sqlite-doc-${_amalgamationver}
- cd ${srcdir}/sqlite-doc-${_docver}
- mkdir -p ${pkgdir}/usr/share/doc/${pkgbase}
- cp -R * ${pkgdir}/usr/share/doc/${pkgbase}/
-
- # fix permissions and remove obsolete files; https://bugs.archlinux.org/task/24605
- find ${pkgdir} -type f -perm 755 -exec ls -lha {} \;
- find ${pkgdir} -type f -perm 755 -exec chmod 644 {} \;
-
- find ${pkgdir} -type f -name '*~' -exec ls -lha {} \;
- find ${pkgdir} -type d -name '*~' -exec ls -lha {} \;
- find ${pkgdir} -name '*~' -exec rm -f {} \;
-
- find ${pkgdir} -type f -name '.~*' -exec ls -lha {} \; # /build/pkg/sqlite3-doc/usr/share/doc/sqlite3/images/fileformat/.~lock.indexpage.odg#
- find ${pkgdir} -type d -name '.~*' -exec ls -lha {} \;
- find ${pkgdir} -name '.~*' -exec rm -f {} \;
-}
diff --git a/core/sqlite3/license.txt b/core/sqlite3/license.txt
deleted file mode 100644
index 118c5d5e6..000000000
--- a/core/sqlite3/license.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-SQLite Copyright
-SQLite is in the
-Public Domain
-
-
-All of the deliverable code in SQLite has been dedicated to the public domain by the authors. All code authors, and representatives of the companies they work for, have signed affidavits dedicating their contributions to the public domain and originals of those signed affidavits are stored in a firesafe at the main offices of Hwaci. Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original SQLite code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
-
-The previous paragraph applies to the deliverable code in SQLite - those parts of the SQLite library that you actually bundle and ship with a larger application. Portions of the documentation and some code used as part of the build process might fall under other licenses. The details here are unclear. We do not worry about the licensing of the documentation and build code so much because none of these things are part of the core deliverable SQLite library.
-
-All of the deliverable code in SQLite has been written from scratch. No code has been taken from other projects or from the open internet. Every line of code can be traced back to its original author, and all of those authors have public domain dedications on file. So the SQLite code base is clean and is uncontaminated with licensed code from other projects.
-Obtaining An Explicit License To Use SQLite
-
-Even though SQLite is in the public domain and does not require a license, some users want to obtain a license anyway. Some reasons for obtaining a license include:
-You are using SQLite in a jurisdiction that does not recognize the public domain.
-You are using SQLite in a jurisdiction that does not recognize the right of an author to dedicate their work to the public domain.
-You want to hold a tangible legal document as evidence that you have the legal right to use and distribute SQLite.
-Your legal department tells you that you have to purchase a license.
-
-If you feel like you really have to purchase a license for SQLite, Hwaci, the company that employs the architect and principal developers of SQLite, will sell you one.
-Contributed Code
-
-In order to keep SQLite completely free and unencumbered by copyright, all new contributors to the SQLite code base are asked to dedicate their contributions to the public domain. If you want to send a patch or enhancement for possible inclusion in the SQLite source tree, please accompany the patch with the following statement:
-The author or authors of this code dedicate any and all copyright interest in this code to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this code under copyright law.
-
-We are not able to accept patches or changes to SQLite that are not accompanied by a statement such as the above. In addition, if you make changes or enhancements as an employee, then a simple statement such as the above is insufficient. You must also send by surface mail a copyright release signed by a company officer. A signed original of the copyright release should be mailed to:
-Hwaci
-6200 Maple Cove Lane
-Charlotte, NC 28269
-USA
-
-A template copyright release is available in PDF or HTML. You can use this release to make future changes.
-
-see http://www.sqlite.org/copyright.html \ No newline at end of file
diff --git a/core/tzdata/Makefile.patch b/core/tzdata/Makefile.patch
deleted file mode 100644
index e88f9d907..000000000
--- a/core/tzdata/Makefile.patch
+++ /dev/null
@@ -1,140 +0,0 @@
-diff -Naur src/Makefile src-p/Makefile
---- src/Makefile 2007-08-20 16:47:41.000000000 +0200
-+++ src-p/Makefile 2007-10-02 04:07:44.000000000 +0200
-@@ -34,17 +34,17 @@
-
- # Everything gets put in subdirectories of. . .
-
--TOPDIR= /usr/local
-+TOPDIR= $(DESTDIR)/usr
-
- # "Compiled" time zone information is placed in the "TZDIR" directory
- # (and subdirectories).
- # Use an absolute path name for TZDIR unless you're just testing the software.
-
--TZDIR= $(TOPDIR)/etc/zoneinfo
-+TZDIR= $(TOPDIR)/share/zoneinfo
-
- # The "tzselect", "zic", and "zdump" commands get installed in. . .
-
--ETCDIR= $(TOPDIR)/etc
-+SBINDIR= $(TOPDIR)/sbin
-
- # If you "make INSTALL", the "date" command gets installed in. . .
-
-@@ -52,7 +52,7 @@
-
- # Manual pages go in subdirectories of. . .
-
--MANDIR= $(TOPDIR)/man
-+MANDIR= $(TOPDIR)/share/man
-
- # Library functions are put in an archive in LIBDIR.
-
-@@ -83,7 +83,7 @@
-
- # Non-default libraries needed to link.
- # Add -lintl if you want to use `gettext' on Solaris.
--LDLIBS=
-+LDLIBS=$(LDFLAGS)
-
- # Add the following to the end of the "CFLAGS=" line as needed.
- # -Dconst= if `const' does not work (SunOS 4.x cc, OSF1 V5.0 cc)
-@@ -211,7 +211,7 @@
- # before the first Monday in January when a "%V" format is used and January 1
- # falls on a Friday, Saturday, or Sunday.
-
--CFLAGS=
-+CFLAGS += -std=gnu99
-
- # If you want zic's -s option used when installing, uncomment the next line
- # ZFLAGS= -s
-@@ -220,7 +220,7 @@
- ZIC= $(zic) $(ZFLAGS)
-
- # The name of a Posix-compliant `awk' on your system.
--AWK= nawk
-+AWK= awk
-
- # The path where SGML DTDs are kept.
- SGML_SEARCH_PATH= $(TOPDIR)/share/doc/sgml-lib/REC-html401-19991224/
-@@ -241,8 +241,10 @@
-
- ###############################################################################
-
--cc= cc
--CC= $(cc) -DTZDIR=\"$(TZDIR)\"
-+CC+= -DTZDIR=\"$(TZDIR)\"
-+ifeq ($(NLS),1)
-+CC += -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\"
-+endif
-
- TZCSRCS= zic.c localtime.c asctime.c scheck.c ialloc.c
- TZCOBJS= zic.o localtime.o asctime.o scheck.o ialloc.o
-@@ -282,14 +284,16 @@
-
- ALL: all date
-
--install: all $(DATA) $(REDO) $(TZLIB) $(MANS) $(TABDATA)
-+install: all $(DATA) $(REDO) $(MANS) $(TABDATA)
- $(ZIC) -y $(YEARISTYPE) \
- -d $(TZDIR) -l $(LOCALTIME) -p $(POSIXRULES)
- -rm -f $(TZDIR)/iso3166.tab $(TZDIR)/zone.tab
- cp iso3166.tab zone.tab $(TZDIR)/.
-- -mkdir $(TOPDIR) $(ETCDIR)
-- cp tzselect zic zdump $(ETCDIR)/.
-- -mkdir $(TOPDIR) $(MANDIR) \
-+ -mkdir -p $(TOPDIR) $(SBINDIR)
-+ cp zic zdump $(SBINDIR)/.
-+ -mkdir -p $(TOPDIR) $(BINDIR)
-+ cp tzselect $(BINDIR)/.
-+ -mkdir -p $(TOPDIR) $(MANDIR) \
- $(MANDIR)/man3 $(MANDIR)/man5 $(MANDIR)/man8
- -rm -f $(MANDIR)/man3/newctime.3 \
- $(MANDIR)/man3/newtzset.3 \
-@@ -298,13 +302,11 @@
- $(MANDIR)/man8/zdump.8 \
- $(MANDIR)/man8/zic.8
- cp newctime.3 newtzset.3 $(MANDIR)/man3/.
-- cp tzfile.5 $(MANDIR)/man5/.
-- cp tzselect.8 zdump.8 zic.8 $(MANDIR)/man8/.
-
- INSTALL: ALL install date.1
-- -mkdir $(TOPDIR) $(BINDIR)
-+ -mkdir -p $(TOPDIR) $(BINDIR)
- cp date $(BINDIR)/.
-- -mkdir $(TOPDIR) $(MANDIR) $(MANDIR)/man1
-+ -mkdir -p $(TOPDIR) $(MANDIR) $(MANDIR)/man1
- -rm -f $(MANDIR)/man1/date.1
- cp date.1 $(MANDIR)/man1/.
-
-@@ -334,9 +336,9 @@
- # You must replace all of $(TZDIR) to switch from not using leap seconds
- # to using them, or vice versa.
- other_two: zic leapseconds $(TDATA)
-- $(ZIC) -y $(YEARISTYPE) -d $(TZDIR)-posix -L /dev/null $(TDATA)
-+ $(ZIC) -y $(YEARISTYPE) -d $(TZDIR)/posix -L /dev/null $(TDATA)
- $(ZIC) -y $(YEARISTYPE) \
-- -d $(TZDIR)-leaps -L leapseconds $(TDATA)
-+ -d $(TZDIR)/right -L leapseconds $(TDATA)
-
- posix_right: posix_only other_two
-
-@@ -367,7 +369,7 @@
- <$? >$@
- chmod +x $@
-
--check: check_tables check_web
-+check: check_tables
-
- check_tables: checktab.awk $(PRIMARY_YDATA)
- $(AWK) -f checktab.awk $(PRIMARY_YDATA)
-diff -Naur src/tzselect.ksh src-p/tzselect.ksh
---- src/tzselect.ksh 2007-08-20 16:47:42.000000000 +0200
-+++ src-p/tzselect.ksh 2007-10-02 04:07:44.000000000 +0200
-@@ -1,4 +1,4 @@
--#! /bin/ksh
-+#! /bin/bash
-
- # '@(#)tzselect.ksh 8.1'
-
diff --git a/core/tzdata/PKGBUILD b/core/tzdata/PKGBUILD
deleted file mode 100644
index feac7ba64..000000000
--- a/core/tzdata/PKGBUILD
+++ /dev/null
@@ -1,47 +0,0 @@
-# $Id: PKGBUILD 152303 2012-03-06 15:04:33Z andyrtr $
-# Maintainer: Andreas Radke <andyrtr@archlinux.org>
-
-pkgname=tzdata
-pkgver=2012b
-pkgrel=1
-_tzcode=2012b
-_tzdata=2012b
-pkgdesc="Sources for time zone and daylight saving time data"
-arch=('i686' 'x86_64')
-url="http://www.iana.org/time-zones"
-license=('GPL')
-depends=()
-makedepends=()
-optdepends=('bash: required by tzselect')
-options=('!emptydirs')
-source=(#http://www.iana.org/time-zones/repository/releases/tzcode${_tzcode}.tar.gz
- ftp://munnari.oz.au/pub/tzcode${_tzcode}.tar.gz
- #http://www.iana.org/time-zones/repository/releases/${pkgname}${_tzdata}.tar.gz
- ftp://munnari.oz.au/pub/${pkgname}${_tzdata}.tar.gz
- Makefile.patch)
-md5sums=('6137322ffd36e1fd5128885be1c57008'
- '0615fd29def380a917e528433c820368'
- 'a64ed97d1fc03c66ee8612c0d9f40507')
-
-build() {
- cd ${srcdir}
-
- tar -xf tzcode${_tzcode}.tar.gz
- tar -xf ${pkgname}${_tzdata}.tar.gz
-
- patch -Np1 -i "${srcdir}/Makefile.patch"
-
- make
-}
-
-check() {
- cd ${srcdir}
- make -k check # || /bin/true
-}
-
-package() {
- cd ${srcdir}
- make DESTDIR="${pkgdir}" install
-
- rm "${pkgdir}/usr/share/zoneinfo/localtime"
-}
diff --git a/core/udev/0001-reinstate-TIMEOUT-handling.patch b/core/udev/0001-reinstate-TIMEOUT-handling.patch
deleted file mode 100644
index 9b251b283..000000000
--- a/core/udev/0001-reinstate-TIMEOUT-handling.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From 86617453cd78bf88d347f0e75a5be8b5ebac6c2e Mon Sep 17 00:00:00 2001
-From: Tom Gundersen <teg@jklm.no>
-Date: Thu, 15 Mar 2012 02:12:43 +0100
-Subject: [PATCH] reinstate TIMEOUT= handling
-
-This reverts 43d5c5f03645c4b842659f9b5bd0ae465e885e92 and
-57c6f8ae5f52a6e8ffc66a54966346f733dded39.
-
-Signed-off-by: Tom Gundersen <teg@jklm.no>
----
- src/libudev-device.c | 19 +++++++++++++++++++
- src/libudev-private.h | 1 +
- src/udevd.c | 13 ++++++++++---
- 3 files changed, 30 insertions(+), 3 deletions(-)
-
-diff --git a/src/libudev-device.c b/src/libudev-device.c
-index 10f28b8..639c367 100644
---- a/src/libudev-device.c
-+++ b/src/libudev-device.c
-@@ -68,6 +68,7 @@ struct udev_device {
- struct udev_list tags_list;
- unsigned long long int seqnum;
- unsigned long long int usec_initialized;
-+ int timeout;
- int devlink_priority;
- int refcount;
- dev_t devnum;
-@@ -160,6 +161,21 @@ static int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum)
- return 0;
- }
-
-+int udev_device_get_timeout(struct udev_device *udev_device)
-+{
-+ return udev_device->timeout;
-+}
-+
-+static int udev_device_set_timeout(struct udev_device *udev_device, int timeout)
-+{
-+ char num[32];
-+
-+ udev_device->timeout = timeout;
-+ snprintf(num, sizeof(num), "%u", timeout);
-+ udev_device_add_property(udev_device, "TIMEOUT", num);
-+ return 0;
-+}
-+
- const char *udev_device_get_devpath_old(struct udev_device *udev_device)
- {
- return udev_device->devpath_old;
-@@ -414,6 +430,8 @@ void udev_device_add_property_from_string_parse(struct udev_device *udev_device,
- udev_device_set_devpath_old(udev_device, &property[12]);
- } else if (strncmp(property, "SEQNUM=", 7) == 0) {
- udev_device_set_seqnum(udev_device, strtoull(&property[7], NULL, 10));
-+ } else if (strncmp(property, "TIMEOUT=", 8) == 0) {
-+ udev_device_set_timeout(udev_device, strtoull(&property[8], NULL, 10));
- } else if (strncmp(property, "IFINDEX=", 8) == 0) {
- udev_device_set_ifindex(udev_device, strtoull(&property[8], NULL, 10));
- } else if (strncmp(property, "DEVMODE=", 8) == 0) {
-@@ -599,6 +617,7 @@ struct udev_device *udev_device_new(struct udev *udev)
- udev_list_init(udev, &udev_device->sysattr_value_list, true);
- udev_list_init(udev, &udev_device->sysattr_list, false);
- udev_list_init(udev, &udev_device->tags_list, true);
-+ udev_device->timeout = -1;
- udev_device->watch_handle = -1;
- /* copy global properties */
- udev_list_entry_foreach(list_entry, udev_get_properties_list_entry(udev))
-diff --git a/src/libudev-private.h b/src/libudev-private.h
-index 5f5c64a..ec63b67 100644
---- a/src/libudev-private.h
-+++ b/src/libudev-private.h
-@@ -87,6 +87,7 @@ const char *udev_device_get_id_filename(struct udev_device *udev_device);
- void udev_device_set_is_initialized(struct udev_device *udev_device);
- int udev_device_add_tag(struct udev_device *udev_device, const char *tag);
- void udev_device_cleanup_tags_list(struct udev_device *udev_device);
-+int udev_device_get_timeout(struct udev_device *udev_device);
- unsigned long long udev_device_get_usec_initialized(struct udev_device *udev_device);
- void udev_device_set_usec_initialized(struct udev_device *udev_device, unsigned long long usec_initialized);
- int udev_device_get_devlink_priority(struct udev_device *udev_device);
-diff --git a/src/udevd.c b/src/udevd.c
-index 1702217..88e9272 100644
---- a/src/udevd.c
-+++ b/src/udevd.c
-@@ -401,7 +401,7 @@ out:
- }
- }
-
--static void event_run(struct event *event)
-+static void event_run(struct event *event, bool force)
- {
- struct udev_list_node *loop;
-
-@@ -427,7 +427,7 @@ static void event_run(struct event *event)
- return;
- }
-
-- if (children >= children_max) {
-+ if (!force && children >= children_max) {
- if (children_max > 1)
- info(event->udev, "maximum number (%i) of children reached\n", children);
- return;
-@@ -461,6 +461,13 @@ static int event_queue_insert(struct udev_device *dev)
-
- event->state = EVENT_QUEUED;
- udev_list_node_append(&event->node, &event_list);
-+
-+ /* run all events with a timeout set immediately */
-+ if (udev_device_get_timeout(dev) > 0) {
-+ event_run(event, true);
-+ return 0;
-+ }
-+
- return 0;
- }
-
-@@ -577,7 +584,7 @@ static void event_queue_start(struct udev *udev)
- continue;
- }
-
-- event_run(event);
-+ event_run(event, false);
- }
- }
-
---
-1.7.9.4
-
diff --git a/core/util-linux/stable-fixes-2.21.patch b/core/util-linux/stable-fixes-2.21.patch
deleted file mode 100644
index 3c6c32483..000000000
--- a/core/util-linux/stable-fixes-2.21.patch
+++ /dev/null
@@ -1,1516 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index d3b298c..9da5b24 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -387,6 +387,8 @@ AC_CACHE_VAL([scanf_cv_alloc_modifier],
- [scanf_cv_alloc_modifier=as],
- [scanf_cv_alloc_modifier=no]
- )
-+ ,
-+ [scanf_cv_alloc_modifier=no]
- )
- )
-
-@@ -833,6 +835,8 @@ AC_ARG_ENABLE([ddate],
- )
- UL_BUILD_INIT([ddate])
- AM_CONDITIONAL(BUILD_DDATE, test "x$build_ddate" = xyes)
-+ruman1dir='${mandir}/ru/man1'
-+AC_SUBST([ruman1dir])
-
-
- AC_ARG_ENABLE([agetty],
-diff --git a/fdisk/fdiskbsdlabel.h b/fdisk/fdiskbsdlabel.h
-index 9f9e091..e58e2ff 100644
---- a/fdisk/fdiskbsdlabel.h
-+++ b/fdisk/fdiskbsdlabel.h
-@@ -46,7 +46,7 @@
-
- #define BSD_LINUX_BOOTDIR "/usr/ucb/mdec"
-
--#if defined (i386) || defined (__sparc__) || defined (__arm__) || \
-+#if defined (__i386__) || defined (__sparc__) || defined (__arm__) || \
- defined (__mips__) || defined (__s390__) || defined (__sh__) || \
- defined(__x86_64__) || defined (__avr32__) || defined(__cris__)
- #define BSD_LABELSECTOR 1
-diff --git a/include/list.h b/include/list.h
-index 3ce46ca..d8c3bf0 100644
---- a/include/list.h
-+++ b/include/list.h
-@@ -166,6 +166,10 @@ _INLINE_ void list_splice(struct list_head *list, struct list_head *head)
- #define list_entry(ptr, type, member) \
- ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
-
-+
-+#define list_first_entry(head, type, member) \
-+ ((head) && (head)->next != (head) ? list_entry((head)->next, type, member) : NULL)
-+
- /**
- * list_for_each - iterate over elements in a list
- * @pos: the &struct list_head to use as a loop counter.
-diff --git a/lib/canonicalize.c b/lib/canonicalize.c
-index ab32c10..fd18af4 100644
---- a/lib/canonicalize.c
-+++ b/lib/canonicalize.c
-@@ -174,9 +174,16 @@ canonicalize_path(const char *path)
- if (path == NULL)
- return NULL;
-
-- if (!myrealpath(path, canonical, PATH_MAX+1))
-- return strdup(path);
--
-+ if (!myrealpath(path, canonical, PATH_MAX+1)) {
-+ char *res = strdup(path);
-+ if (res) {
-+ p = strrchr(res, '/');
-+ /* delete trailing slash */
-+ if (p && p > res && *(p + 1) == '\0')
-+ *p = '\0';
-+ }
-+ return res;
-+ }
-
- p = strrchr(canonical, '/');
- if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) {
-diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
-index 763f75c..6bd69d3 100644
---- a/libblkid/src/probe.c
-+++ b/libblkid/src/probe.c
-@@ -388,6 +388,7 @@ void blkid_reset_probe(blkid_probe pr)
- return;
-
- blkid_probe_reset_vals(pr);
-+ blkid_probe_set_wiper(pr, 0, 0);
-
- pr->cur_chain = NULL;
-
-@@ -989,7 +990,7 @@ int blkid_do_wipe(blkid_probe pr, int dryrun)
- len = sizeof(buf);
-
- DBG(DEBUG_LOWPROBE, printf(
-- "wiping [offset=0x%jx, len=%zd, chain=%s, idx=%d, dryrun=%s]\n",
-+ "do_wipe [offset=0x%jx, len=%zd, chain=%s, idx=%d, dryrun=%s]\n",
- offset, len, chn->driver->name, chn->idx, dryrun ? "yes" : "not"));
-
- l = lseek(fd, offset, SEEK_SET);
-@@ -1008,10 +1009,23 @@ int blkid_do_wipe(blkid_probe pr, int dryrun)
- if (chn->idx >= 0) {
- chn->idx--;
- DBG(DEBUG_LOWPROBE,
-- printf("wipe: moving %s chain index to %d\n",
-+ printf("do_wipe: moving %s chain index to %d\n",
- chn->driver->name,
- chn->idx));
- }
-+ if (chn->idx == -1) {
-+ /* blkid_do_probe() goes to the next chain if the index
-+ * of the current chain is -1, so we have to set the
-+ * chain pointer to the previos chain.
-+ */
-+ size_t idx = chn->driver->id > 0 ?
-+ chn->driver->id - 1 : 0;
-+
-+ if (idx > 0)
-+ pr->cur_chain = &pr->chains[idx];
-+ else if (idx == 0)
-+ pr->cur_chain = NULL;
-+ }
- }
- return 0;
- }
-@@ -1579,8 +1593,9 @@ size_t blkid_rtrim_whitespace(unsigned char *str)
- * for later resolution to conflicts between superblocks.
- *
- * For example we found valid LVM superblock, LVM wipes 8KiB at the begin of
-- * the device. If we found another signature (for example MBR) this wiped area
-- * then the signature has been added later and LVM superblock should be ignore.
-+ * the device. If we found another signature (for example MBR) within the
-+ * wiped area then the signature has been added later and LVM superblock
-+ * should be ignore.
- *
- * Note that this heuristic is not 100% reliable, for example "pvcreate --zero
- * n" allows to keep the begin of the device unmodified. It's probably better
-@@ -1588,6 +1603,16 @@ size_t blkid_rtrim_whitespace(unsigned char *str)
- * than for conflicts between filesystem superblocks -- existence of unwanted
- * partition table is very unusual, because PT is pretty visible (parsed and
- * interpreted by kernel).
-+ *
-+ * Note that we usually expect only one signature on the device, it means that
-+ * we have to remember only one wiped area from previously successfully
-+ * detected signature.
-+ *
-+ * blkid_probe_set_wiper() -- defines wiped area (e.g. LVM)
-+ * blkid_probe_use_wiper() -- try to use area (e.g. MBR)
-+ *
-+ * Note that there is not relation between _wiper and blkid_to_wipe().
-+ *
- */
- void blkid_probe_set_wiper(blkid_probe pr, blkid_loff_t off, blkid_loff_t size)
- {
-@@ -1638,12 +1663,17 @@ int blkid_probe_is_wiped(blkid_probe pr, struct blkid_chain **chn,
- return 0;
- }
-
-+/*
-+ * Try to use any area -- if the area has been previously wiped then the
-+ * previous probing result should be ignored (reseted).
-+ */
- void blkid_probe_use_wiper(blkid_probe pr, blkid_loff_t off, blkid_loff_t size)
- {
- struct blkid_chain *chn = NULL;
-
- if (blkid_probe_is_wiped(pr, &chn, off, size) && chn) {
-- DBG(DEBUG_LOWPROBE, printf("wiped area detected -- ignore previous results\n"));
-+ DBG(DEBUG_LOWPROBE, printf("previously wiped area modified "
-+ " -- ignore previous results\n"));
- blkid_probe_set_wiper(pr, 0, 0);
- blkid_probe_chain_reset_vals(pr, chn);
- }
-diff --git a/libmount/src/context.c b/libmount/src/context.c
-index 1f30292..f97dd36 100644
---- a/libmount/src/context.c
-+++ b/libmount/src/context.c
-@@ -1165,6 +1165,10 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt)
-
- src = mnt_fs_get_source(cxt->fs);
-
-+ if (!src && (cxt->mountflags & MS_PROPAGATION))
-+ /* mount --make-{shared,private,...} */
-+ return mnt_fs_set_source(cxt->fs, "none");
-+
- /* ignore filesystems without source or filesystems
- * where the source is quasi-path (//foo/bar)
- */
-@@ -1203,7 +1207,7 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt)
-
- if ((cxt->mountflags & (MS_BIND | MS_MOVE | MS_PROPAGATION)) ||
- mnt_fs_is_pseudofs(cxt->fs)) {
-- DBG(CXT, mnt_debug_h(cxt, "PROPAGATION/pseudo FS source: %s", path));
-+ DBG(CXT, mnt_debug_h(cxt, "BIND/MOVE/pseudo FS source: %s", path));
- return rc;
- }
-
-diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
-index 8cbc25b..c56ffd4 100644
---- a/libmount/src/context_mount.c
-+++ b/libmount/src/context_mount.c
-@@ -369,7 +369,12 @@ static int exec_helper(struct libmnt_context *cxt)
- args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */
- args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */
-
-- if (mnt_context_is_sloppy(cxt))
-+ /*
-+ * TODO: remove the exception for "nfs", -s is documented
-+ * for years should be usable everywhere.
-+ */
-+ if (mnt_context_is_sloppy(cxt) &&
-+ type && startswith(type, "nfs"))
- args[i++] = "-s"; /* 4 */
- if (mnt_context_is_fake(cxt))
- args[i++] = "-f"; /* 5 */
-@@ -446,9 +451,14 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
- src = mnt_fs_get_srcpath(cxt->fs);
- target = mnt_fs_get_target(cxt->fs);
-
-- if (!src || !target)
-+ if (!target)
- return -EINVAL;
--
-+ if (!src) {
-+ /* unnecessary, should be already resolved in
-+ * mnt_context_prepare_srcpath(), but for sure... */
-+ DBG(CXT, mnt_debug_h(cxt, "WARNING: source is NULL -- using \"none\"!"));
-+ src = "none";
-+ }
- type = try_type ? : mnt_fs_get_fstype(cxt->fs);
-
- if (!(flags & MS_MGC_MSK))
-diff --git a/libmount/src/fs.c b/libmount/src/fs.c
-index a28e66c..19650cb 100644
---- a/libmount/src/fs.c
-+++ b/libmount/src/fs.c
-@@ -304,11 +304,7 @@ int __mnt_fs_set_source_ptr(struct libmnt_fs *fs, char *source)
-
- assert(fs);
-
-- if (source && !strcmp(source, "none")) {
-- free(source);
-- source = NULL;
--
-- } else if (source && strchr(source, '=')) {
-+ if (source && strchr(source, '=')) {
- if (blkid_parse_tag_string(source, &t, &v) != 0)
- return -1;
- }
-@@ -341,6 +337,7 @@ int mnt_fs_set_source(struct libmnt_fs *fs, const char *source)
-
- if (!fs)
- return -EINVAL;
-+
- if (source) {
- p = strdup(source);
- if (!p)
-@@ -353,6 +350,41 @@ int mnt_fs_set_source(struct libmnt_fs *fs, const char *source)
- return rc;
- }
-
-+/*
-+ * Compares @fs source path with @path. The tailing slash is ignored.
-+ * See also mnt_fs_match_source().
-+ *
-+ * Returns: 1 if @fs source path equal to @path, otherwise 0.
-+ */
-+int mnt_fs_streq_srcpath(struct libmnt_fs *fs, const char *path)
-+{
-+ const char *p;
-+
-+ if (!fs)
-+ return 0;
-+
-+ p = mnt_fs_get_srcpath(fs);
-+
-+ if (!mnt_fs_is_pseudofs(fs))
-+ return streq_except_trailing_slash(p, path);
-+
-+ if (!p && !path)
-+ return 1;
-+
-+ return p && path && strcmp(p, path) == 0;
-+}
-+
-+/*
-+ * Compares @fs target path with @path. The tailing slash is ignored.
-+ * See also mnt_fs_match_target().
-+ *
-+ * Returns: 1 if @fs target path equal to @path, otherwise 0.
-+ */
-+int mnt_fs_streq_target(struct libmnt_fs *fs, const char *path)
-+{
-+ return fs && streq_except_trailing_slash(mnt_fs_get_target(fs), path);
-+}
-+
- /**
- * mnt_fs_get_tag:
- * @fs: fs
-@@ -1114,7 +1146,7 @@ int mnt_fs_match_target(struct libmnt_fs *fs, const char *target,
- return 0;
-
- /* 1) native paths */
-- rc = !strcmp(target, fs->target);
-+ rc = mnt_fs_streq_target(fs, target);
-
- if (!rc && cache) {
- /* 2) - canonicalized and non-canonicalized */
-@@ -1146,10 +1178,6 @@ int mnt_fs_match_target(struct libmnt_fs *fs, const char *target,
- * The 2nd, 3rd and 4th attempts are not performed when @cache is NULL. The
- * 2nd and 3rd attempts are not performed if @fs->source is tag.
- *
-- * Note that valid source path is NULL; the libmount uses NULL instead of
-- * "none". The "none" is used in /proc/{mounts,self/mountninfo} for pseudo
-- * filesystems.
-- *
- * Returns: 1 if @fs source is equal to @source else 0.
- */
- int mnt_fs_match_source(struct libmnt_fs *fs, const char *source,
-@@ -1161,15 +1189,15 @@ int mnt_fs_match_source(struct libmnt_fs *fs, const char *source,
- if (!fs)
- return 0;
-
-- /* undefined source -- "none" in /proc */
-- if (source == NULL && fs->source == NULL)
-+ /* 1) native paths... */
-+ if (mnt_fs_streq_srcpath(fs, source) == 1)
- return 1;
-
-- if (source == NULL || fs->source == NULL)
-+ if (!source || !fs->source)
- return 0;
-
-- /* 1) native paths/tags */
-- if (streq_except_trailing_slash(source, fs->source))
-+ /* ... and tags */
-+ if (fs->tagname && strcmp(source, fs->source) == 0)
- return 1;
-
- if (!cache)
-@@ -1183,7 +1211,7 @@ int mnt_fs_match_source(struct libmnt_fs *fs, const char *source,
-
- /* 2) canonicalized and native */
- src = mnt_fs_get_srcpath(fs);
-- if (src && streq_except_trailing_slash(cn, src))
-+ if (src && mnt_fs_streq_srcpath(fs, cn))
- return 1;
-
- /* 3) canonicalized and canonicalized */
-diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h
-index fa0edf5..a7b5c0d 100644
---- a/libmount/src/mountP.h
-+++ b/libmount/src/mountP.h
-@@ -367,6 +367,11 @@ extern struct libmnt_fs *mnt_copy_mtab_fs(const struct libmnt_fs *fs);
- extern int __mnt_fs_set_source_ptr(struct libmnt_fs *fs, char *source);
- extern int __mnt_fs_set_fstype_ptr(struct libmnt_fs *fs, char *fstype);
-
-+/* exported in v2.22 */
-+extern int mnt_fs_streq_srcpath(struct libmnt_fs *fs, const char *path);
-+extern int mnt_fs_streq_target(struct libmnt_fs *fs, const char *path);
-+
-+
- /* context.c */
- extern int mnt_context_prepare_srcpath(struct libmnt_context *cxt);
- extern int mnt_context_prepare_target(struct libmnt_context *cxt);
-diff --git a/libmount/src/tab.c b/libmount/src/tab.c
-index 37f47bd..f3ec573 100644
---- a/libmount/src/tab.c
-+++ b/libmount/src/tab.c
-@@ -286,6 +286,11 @@ int mnt_table_next_child_fs(struct libmnt_table *tb, struct libmnt_iter *itr,
-
- id = mnt_fs_get_id(fs);
-
-+ /* avoid infinite loop. This only happens in rare cases
-+ * such as in early userspace when the rootfs is its own parent */
-+ if (id == parent_id)
-+ continue;
-+
- if ((!lastchld_id || id > lastchld_id) &&
- (!*chld || id < chld_id)) {
- *chld = fs;
-@@ -438,7 +443,7 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat
- /* native @target */
- mnt_reset_iter(&itr, direction);
- while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
-- if (fs->target && strcmp(fs->target, path) == 0)
-+ if (mnt_fs_streq_target(fs, path))
- return fs;
- }
- if (!tb->cache || !(cn = mnt_resolve_path(path, tb->cache)))
-@@ -447,7 +452,7 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat
- /* canonicalized paths in struct libmnt_table */
- mnt_reset_iter(&itr, direction);
- while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
-- if (fs->target && strcmp(fs->target, cn) == 0)
-+ if (mnt_fs_streq_target(fs, cn))
- return fs;
- }
-
-@@ -456,12 +461,13 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat
- while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
- char *p;
-
-- if (!fs->target || !mnt_fs_is_swaparea(fs) ||
-+ if (!fs->target || mnt_fs_is_swaparea(fs) ||
- (*fs->target == '/' && *(fs->target + 1) == '\0'))
- continue;
-
- p = mnt_resolve_path(fs->target, tb->cache);
-- if (strcmp(cn, p) == 0)
-+ /* both canonicalized, strcmp() is fine here */
-+ if (p && strcmp(cn, p) == 0)
- return fs;
- }
- return NULL;
-@@ -480,9 +486,8 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat
- * The 2nd, 3rd and 4th iterations are not performed when @tb cache is not
- * set (see mnt_table_set_cache()).
- *
-- * Note that valid source path is NULL; the libmount uses NULL instead of
-- * "none". The "none" is used in /proc/{mounts,self/mountninfo} for pseudo
-- * filesystems.
-+ * Note that NULL is a valid source path; it will be replaced with "none". The
-+ * "none" is used in /proc/{mounts,self/mountinfo} for pseudo filesystems.
- *
- * Returns: a tab entry or NULL.
- */
-@@ -501,16 +506,10 @@ struct libmnt_fs *mnt_table_find_srcpath(struct libmnt_table *tb, const char *pa
- /* native paths */
- mnt_reset_iter(&itr, direction);
- while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
-- const char *src = mnt_fs_get_source(fs);
--
-- p = mnt_fs_get_srcpath(fs);
--
-- if (path == NULL && src == NULL)
-- return fs; /* source is "none" */
-- if (path && p && streq_except_trailing_slash(p, path))
-+ if (mnt_fs_streq_srcpath(fs, path))
- return fs;
-- if (!p && src)
-- ntags++; /* mnt_fs_get_srcpath() returs nothing, it's TAG */
-+ if (mnt_fs_get_tag(fs, NULL, NULL) == 0)
-+ ntags++;
- }
-
- if (!path || !tb->cache || !(cn = mnt_resolve_path(path, tb->cache)))
-@@ -520,8 +519,7 @@ struct libmnt_fs *mnt_table_find_srcpath(struct libmnt_table *tb, const char *pa
- if (ntags < mnt_table_get_nents(tb)) {
- mnt_reset_iter(&itr, direction);
- while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
-- p = mnt_fs_get_srcpath(fs);
-- if (p && streq_except_trailing_slash(p, cn))
-+ if (mnt_fs_streq_srcpath(fs, cn))
- return fs;
- }
- }
-@@ -552,7 +550,9 @@ struct libmnt_fs *mnt_table_find_srcpath(struct libmnt_table *tb, const char *pa
- if (mnt_fs_get_tag(fs, &t, &v))
- continue;
- x = mnt_resolve_tag(t, v, tb->cache);
-- if (x && streq_except_trailing_slash(x, cn))
-+
-+ /* both canonicalized, strcmp() is fine here */
-+ if (x && strcmp(x, cn) == 0)
- return fs;
- }
- }
-@@ -567,7 +567,9 @@ struct libmnt_fs *mnt_table_find_srcpath(struct libmnt_table *tb, const char *pa
- p = mnt_fs_get_srcpath(fs);
- if (p)
- p = mnt_resolve_path(p, tb->cache);
-- if (p && streq_except_trailing_slash(cn, p))
-+
-+ /* both canonicalized, strcmp() is fine here */
-+ if (p && strcmp(p, cn) == 0)
- return fs;
- }
- }
-@@ -702,16 +704,18 @@ struct libmnt_fs *mnt_table_find_pair(struct libmnt_table *tb, const char *sourc
- }
-
- /*
-- * @tb: /proc/self/mountinfo
-- * @fs: filesystem
-- * @mountflags: MS_BIND or 0
-- * @fsroot: fs-root that will be probably used in the mountinfo file
-+ * tb: /proc/self/mountinfo
-+ * fs: filesystem
-+ * mountflags: MS_BIND or 0
-+ * fsroot: fs-root that will be probably used in the mountinfo file
- * for @fs after mount(2)
- *
- * For btrfs subvolumes this function returns NULL, but @fsroot properly set.
- *
- * Returns: entry from @tb that will be used as a source for @fs if the @fs is
- * bindmount.
-+ *
-+ * Don't export to library API!
- */
- struct libmnt_fs *mnt_table_get_fs_root(struct libmnt_table *tb,
- struct libmnt_fs *fs,
-@@ -814,6 +818,20 @@ err:
- return NULL;
- }
-
-+static int is_mountinfo(struct libmnt_table *tb)
-+{
-+ struct libmnt_fs *fs;
-+
-+ if (!tb)
-+ return 0;
-+
-+ fs = list_first_entry(&tb->ents, struct libmnt_fs, ents);
-+ if (fs && mnt_fs_is_kernel(fs) && mnt_fs_get_root(fs))
-+ return 1;
-+
-+ return 0;
-+}
-+
- /**
- * mnt_table_is_mounted:
- * @tb: /proc/self/mountinfo file
-@@ -829,10 +847,9 @@ err:
- int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
- {
- char *root = NULL;
-- struct libmnt_fs *src_fs;
-- const char *src, *tgt;
-- char *xsrc = NULL;
-- int flags = 0, rc = 0;
-+ const char *src = NULL;
-+ char *xsrc = NULL, *tgt;
-+ int rc = 0;
-
- assert(tb);
- assert(fstab_fs);
-@@ -840,39 +857,49 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
- if (mnt_fs_is_swaparea(fstab_fs))
- return 0;
-
-- if (mnt_fs_get_option(fstab_fs, "bind", NULL, NULL) == 0)
-- flags = MS_BIND;
-+ if (is_mountinfo(tb)) {
-+ /* @tb is mountinfo, so we can try to use fs-roots */
-+ struct libmnt_fs *fs;
-+ int flags = 0;
-+
-+ if (mnt_fs_get_option(fstab_fs, "bind", NULL, NULL) == 0)
-+ flags = MS_BIND;
-
-- src_fs = mnt_table_get_fs_root(tb, fstab_fs, flags, &root);
-- if (src_fs)
-- src = mnt_fs_get_srcpath(src_fs);
-+ fs = mnt_table_get_fs_root(tb, fstab_fs, flags, &root);
-+ if (fs)
-+ src = mnt_fs_get_srcpath(fs);
-+ }
-+
-+ if (src)
-+ src = xsrc = mnt_resolve_spec(src, tb->cache);
- else if (mnt_fs_is_pseudofs(fstab_fs))
- src = mnt_fs_get_source(fstab_fs);
- else
- src = xsrc = mnt_resolve_spec(mnt_fs_get_source(fstab_fs),
- tb->cache);
-
-- tgt = mnt_fs_get_target(fstab_fs);
-+ tgt = mnt_resolve_path(mnt_fs_get_target(fstab_fs), tb->cache);
-
-- if (tgt && src && root) {
-+ if (tgt && src) {
- struct libmnt_iter itr;
- struct libmnt_fs *fs;
-
- mnt_reset_iter(&itr, MNT_ITER_FORWARD);
-
- while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
-- const char *s = mnt_fs_get_srcpath(fs),
-- *t = mnt_fs_get_target(fs),
-- *r = mnt_fs_get_root(fs);
--
-- /*
-- * Note that kernel can add tailing slash to the
-- * network filesystem source paths.
-- */
-- if (t && s && r &&
-- strcmp(t, tgt) == 0 &&
-- streq_except_trailing_slash(s, src) &&
-- strcmp(r, root) == 0)
-+
-+ if (root) {
-+ /* mountinfo: compare root, source and target */
-+ const char *r = mnt_fs_get_root(fs);
-+
-+ if (r && strcmp(r, root) == 0 &&
-+ mnt_fs_streq_srcpath(fs, src) &&
-+ mnt_fs_streq_target(fs, tgt))
-+ break;
-+ }
-+ /* mtab: compare source and target */
-+ else if (mnt_fs_streq_srcpath(fs, src) &&
-+ mnt_fs_streq_target(fs, tgt))
- break;
- }
- if (fs)
-@@ -881,6 +908,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
-
- if (xsrc && !tb->cache)
- free(xsrc);
-+ if (!tb->cache)
-+ free(tgt);
-
- free(root);
- return rc;
-diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
-index 0f618bb..28c8536 100644
---- a/libmount/src/tab_parse.c
-+++ b/libmount/src/tab_parse.c
-@@ -180,12 +180,7 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s)
- unmangle_string(fs->vfs_optstr);
- unmangle_string(fstype);
- unmangle_string(src);
--
-- if (!strcmp(fs->fs_optstr, "none")) {
-- free(fs->fs_optstr);
-- fs->fs_optstr = NULL;
-- } else
-- unmangle_string(fs->fs_optstr);
-+ unmangle_string(fs->fs_optstr);
-
- rc = __mnt_fs_set_fstype_ptr(fs, fstype);
- if (!rc) {
-@@ -733,21 +728,14 @@ static struct libmnt_fs *mnt_table_merge_user_fs(struct libmnt_table *tb, struct
- mnt_reset_iter(&itr, MNT_ITER_BACKWARD);
-
- while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
-- const char *s = mnt_fs_get_srcpath(fs),
-- *t = mnt_fs_get_target(fs),
-- *r = mnt_fs_get_root(fs);
-+ const char *r = mnt_fs_get_root(fs);
-
- if (fs->flags & MNT_FS_MERGED)
- continue;
-
-- /*
-- * Note that kernel can add tailing slash to the network
-- * filesystem source path
-- */
-- if (s && t && r &&
-- strcmp(t, target) == 0 &&
-- streq_except_trailing_slash(s, src) &&
-- strcmp(r, root) == 0)
-+ if (r && strcmp(r, root) == 0
-+ && mnt_fs_streq_target(fs, target)
-+ && mnt_fs_streq_srcpath(fs, src))
- break;
- }
-
-diff --git a/libmount/src/utils.c b/libmount/src/utils.c
-index c7a1fd1..4d316d1 100644
---- a/libmount/src/utils.c
-+++ b/libmount/src/utils.c
-@@ -235,6 +235,7 @@ int mnt_fstype_is_pseudofs(const char *type)
- strcmp(type, "binfmt_misc") == 0 ||
- strcmp(type, "fuse.gvfs-fuse-daemon") == 0 ||
- strcmp(type, "debugfs") == 0 ||
-+ strcmp(type, "nfsd") == 0 ||
- strcmp(type, "spufs") == 0)
- return 1;
- return 0;
-diff --git a/login-utils/login.c b/login-utils/login.c
-index 84d8b1b..4f448f8 100644
---- a/login-utils/login.c
-+++ b/login-utils/login.c
-@@ -128,6 +128,22 @@ static int timeout = LOGIN_TIMEOUT;
- static int child_pid = 0;
- static volatile int got_sig = 0;
-
-+#ifdef LOGIN_CHOWN_VCS
-+/* true if the filedescriptor fd is a console tty, very Linux specific */
-+static int is_consoletty(int fd)
-+{
-+ struct stat stb;
-+
-+ if ((fstat(fd, &stb) >= 0)
-+ && (major(stb.st_rdev) == TTY_MAJOR)
-+ && (minor(stb.st_rdev) < 64)) {
-+ return 1;
-+ }
-+ return 0;
-+}
-+#endif
-+
-+
- /*
- * Robert Ambrose writes:
- * A couple of my users have a problem with login processes hanging around
-@@ -316,15 +332,15 @@ static void chown_tty(struct login_context *cxt)
-
- #ifdef LOGIN_CHOWN_VCS
- if (is_consoletty(0)) {
-- if (chown(cxt->vcs, uid, gid)) /* vcs */
-- chown_err(cxt->vcs, uid, gid);
-- if (chmod(cxt->vcs, cxt->tty_mode))
-- chmod_err(cxt->vcs, cxt->tty_mode);
--
-- if (chown(cxt->vcsa, uid, gid)) /* vcsa */
-- chown_err(cxt->vcsa, uid, gid);
-- if (chmod(cxt->vcsa, cxt->tty_mode))
-- chmod_err(cxt->vcsa, cxt->tty_mode);
-+ if (chown(cxt->vcsn, uid, gid)) /* vcs */
-+ chown_err(cxt->vcsn, uid, gid);
-+ if (chmod(cxt->vcsn, cxt->tty_mode))
-+ chmod_err(cxt->vcsn, cxt->tty_mode);
-+
-+ if (chown(cxt->vcsan, uid, gid)) /* vcsa */
-+ chown_err(cxt->vcsan, uid, gid);
-+ if (chmod(cxt->vcsan, cxt->tty_mode))
-+ chmod_err(cxt->vcsan, cxt->tty_mode);
- }
- #endif
- }
-@@ -403,21 +419,6 @@ static void init_tty(struct login_context *cxt)
- }
-
-
--#ifdef LOGIN_CHOWN_VCS
--/* true if the filedescriptor fd is a console tty, very Linux specific */
--static int is_consoletty(int fd)
--{
-- struct stat stb;
--
-- if ((fstat(fd, &stb) >= 0)
-- && (major(stb.st_rdev) == TTY_MAJOR)
-- && (minor(stb.st_rdev) < 64)) {
-- return 1;
-- }
-- return 0;
--}
--#endif
--
- /*
- * Log failed login attempts in _PATH_BTMP if that exists.
- * Must be called only with username the name of an actual user.
-@@ -1145,13 +1146,10 @@ static void init_environ(struct login_context *cxt)
- setenv("TERM", termenv, 1);
-
- if (pwd->pw_uid)
-- setenv("PATH", getlogindefs_str("ENV_PATH", _PATH_DEFPATH), 1);
-- else {
-- const char *x = getlogindefs_str("ENV_ROOTPATH", NULL);
-- if (!x)
-- x = getlogindefs_str("ENV_SUPATH", _PATH_DEFPATH_ROOT);
-- setenv("PATH", x, 1);
-- }
-+ logindefs_setenv("PATH", "ENV_PATH", _PATH_DEFPATH);
-+
-+ else if (logindefs_setenv("PATH", "ENV_ROOTPATH", NULL) != 0)
-+ logindefs_setenv("PATH", "ENV_SUPATH", _PATH_DEFPATH_ROOT);
-
- /* mailx will give a funny error msg if you forget this one */
- len = snprintf(tmp, sizeof(tmp), "%s/%s", _PATH_MAILDIR, pwd->pw_name);
-diff --git a/login-utils/logindefs.c b/login-utils/logindefs.c
-index fe590e9..e9517ac 100644
---- a/login-utils/logindefs.c
-+++ b/login-utils/logindefs.c
-@@ -211,6 +211,43 @@ const char *getlogindefs_str(const char *name, const char *dflt)
- return ptr->value;
- }
-
-+/*
-+ * For compatibililty with shadow-utils we have tu support additional
-+ * syntax for environment variables in login.defs(5) file. The standard
-+ * syntax is:
-+ *
-+ * ENV_FOO data
-+ *
-+ * but shadow-utils supports also
-+ *
-+ * ENV_FOO FOO=data
-+ *
-+ * the FOO= prefix has to be remove before we call setenv().
-+ */
-+int logindefs_setenv(const char *name, const char *conf, const char *dflt)
-+{
-+ const char *val = getlogindefs_str(conf, dflt);
-+ const char *p;
-+
-+ if (!val)
-+ return -1;
-+
-+ p = strchr(val, '=');
-+ if (p) {
-+ size_t sz = strlen(name);
-+
-+ if (strncmp(val, name, sz) == 0 && *(p + 1)) {
-+ val = p + 1;
-+ if (*val == '"')
-+ val++;
-+ if (!*val)
-+ val = dflt;
-+ }
-+ }
-+
-+ return val ? setenv(name, val, 1) : -1;
-+}
-+
- #ifdef TEST_PROGRAM
- int main(int argc, char *argv[])
- {
-diff --git a/login-utils/logindefs.h b/login-utils/logindefs.h
-index 37d19e1..163869d 100644
---- a/login-utils/logindefs.h
-+++ b/login-utils/logindefs.h
-@@ -5,5 +5,6 @@ extern int getlogindefs_bool(const char *name, int dflt);
- extern long getlogindefs_num(const char *name, long dflt);
- extern const char *getlogindefs_str(const char *name, const char *dflt);
- extern void free_getlogindefs_data(void);
-+extern int logindefs_setenv(const char *name, const char *conf, const char *dflt);
-
- #endif /* UTIL_LINUX_LOGINDEFS_H */
-diff --git a/man/ru/Makefile.am b/man/ru/Makefile.am
-index 799feca..281ec23 100644
---- a/man/ru/Makefile.am
-+++ b/man/ru/Makefile.am
-@@ -1,9 +1,6 @@
- include $(top_srcdir)/config/include-Makefile.am
-
--mandir = @mandir@/ru
--
--dist_man_MANS =
--
- if BUILD_DDATE
--dist_man_MANS += ddate.1
-+ruman1_DATA = ddate.1
-+EXTRA_DIST = $(ruman1_DATA)
- endif
-diff --git a/misc-utils/lsblk.8 b/misc-utils/lsblk.8
-index 028b19f..286d54b 100644
---- a/misc-utils/lsblk.8
-+++ b/misc-utils/lsblk.8
-@@ -59,7 +59,7 @@ Use key="value" output format.
- Use the raw output format.
- .IP "\fB\-t, \-\-topology\fP"
- Output info about block device topology.
--This option is equivalent to "-o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED".
-+This option is equivalent to "-o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE".
- .SH NOTES
- For the partitions are some information (e.g. queue attributes) inherited from
- parental device.
-diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
-index 8468b3f..54bf360 100644
---- a/misc-utils/lsblk.c
-+++ b/misc-utils/lsblk.c
-@@ -478,9 +478,14 @@ static void set_tt_data(struct blkdev_cxt *cxt, int col, int id, struct tt_line
- switch(id) {
- case COL_NAME:
- if (cxt->dm_name) {
-- snprintf(buf, sizeof(buf), "%s (%s)",
-+ if ((lsblk->tt->flags & TT_FL_RAW) ||
-+ (lsblk->tt->flags & TT_FL_EXPORT))
-+ tt_line_set_data(ln, col, xstrdup(cxt->dm_name));
-+ else {
-+ snprintf(buf, sizeof(buf), "%s (%s)",
- cxt->dm_name, cxt->name);
-- tt_line_set_data(ln, col, xstrdup(buf));
-+ tt_line_set_data(ln, col, xstrdup(buf));
-+ }
- break;
- }
- case COL_KNAME:
-diff --git a/mount/fstab.5 b/mount/fstab.5
-index b0cd763..c618947 100644
---- a/mount/fstab.5
-+++ b/mount/fstab.5
-@@ -167,7 +167,7 @@ support filesystem
- The subtype is defined by '.subtype' suffix. For
- example 'fuse.sshfs'. It's recommended to use subtype notation rather than add
- any prefix to the first fstab field (for example 'sshfs#example.com' is
--depreacated).
-+deprecated).
- .RE
-
- .B The fourth field
-diff --git a/sys-utils/losetup.8 b/sys-utils/losetup.8
-index a68836e..f50b072 100644
---- a/sys-utils/losetup.8
-+++ b/sys-utils/losetup.8
-@@ -80,6 +80,8 @@ for non-root users.
- force loop driver to reread size of the file associated with the specified loop device
- .IP "\fB\-d, \-\-detach\fP \fIloopdev\fP..."
- detach the file or device associated with the specified loop device(s)
-+.IP "\fB\-D, \-\-detach-all\fP"
-+detach all associated loop devices
- .IP "\fB\-e, \-E, \-\-encryption \fIencryption_type\fP"
- enable data encryption with specified name or number
- .IP "\fB\-f, \-\-find\fP"
-diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
-index 16ace6f..9f03151 100644
---- a/sys-utils/losetup.c
-+++ b/sys-utils/losetup.c
-@@ -362,7 +362,7 @@ int main(int argc, char **argv)
- if (flags & LOOPDEV_FL_OFFSET)
- loopcxt_set_offset(&lc, offset);
- if (flags & LOOPDEV_FL_SIZELIMIT)
-- loopcxt_set_offset(&lc, sizelimit);
-+ loopcxt_set_sizelimit(&lc, sizelimit);
- if (lo_flags)
- loopcxt_set_flags(&lc, lo_flags);
- if ((res = loopcxt_set_backing_file(&lc, file))) {
-diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
-index 78e7a41..44d4402 100644
---- a/sys-utils/mount.8
-+++ b/sys-utils/mount.8
-@@ -2760,6 +2760,10 @@ mount failure
- .TP
- .BR 64
- some mount succeeded
-+.RE
-+
-+The command mount -a returns 0 (all success), 32 (all failed) or 64 (some
-+failed, some success).
-
- .SH NOTES
- The syntax of external mount helpers is:
-diff --git a/sys-utils/mount.c b/sys-utils/mount.c
-index 15510e0..12ec372 100644
---- a/sys-utils/mount.c
-+++ b/sys-utils/mount.c
-@@ -182,6 +182,8 @@ static int mount_all(struct libmnt_context *cxt)
- struct libmnt_fs *fs;
- int mntrc, ignored, rc = MOUNT_EX_SUCCESS;
-
-+ int nsucc = 0, nerrs = 0;
-+
- itr = mnt_new_iter(MNT_ITER_FORWARD);
- if (!itr) {
- warn(_("failed to initialize libmount iterator"));
-@@ -197,31 +199,40 @@ static int mount_all(struct libmnt_context *cxt)
- printf(ignored == 1 ? _("%-25s: ignored\n") :
- _("%-25s: already mounted\n"),
- tgt);
--
- } else if (mnt_context_is_fork(cxt)) {
- if (mnt_context_is_verbose(cxt))
- printf("%-25s: mount successfully forked\n", tgt);
- } else {
-- rc |= mk_exit_code(cxt, mntrc);
-+ mk_exit_code(cxt, mntrc); /* to print warnings */
-
- if (mnt_context_get_status(cxt)) {
-- rc |= MOUNT_EX_SOMEOK;
-+ nsucc++;
-
- if (mnt_context_is_verbose(cxt))
- printf("%-25s: successfully mounted\n", tgt);
-- }
-+ } else
-+ nerrs++;
- }
- }
-
- if (mnt_context_is_parent(cxt)) {
- /* wait for mount --fork children */
-- int nerrs = 0, nchildren = 0;
-+ int nchildren = 0;
-+
-+ nerrs = 0, nsucc = 0;
-
- rc = mnt_context_wait_for_children(cxt, &nchildren, &nerrs);
- if (!rc && nchildren)
-- rc = nchildren == nerrs ? MOUNT_EX_FAIL : MOUNT_EX_SOMEOK;
-+ nsucc = nchildren - nerrs;
- }
-
-+ if (nerrs == 0)
-+ rc = MOUNT_EX_SUCCESS; /* all success */
-+ else if (nsucc == 0)
-+ rc = MOUNT_EX_FAIL; /* all failed */
-+ else
-+ rc = MOUNT_EX_SOMEOK; /* some success, some failed */
-+
- mnt_free_iter(itr);
- return rc;
- }
-@@ -290,6 +301,25 @@ static void selinux_warning(struct libmnt_context *cxt, const char *tgt)
- # define selinux_warning(_x, _y)
- #endif
-
-+/* temporary in mount(8) for v2.21.x releases, in v2.22 will be in libmount
-+ */
-+static int mnt_fs_streq_srcpath(struct libmnt_fs *fs, const char *path)
-+{
-+ const char *p;
-+
-+ if (!fs)
-+ return 0;
-+
-+ p = mnt_fs_get_srcpath(fs);
-+
-+ if (!mnt_fs_is_pseudofs(fs))
-+ return streq_except_trailing_slash(p, path);
-+
-+ if (!p && !path)
-+ return 1;
-+
-+ return p && path && strcmp(p, path) == 0;
-+}
-
- /*
- * rc = 0 success
-@@ -336,7 +366,11 @@ try_readonly:
- return MOUNT_EX_USAGE;
- }
-
-- if (src == NULL || tgt == NULL) {
-+ /*
-+ * TODO: add mnt_context_fstab_applied() to check if we found
-+ * target/source in the file.
-+ */
-+ if (!tgt) {
- if (mflags & MS_REMOUNT)
- warnx(_("%s not mounted"), src ? src : tgt);
- else
-@@ -408,7 +442,7 @@ try_readonly:
- const char *s = mnt_fs_get_srcpath(fs),
- *t = mnt_fs_get_target(fs);
-
-- if (t && s && streq_except_trailing_slash(s, src))
-+ if (t && s && mnt_fs_streq_srcpath(fs, src))
- fprintf(stderr, _(
- " %s is already mounted on %s\n"), s, t);
- }
-@@ -697,7 +731,7 @@ int main(int argc, char **argv)
- longopts, NULL)) != -1) {
-
- /* only few options are allowed for non-root users */
-- if (mnt_context_is_restricted(cxt) && !strchr("hlLUVvpr", c))
-+ if (mnt_context_is_restricted(cxt) && !strchr("hlLUVvpri", c))
- exit_non_root(option_to_longopt(c, longopts));
-
- switch(c) {
-diff --git a/sys-utils/mountpoint.c b/sys-utils/mountpoint.c
-index 5cc833d..d0a0069 100644
---- a/sys-utils/mountpoint.c
-+++ b/sys-utils/mountpoint.c
-@@ -40,12 +40,12 @@
-
- static int quiet;
-
--static dev_t dir_to_device(const char *spec)
-+static int dir_to_device(const char *spec, dev_t *dev)
- {
- struct libmnt_table *tb = mnt_new_table_from_file("/proc/self/mountinfo");
- struct libmnt_fs *fs;
- struct libmnt_cache *cache;
-- dev_t res = 0;
-+ int rc = -1;
-
- if (!tb) {
- /*
-@@ -57,7 +57,7 @@ static dev_t dir_to_device(const char *spec)
- int len;
-
- if (stat(spec, &st) != 0)
-- return 0;
-+ return -1;
-
- cn = mnt_resolve_path(spec, NULL); /* canonicalize */
-
-@@ -65,15 +65,17 @@ static dev_t dir_to_device(const char *spec)
- free(cn);
-
- if (len < 0 || (size_t) len + 1 > sizeof(buf))
-- return 0;
-+ return -1;
- if (stat(buf, &pst) !=0)
-- return 0;
-+ return -1;
-
- if ((st.st_dev != pst.st_dev) ||
-- (st.st_dev == pst.st_dev && st.st_ino == pst.st_ino))
-- return st.st_dev;
-+ (st.st_dev == pst.st_dev && st.st_ino == pst.st_ino)) {
-+ *dev = st.st_dev;
-+ return 0;
-+ }
-
-- return 0;
-+ return -1;
- }
-
- /* to canonicalize all necessary paths */
-@@ -81,12 +83,14 @@ static dev_t dir_to_device(const char *spec)
- mnt_table_set_cache(tb, cache);
-
- fs = mnt_table_find_target(tb, spec, MNT_ITER_BACKWARD);
-- if (fs && mnt_fs_get_target(fs))
-- res = mnt_fs_get_devno(fs);
-+ if (fs && mnt_fs_get_target(fs)) {
-+ *dev = mnt_fs_get_devno(fs);
-+ rc = 0;
-+ }
-
- mnt_free_table(tb);
- mnt_free_cache(cache);
-- return res;
-+ return rc;
- }
-
- static int print_devno(const char *devname, struct stat *st)
-@@ -185,8 +189,8 @@ int main(int argc, char **argv)
- errx(EXIT_FAILURE, _("%s: not a directory"), spec);
- return EXIT_FAILURE;
- }
-- src = dir_to_device(spec);
-- if (!src) {
-+
-+ if ( dir_to_device(spec, &src)) {
- if (!quiet)
- printf(_("%s is not a mountpoint\n"), spec);
- return EXIT_FAILURE;
-diff --git a/term-utils/script.c b/term-utils/script.c
-index 58f9790..0d891b8 100644
---- a/term-utils/script.c
-+++ b/term-utils/script.c
-@@ -437,6 +437,16 @@ doshell(void) {
- else
- shname = shell;
-
-+ /*
-+ * When invoked from within /etc/csh.login, script spawns a csh shell
-+ * that spawns programs that cannot be killed with a SIGTERM. This is
-+ * because csh has a documented behaviour wherein it disables all
-+ * signals when processing the /etc/csh.* files.
-+ *
-+ * Let's restore the default behavior.
-+ */
-+ signal(SIGTERM, SIG_DFL);
-+
- if (cflg)
- execl(shell, shname, "-c", cflg, NULL);
- else
-diff --git a/tests/Makefile.am b/tests/Makefile.am
-index fd62519..2c72318 100644
---- a/tests/Makefile.am
-+++ b/tests/Makefile.am
-@@ -7,5 +7,5 @@ EXTRA_DIST = expected \
- functions.sh \
- run.sh
-
--distclean-local:
-+clean-local:
- rm -rf output diff
-diff --git a/tests/expected/libmount/tabfiles-find-target2 b/tests/expected/libmount/tabfiles-find-target2
-new file mode 100644
-index 0000000..8a6c57b
---- /dev/null
-+++ b/tests/expected/libmount/tabfiles-find-target2
-@@ -0,0 +1,5 @@
-+------ fs:
-+source: /dev/foo
-+target: /any/foo/
-+fstype: auto
-+optstr: defaults
-diff --git a/tests/expected/libmount/tabfiles-find-target3 b/tests/expected/libmount/tabfiles-find-target3
-new file mode 100644
-index 0000000..8a6c57b
---- /dev/null
-+++ b/tests/expected/libmount/tabfiles-find-target3
-@@ -0,0 +1,5 @@
-+------ fs:
-+source: /dev/foo
-+target: /any/foo/
-+fstype: auto
-+optstr: defaults
-diff --git a/tests/expected/libmount/tabfiles-parse-fstab b/tests/expected/libmount/tabfiles-parse-fstab
-index 14bdfb4..d661526 100644
---- a/tests/expected/libmount/tabfiles-parse-fstab
-+++ b/tests/expected/libmount/tabfiles-parse-fstab
-@@ -58,3 +58,8 @@ target: /mnt/gogogo
- fstype: cifs
- optstr: user=SRGROUP/baby,noauto
- user-optstr: user=SRGROUP/baby,noauto
-+------ fs:
-+source: /dev/foo
-+target: /any/foo/
-+fstype: auto
-+optstr: defaults
-diff --git a/tests/expected/libmount/tabfiles-parse-mountinfo b/tests/expected/libmount/tabfiles-parse-mountinfo
-index 95182dd..4470801 100644
---- a/tests/expected/libmount/tabfiles-parse-mountinfo
-+++ b/tests/expected/libmount/tabfiles-parse-mountinfo
-@@ -296,7 +296,7 @@ id: 41
- parent: 20
- devno: 253:0
- ------ fs:
--source: (null)
-+source: none
- target: /proc/sys/fs/binfmt_misc
- fstype: binfmt_misc
- optstr: rw,relatime
-diff --git a/tests/expected/libmount/tabfiles-parse-mtab b/tests/expected/libmount/tabfiles-parse-mtab
-index d7171ea..ffd0c13 100644
---- a/tests/expected/libmount/tabfiles-parse-mtab
-+++ b/tests/expected/libmount/tabfiles-parse-mtab
-@@ -42,7 +42,7 @@ fstype: ext4
- optstr: rw,noatime
- VFS-optstr: rw,noatime
- ------ fs:
--source: (null)
-+source: none
- target: /proc/sys/fs/binfmt_misc
- fstype: binfmt_misc
- optstr: rw
-diff --git a/tests/expected/libmount/update-utab-mount b/tests/expected/libmount/update-utab-mount
-index 1784e00..58a0179 100644
---- a/tests/expected/libmount/update-utab-mount
-+++ b/tests/expected/libmount/update-utab-mount
-@@ -1,3 +1,3 @@
- SRC=/dev/sdb1 TARGET=/mnt/bar ROOT=/ OPTS=user
- SRC=/dev/sda2 TARGET=/mnt/xyz ROOT=/ OPTS=loop=/dev/loop0,uhelper=hal
--TARGET=/proc ROOT=/ OPTS=user
-+SRC=none TARGET=/proc ROOT=/ OPTS=user
-diff --git a/tests/expected/libmount/update-utab-move b/tests/expected/libmount/update-utab-move
-index 12917cc..6008140 100644
---- a/tests/expected/libmount/update-utab-move
-+++ b/tests/expected/libmount/update-utab-move
-@@ -1,3 +1,3 @@
- SRC=/dev/sdb1 TARGET=/mnt/newbar ROOT=/ OPTS=user
- SRC=/dev/sda2 TARGET=/mnt/newxyz ROOT=/ OPTS=loop=/dev/loop0,uhelper=hal
--TARGET=/proc ROOT=/ OPTS=user
-+SRC=none TARGET=/proc ROOT=/ OPTS=user
-diff --git a/tests/expected/libmount/update-utab-remount b/tests/expected/libmount/update-utab-remount
-index 737e2a3..8e344b3 100644
---- a/tests/expected/libmount/update-utab-remount
-+++ b/tests/expected/libmount/update-utab-remount
-@@ -1,3 +1,3 @@
- SRC=/dev/sdb1 TARGET=/mnt/newbar ROOT=/ OPTS=user
- SRC=/dev/sda2 TARGET=/mnt/newxyz ROOT=/ OPTS=user
--TARGET=/proc ROOT=/ OPTS=user
-+SRC=none TARGET=/proc ROOT=/ OPTS=user
-diff --git a/tests/expected/mount/fstab-none b/tests/expected/mount/fstab-none
-new file mode 100644
-index 0000000..3582111
---- /dev/null
-+++ b/tests/expected/mount/fstab-none
-@@ -0,0 +1 @@
-+Success
-diff --git a/tests/expected/mount/shared-subtree b/tests/expected/mount/shared-subtree
-new file mode 100644
-index 0000000..3582111
---- /dev/null
-+++ b/tests/expected/mount/shared-subtree
-@@ -0,0 +1 @@
-+Success
-diff --git a/tests/expected/mount/shared-subtree-make-private b/tests/expected/mount/shared-subtree-make-private
-new file mode 100644
-index 0000000..39cdd0d
---- /dev/null
-+++ b/tests/expected/mount/shared-subtree-make-private
-@@ -0,0 +1 @@
-+-
-diff --git a/tests/expected/mount/shared-subtree-make-shared b/tests/expected/mount/shared-subtree-make-shared
-new file mode 100644
-index 0000000..8a205e8
---- /dev/null
-+++ b/tests/expected/mount/shared-subtree-make-shared
-@@ -0,0 +1 @@
-+shared
-diff --git a/tests/expected/mount/shared-subtree-make-unbindable b/tests/expected/mount/shared-subtree-make-unbindable
-new file mode 100644
-index 0000000..376cfac
---- /dev/null
-+++ b/tests/expected/mount/shared-subtree-make-unbindable
-@@ -0,0 +1 @@
-+unbindable
-diff --git a/tests/functions.sh b/tests/functions.sh
-index 85b1621..6556e4e 100644
---- a/tests/functions.sh
-+++ b/tests/functions.sh
-@@ -93,6 +93,8 @@ function ts_init_core_subtest_env {
- TS_MOUNTPOINT="$TS_OUTDIR/${TS_TESTNAME}-${TS_SUBNAME}-mnt"
-
- rm -f $TS_OUTPUT $TS_VGDUMP
-+ [ -d "$TS_OUTDIR" ] || mkdir -p "$TS_OUTDIR"
-+
- touch $TS_OUTPUT
- [ -n "$TS_VALGRIND_CMD" ] && touch $TS_VGDUMP
- }
-@@ -127,8 +129,6 @@ function ts_init_env {
-
- BLKID_FILE="$TS_OUTDIR/${TS_TESTNAME}.blkidtab"
-
-- [ -d "$TS_OUTDIR" ] || mkdir -p "$TS_OUTDIR"
-- [ -d "$TS_DIFFDIR" ] || mkdir -p "$TS_DIFFDIR"
-
- declare -a TS_SUID_PROGS
- declare -a TS_SUID_USER
-@@ -141,6 +141,8 @@ function ts_init_env {
- export BLKID_FILE
-
- rm -f $TS_OUTPUT $TS_VGDUMP
-+ [ -d "$TS_OUTDIR" ] || mkdir -p "$TS_OUTDIR"
-+
- touch $TS_OUTPUT
- [ -n "$TS_VALGRIND_CMD" ] && touch $TS_VGDUMP
-
-@@ -219,8 +221,15 @@ function ts_gen_diff {
- local res=0
-
- if [ -s "$TS_OUTPUT" ]; then
-+
-+ [ -d "$TS_DIFFDIR" ] || mkdir -p "$TS_DIFFDIR"
- diff -u $TS_EXPECTED $TS_OUTPUT > $TS_DIFF
-- [ -s $TS_DIFF ] && res=1
-+
-+ if [ -s $TS_DIFF ]; then
-+ res=1
-+ else
-+ rm -f $TS_DIFF;
-+ fi
- else
- res=1
- fi
-diff --git a/tests/ts/build-sys/config b/tests/ts/build-sys/config
-index 7ede38c..e2c2b00 100755
---- a/tests/ts/build-sys/config
-+++ b/tests/ts/build-sys/config
-@@ -52,9 +52,18 @@ for conf in $config_gen_dir/config-gen.d/*.conf; do
- esac
- fi
- done
-+
-+ # clean the tree, but exclude tests/{diff,output} dirs
-+ #
-+ [ -d tests/diff ] && mv tests/diff tests/diff.save
-+ [ -d tests/output ] && mv tests/output tests/output.save
-+
- make -j clean &> /dev/null
-- cd $olddir
-
-+ [ -d tests/diff.save ] && mv tests/diff.save tests/diff
-+ [ -d tests/output.save ] && mv tests/output.save tests/output
-+
-+ cd $olddir
- ts_finalize_subtest
- done
-
-diff --git a/tests/ts/libmount/context-utab b/tests/ts/libmount/context-utab
-index aa49806..4c1d117 100755
---- a/tests/ts/libmount/context-utab
-+++ b/tests/ts/libmount/context-utab
-@@ -67,6 +67,8 @@ grep -q $DEVICE /proc/mounts || \
- echo "(by device) cannot find $DEVICE in /proc/mounts" >> $TS_OUTPUT 2>&1
- ts_finalize_subtest
-
-+sleep 1
-+
- ts_init_subtest "umount-by-devname"
- ts_valgrind $TESTPROG --umount $DEVICE >> $TS_OUTPUT 2>&1
- grep -q $DEVICE /proc/mounts &&
-@@ -81,6 +83,8 @@ grep -q $DEVICE $LIBMOUNT_UTAB || \
- echo "(by label) cannot find $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1
- ts_finalize_subtest
-
-+sleep 1
-+
- ts_init_subtest "umount"
- ts_valgrind $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>&1
- grep -q $DEVICE $LIBMOUNT_UTAB && \
-@@ -94,6 +98,8 @@ if [ -x "/sbin/mkfs.btrfs" ]; then
- /sbin/btrfsctl -S sub $MOUNTPOINT &> /dev/null
- umount $MOUNTPOINT &> /dev/null
-
-+ sleep 1
-+
- ts_init_subtest "mount-uhelper-subvol"
- mkdir -p $MOUNTPOINT &> /dev/null
- ts_valgrind $TESTPROG --mount -o uhelper=foo,rw,subvol=sub $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>&1
-@@ -105,6 +111,8 @@ if [ -x "/sbin/mkfs.btrfs" ]; then
- $TS_CMD_FINDMNT --mtab $MOUNTPOINT -o OPTIONS -n >> $TS_OUTPUT 2>&1
- ts_log "---"
-
-+ sleep 1
-+
- ts_init_subtest "umount-subvol"
- ts_valgrind $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>&1
- grep -q $DEVICE $LIBMOUNT_UTAB && \
-diff --git a/tests/ts/libmount/files/fstab b/tests/ts/libmount/files/fstab
-index 2503065..a8f73bc 100644
---- a/tests/ts/libmount/files/fstab
-+++ b/tests/ts/libmount/files/fstab
-@@ -10,3 +10,5 @@ proc /proc proc defaults 0 0
-
- foo.com:/mnt/share /mnt/remote nfs noauto
- //bar.com/gogogo /mnt/gogogo cifs user=SRGROUP/baby,noauto
-+
-+/dev/foo /any/foo/ auto defaults 0 0
-diff --git a/tests/ts/libmount/tabfiles b/tests/ts/libmount/tabfiles
-index 7f4913e..671c649 100755
---- a/tests/ts/libmount/tabfiles
-+++ b/tests/ts/libmount/tabfiles
-@@ -47,6 +47,16 @@ ts_valgrind $TESTPROG --find-forward "$TS_SELF/files/fstab" target /home/foo &>
- sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
- ts_finalize_subtest
-
-+ts_init_subtest "find-target2"
-+ts_valgrind $TESTPROG --find-forward "$TS_SELF/files/fstab" target /any/foo &> $TS_OUTPUT
-+sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
-+ts_finalize_subtest
-+
-+ts_init_subtest "find-target3"
-+ts_valgrind $TESTPROG --find-forward "$TS_SELF/files/fstab" target /any/foo/ &> $TS_OUTPUT
-+sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
-+ts_finalize_subtest
-+
- ts_init_subtest "find-pair"
- ts_valgrind $TESTPROG --find-pair "$TS_SELF/files/mtab" /dev/mapper/kzak-home /home/kzak &> $TS_OUTPUT
- sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
-diff --git a/tests/ts/mount/fstab-none b/tests/ts/mount/fstab-none
-new file mode 100755
-index 0000000..62a89ca
---- /dev/null
-+++ b/tests/ts/mount/fstab-none
-@@ -0,0 +1,30 @@
-+#!/bin/bash
-+
-+TS_TOPDIR="$(dirname $0)/../.."
-+TS_DESC="none"
-+
-+. $TS_TOPDIR/functions.sh
-+ts_init "$*"
-+ts_skip_nonroot
-+
-+set -o pipefail
-+
-+ts_fstab_add "none" "$TS_MOUNTPOINT" "tmpfs" "rw,nosuid,nodev,relatime"
-+
-+mkdir -p $TS_MOUNTPOINT
-+
-+$TS_CMD_MOUNT $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT
-+
-+$TS_CMD_FINDMNT --target "$TS_MOUNTPOINT" &> /dev/null
-+[ $? -eq 0 ] || ts_die "Not found target (mount failed?)"
-+
-+$TS_CMD_FINDMNT --source "none" --target "$TS_MOUNTPOINT" &> /dev/null
-+[ $? -eq 0 ] || ts_die "Not found source and target"
-+
-+$TS_CMD_UMOUNT $TS_MOUNTPOINT || ts_die "Cannot umount $TS_MOUNTPOINT"
-+
-+ts_fstab_clean
-+
-+ts_log "Success"
-+ts_finalize
-+
-diff --git a/tests/ts/mount/shared-subtree b/tests/ts/mount/shared-subtree
-new file mode 100755
-index 0000000..a0a76c5
---- /dev/null
-+++ b/tests/ts/mount/shared-subtree
-@@ -0,0 +1,58 @@
-+#!/bin/bash
-+
-+TS_TOPDIR="$(dirname $0)/../.."
-+TS_DESC="shared-subtree"
-+
-+. $TS_TOPDIR/functions.sh
-+ts_init "$*"
-+ts_skip_nonroot
-+
-+function get_attr()
-+{
-+ # It's usually stupid idea to use 'grep | awk',
-+ # but use paths in awk /regex/ is too tricky...
-+ #
-+ # TODO; improve libmount and findmnt to return the
-+ # shared-subtree flags
-+ #
-+ echo $(grep "$1" /proc/self/mountinfo | \
-+ awk '{print $7}' | \
-+ awk -F ':' '{ print $1 }')
-+}
-+
-+[ -d $TS_MOUNTPOINT ] || mkdir -p $TS_MOUNTPOINT
-+
-+# bind
-+$TS_CMD_MOUNT --bind $TS_MOUNTPOINT $TS_MOUNTPOINT
-+
-+# check the bind
-+$TS_CMD_FINDMNT --kernel --target $TS_MOUNTPOINT &> /dev/null
-+[ "$?" == "0" ] || ts_die "Cannot find binded $TS_MOUNTPOINT in /proc/self/mountinfo"
-+
-+# use the same mounpoint for all sub-tests
-+MOUNTPOINT="$TS_MOUNTPOINT"
-+
-+
-+ts_init_subtest "make-shared"
-+$TS_CMD_MOUNT --make-shared $MOUNTPOINT >> $TS_OUTPUT 2>&1
-+echo "$(get_attr $MOUNTPOINT)" >> $TS_OUTPUT
-+ts_finalize_subtest
-+
-+ts_init_subtest "make-private"
-+$TS_CMD_MOUNT --make-private $MOUNTPOINT >> $TS_OUTPUT 2>&1
-+echo "$(get_attr $MOUNTPOINT)" >> $TS_OUTPUT
-+ts_finalize_subtest
-+
-+ts_init_subtest "make-unbindable"
-+$TS_CMD_MOUNT --make-unbindable $MOUNTPOINT >> $TS_OUTPUT 2>&1
-+echo "$(get_attr $MOUNTPOINT)" >> $TS_OUTPUT
-+ts_finalize_subtest
-+
-+
-+# clean up
-+$TS_CMD_UMOUNT $TS_MOUNTPOINT
-+rmdir $TS_MOUNTPOINT
-+
-+ts_log "Success"
-+ts_finalize
-+