Compare commits

...

5 Commits
rawhide ... f22

Author SHA1 Message Date
Karel Zak 4e0c0bf2d2 add missing patch 2015-12-10 10:26:12 +01:00
Karel Zak 9f9bfbd169 2.26.2-4: fix #1223894 2015-12-10 10:12:25 +01:00
Karel Zak c01d3263c1 2.26.2-3: add dependence on systemd 2015-08-13 11:08:32 +02:00
Karel Zak 3d8e1cf3e5 2.26.2-3: fix specfile 2015-08-13 11:04:07 +02:00
Karel Zak bc1e34e125 2.26.2-3: fix #1248115 2015-08-13 10:41:08 +02:00
3 changed files with 250 additions and 13 deletions

117
2.27-buildsys-without.patch Normal file
View File

@ -0,0 +1,117 @@
diff -up util-linux-2.25.2/configure.ac.kzak util-linux-2.25.2/configure.ac
--- util-linux-2.25.2/configure.ac.kzak 2014-10-24 12:24:02.952545559 +0200
+++ util-linux-2.25.2/configure.ac 2015-05-22 13:08:25.120672632 +0200
@@ -501,8 +501,28 @@ AS_CASE([$scanf_cv_alloc_modifier],
have_scanf_alloc_modifier=no]
)
-UL_CHECK_LIB([util], [openpty])
-UL_CHECK_LIB([termcap], [tgetnum])
+
+AC_ARG_WITH([util], AS_HELP_STRING([--without-util], [compile without libutil]),
+ [], [with_util=auto]
+)
+AS_IF([test "x$with_util" = xno], [
+ AM_CONDITIONAL([HAVE_UTIL], [false])
+ have_util=no
+], [
+ UL_CHECK_LIB([util], [openpty])
+])
+
+
+AC_ARG_WITH([termcap], AS_HELP_STRING([--without-termcap], [compile without libtermcap]),
+ [], [with_termcap=auto]
+)
+AS_IF([test "x$with_termcap" = xno], [
+ AM_CONDITIONAL([HAVE_TERMCAP], [false])
+ have_termcap=no
+], [
+ UL_CHECK_LIB([termcap], [tgetnum])
+])
+
AC_CHECK_TYPES([union semun], [], [], [[
#include <sys/sem.h>
@@ -725,17 +745,24 @@ AS_IF([test "x$have_slang" = xyes -o "x$
])
-dnl Try pkg-config for libtinfo
-PKG_CHECK_MODULES(TINFO, [tinfo], [have_tinfo=yes], [
- dnl If that failed, fall back to classic searching.
- AC_CHECK_LIB([tinfo], [tgetent], [
- have_tinfo=yes
- TINFO_LIBS="-ltinfo"
- TINFO_CFLAGS=""])
+AC_ARG_WITH([tinfo], AS_HELP_STRING([--without-tinfo], [compile without libtinfo]),
+ [], [with_tinfo=auto]
+)
+have_tinfo=no
+AS_IF([test "x$with_tinfo" != xno], [
+ dnl Try pkg-config for libtinfo
+ PKG_CHECK_MODULES(TINFO, [tinfo], [have_tinfo=yes], [
+ dnl If that failed, fall back to classic searching.
+ AC_CHECK_LIB([tinfo], [tgetent], [
+ have_tinfo=yes
+ TINFO_LIBS="-ltinfo"
+ TINFO_CFLAGS=""])
+ ])
])
AC_SUBST([TINFO_LIBS])
AC_SUBST([TINFO_CFLAGS])
AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes])
+AS_IF([test "x$have_tinfo" = xyes], [AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo available.])])
AC_ARG_WITH([utempter],
@@ -753,7 +780,6 @@ AS_IF([test "x$with_utempter" = xyes], [
])
-
dnl
dnl libuuid
dnl
@@ -994,10 +1020,16 @@ UL_REQUIRES_SYSCALL_CHECK([nsenter], [UL
AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes])
AC_CHECK_FUNCS([setns])
-dnl setpriv depends on libcap-ng. It would be possible to build
-dnl a version of setpriv with limited functionality without libcap-ng,
-dnl but this isn't currently supported.
-UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
+
+AC_ARG_WITH([cap_ng],
+ AS_HELP_STRING([--without-capng], [compile without libcap-ng]),
+ [], [with_cap_ng=auto]
+)
+AS_IF([test "x$with_cap_ng" = xno], [have_cap_ng=no],[
+ UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng])
+])
+
+
AC_ARG_ENABLE([setpriv],
AS_HELP_STRING([--disable-setpriv], [do not build setpriv]),
[], [UL_DEFAULT_ENABLE([setpriv], [check])]
@@ -1027,12 +1059,20 @@ UL_BUILD_INIT([agetty])
AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes])
+AC_ARG_WITH([libz],
+ AS_HELP_STRING([--without-libz], [compile without libz]),
+ [], [with_libz=auto]
+)
+AS_IF([test "x$with_libz" = xno], [have_z=no], [
+ AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
+])
+
+
AC_ARG_ENABLE([cramfs],
AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
[], [UL_DEFAULT_ENABLE([cramfs], [check])]
)
UL_BUILD_INIT([cramfs])
-AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no])
UL_REQUIRES_HAVE([cramfs], [z], [z library])
AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes])

View File

@ -0,0 +1,99 @@
diff -up util-linux-2.26.2/libfdisk/src/dos.c.kzak util-linux-2.26.2/libfdisk/src/dos.c
--- util-linux-2.26.2/libfdisk/src/dos.c.kzak 2015-04-29 12:41:22.705973232 +0200
+++ util-linux-2.26.2/libfdisk/src/dos.c 2015-08-13 10:24:23.651856847 +0200
@@ -1529,7 +1529,7 @@ static int dos_add_partition(struct fdis
goto done;
/* pa specifies that extended partition is wanted */
- } else if (pa && pa->type && pa->type->code == MBR_DOS_EXTENDED_PARTITION) {
+ } else if (pa && pa->type && IS_EXTENDED(pa->type->code)) {
DBG(LABEL, ul_debug("DOS: pa template %p: add extened", pa));
if (l->ext_offset) {
fdisk_warnx(cxt, _("Extended partition already exists."));
@@ -1894,11 +1894,25 @@ static int dos_get_partition(struct fdis
return 0;
}
+static int has_logical(struct fdisk_context *cxt)
+{
+ size_t i;
+ struct fdisk_dos_label *l = self_label(cxt);
+
+ for (i = 4; i < cxt->label->nparts_max; i++) {
+ if (l->ptes[i].pt_entry)
+ return 1;
+ }
+ return 0;
+}
+
static int dos_set_partition(struct fdisk_context *cxt, size_t n,
struct fdisk_partition *pa)
{
+ struct fdisk_dos_label *l;
struct dos_partition *p;
struct pte *pe;
+ int orgtype;
fdisk_sector_t start, size;
assert(cxt);
@@ -1909,17 +1923,29 @@ static int dos_set_partition(struct fdis
if (n >= cxt->label->nparts_max)
return -EINVAL;
- if (pa->type && IS_EXTENDED(pa->type->code)) {
- fdisk_warnx(cxt, _("You cannot change a partition into an "
- "extended one or vice versa. Delete it first."));
- return -EINVAL;
- }
-
- if (pa->type && !pa->type->code)
- fdisk_warnx(cxt, _("Type 0 means free space to many systems. "
- "Having partitions of type 0 is probably unwise."));
+ l = self_label(cxt);
p = self_partition(cxt, n);
pe = self_pte(cxt, n);
+ orgtype = p->sys_ind;
+
+ if (pa->type) {
+ if (IS_EXTENDED(pa->type->code) && l->ext_offset) {
+ fdisk_warnx(cxt, _("Extended partition already exists."));
+ return -EINVAL;
+ }
+
+ if (!pa->type->code)
+ fdisk_warnx(cxt, _("Type 0 means free space to many systems. "
+ "Having partitions of type 0 is probably unwise."));
+
+ if (IS_EXTENDED(p->sys_ind) && !IS_EXTENDED(pa->type->code) && has_logical(cxt)) {
+ fdisk_warnx(cxt, _(
+ "Cannot change type of the extended partition which is "
+ "already used by logical partitons. Delete logical "
+ "partitions first."));
+ return -EINVAL;
+ }
+ }
FDISK_INIT_UNDEF(start);
FDISK_INIT_UNDEF(size);
@@ -1950,6 +1976,21 @@ static int dos_set_partition(struct fdis
p->boot_ind = fdisk_partition_is_bootable(pa) ? ACTIVE_FLAG : 0;
}
+ if (pa->type) {
+ if (IS_EXTENDED(pa->type->code) && !IS_EXTENDED(orgtype)) {
+ /* new extended partition - create a reference */
+ l->ext_index = n;
+ l->ext_offset = dos_partition_get_start(p);
+ pe->ex_entry = p;
+ } else if (IS_EXTENDED(orgtype)) {
+ /* remove extended partition */
+ cxt->label->nparts_max = 4;
+ l->ptes[l->ext_index].ex_entry = NULL;
+ l->ext_offset = 0;
+ l->ext_index = 0;
+ }
+ }
+
partition_set_changed(cxt, n, 1);
return 0;
}

View File

@ -2,7 +2,7 @@
Summary: A collection of basic system utilities
Name: util-linux
Version: 2.26.2
Release: 2%{?dist}
Release: 4%{?dist}
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
Group: System Environment/Base
URL: http://en.wikipedia.org/wiki/Util-linux
@ -22,10 +22,17 @@ BuildRequires: zlib-devel
BuildRequires: popt-devel
BuildRequires: libutempter-devel
Buildrequires: systemd-devel
BuildRequires: systemd
Buildrequires: libuser-devel
BuildRequires: libcap-ng-devel
BuildRequires: python3-devel
# due to patch to build-sys
BuildRequires: gettext-devel
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
### Sources
Source0: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.26/util-linux-%{upstream_version}.tar.xz
Source1: util-linux-login.pamd
@ -78,6 +85,12 @@ Requires: libfdisk = %{version}-%{release}
# 151635 - makeing /var/log/lastlog
Patch0: 2.23-login-lastlog-create.patch
### Upstream patches
# 1248115 - sfdisk: you cannot change a partition into an extended one or vice versa
Patch1: 2.27-libfdisk-mbr-ext.patch
# 1223894 - util-linux FTBFS during stage1 bootstrap
Patch2: 2.27-buildsys-without.patch
%description
The util-linux package contains a large variety of low-level system
utilities that are necessary for a Linux system to function. Among
@ -245,6 +258,7 @@ mountinfo, etc) and mount filesystems.
%prep
%autosetup -p1 -n %{name}-%{upstream_version}
./autogen.sh
%build
unset LINGUAS || :
@ -367,7 +381,7 @@ for I in /sbin/sfdisk \
done
%endif
# we install getopt-*.{bash,tcsh} by %doc directive
# we install getopt-*.{bash,tcsh} by doc directive
chmod 644 misc-utils/getopt-*.{bash,tcsh}
rm -f ${RPM_BUILD_ROOT}%{_datadir}/doc/util-linux/getopt/*
rmdir ${RPM_BUILD_ROOT}%{_datadir}/doc/util-linux/getopt
@ -879,6 +893,13 @@ exit 0
%{_libdir}/python*/site-packages/libmount/*
%changelog
* Thu Dec 10 2015 Karel Zak <kzak@redhat.com> 2.26.2-4
- fix #1223894 - util-linux FTBFS during stage1 bootstrap
* Thu Aug 13 2015 Karel Zak <kzak@redhat.com> 2.26.2-3
- fix #1248115 - sfdisk: you cannot change a partition into an extended one or vice versa
- fix dates in the spec file
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.26.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
@ -911,7 +932,7 @@ exit 0
* Thu Nov 27 2014 Karel Zak <kzak@redhat.com> 2.25.2-2
- fix #1168490 - CVE-2014-9114 util-linux: command injection flaw in blkid
* Wed Oct 24 2014 Karel Zak <kzak@redhat.com> 2.25.2-1
* Fri Oct 24 2014 Karel Zak <kzak@redhat.com> 2.25.2-1
- upgrade to stable 2.25.2
ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.25/v2.25.2-ReleaseNotes
@ -1077,7 +1098,7 @@ exit 0
- apply pathes from upstream stable/v2.22 branch
- fix #865961 - wipefs -a should use O_EXCL
* Thu Oct 10 2012 Karel Zak <kzak@redhat.com> 2.22.1-1
* Wed Oct 10 2012 Karel Zak <kzak@redhat.com> 2.22.1-1
- upgrade to the release 2.22.1
* Wed Oct 3 2012 Karel Zak <kzak@redhat.com> 2.22-2
@ -1116,7 +1137,7 @@ exit 0
* Thu Feb 09 2012 Karel Zak <kzak@redhat.com> 2.21-0.2
- fix #788703 - /run/blkid does not exist
* Thu Feb 07 2012 Karel Zak <kzak@redhat.com> 2.21-0.1
* Tue Feb 07 2012 Karel Zak <kzak@redhat.com> 2.21-0.1
- upgrade to the release 2.21-rc2
ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.21/v2.21-ReleaseNotes
- add {fsck,mkfs}.minix
@ -1151,7 +1172,7 @@ exit 0
- upgrade to the release 2.20-rc2
ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.20/v2.20-rc2-ChangeLog
* Fri Aug 2 2011 Karel Zak <kzak@redhat.com> 2.20-0.1
* Tue Aug 2 2011 Karel Zak <kzak@redhat.com> 2.20-0.1
- upgrade to the release 2.20-rc1
ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.20/v2.20-ReleaseNotes
@ -1259,7 +1280,7 @@ exit 0
- remove Provides: lib{uuid,blkid}-static (thanks to Michael Schwendt)
- remove useless URL to sf.net
* Thu Jan 8 2010 Karel Zak <kzak@redhat.com> 2.17-1
* Fri Jan 8 2010 Karel Zak <kzak@redhat.com> 2.17-1
- upgrade to the final 2.17
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17-ReleaseNotes
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17-ChangeLog
@ -1531,7 +1552,7 @@ exit 0
- fix #217240 - namei ignores non-directory components instead of saying "Not a directory"
- fix #217241 - namei enforces symlink limits inconsistently
* Wed Dec 14 2006 Karel Zak <kzak@redhat.com> 2.13-0.46
* Thu Dec 14 2006 Karel Zak <kzak@redhat.com> 2.13-0.46
- fix leaking file descriptor in the more command (patch by Steve Grubb)
* Wed Dec 13 2006 Karel Zak <kzak@redhat.com> 2.13-0.45
@ -1655,11 +1676,11 @@ exit 0
This drastically increases the total number of tcp mounts
that can happen at once (ala autofs).
* Wed Mar 9 2006 Jesse Keating <jkeating@redhat.com> 2.13-0.20
* Thu Mar 9 2006 Jesse Keating <jkeating@redhat.com> 2.13-0.20
- Better calling of restorecon as suggested by Bill Nottingham
- prereq restorecon to avoid ordering issues
* Wed Mar 9 2006 Jesse Keating <jkeating@redhat.com> 2.13-0.19
* Thu Mar 9 2006 Jesse Keating <jkeating@redhat.com> 2.13-0.19
- restorecon /var/log/lastlog
* Wed Mar 8 2006 Karel Zak <kzak@redhat.com> 2.13-0.17
@ -1923,7 +1944,7 @@ exit 0
- Ping NFS v4 servers before diving into kernel
- Make v4 mount interruptible which also make the intr option on by default
* Sun Mar 13 2004 <SteveD@RedHat.com>
* Sat Mar 13 2004 <SteveD@RedHat.com>
- Reworked how the rpc.idmapd and rpc.gssd checks were
done due to review comments from upstream.
- Added rpc_strerror() so the '-v' flag will show RPC errors.
@ -2022,7 +2043,7 @@ exit 0
* Wed Jul 23 2003 Elliot Lee <sopwith@redhat.com> 2.11y-22
- #100433 patch
* Mon Jun 14 2003 Elliot Lee <sopwith@redhat.com> 2.11y-20
* Sat Jun 14 2003 Elliot Lee <sopwith@redhat.com> 2.11y-20
- #97381 patch
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
@ -2204,7 +2225,7 @@ slang-devel.
* Tue Feb 26 2002 Elliot Lee <sopwith@redhat.com> 2.11n-5
- Fix #60363 (tweak raw.8 man page, make rawdevices.8 symlink).
* Tue Jan 28 2002 Bill Nottingham <notting@redhat.com> 2.11n-4
* Mon Jan 28 2002 Bill Nottingham <notting@redhat.com> 2.11n-4
- remove kbdrate (fixes kbd conflict)
* Fri Dec 28 2001 Elliot Lee <sopwith@redhat.com> 2.11n-3