Compare commits

..

5 commits

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
20 changed files with 2429 additions and 3081 deletions

View file

@ -1 +0,0 @@
1

65
.gitignore vendored
View file

@ -41,68 +41,3 @@
/util-linux-2.26-rc2.tar.xz
/util-linux-2.26.tar.xz
/util-linux-2.26.2.tar.xz
/util-linux-2.27-rc1.tar.xz
/util-linux-2.27-rc2.tar.xz
/util-linux-2.27.tar.xz
/util-linux-2.27.1.tar.xz
/util-linux-2.28-rc1.tar.xz
/util-linux-2.28-rc2.tar.xz
/util-linux-2.28.tar.xz
/util-linux-2.28.1.tar.xz
/util-linux-2.28.2.tar.xz
/util-linux-2.29-rc1.tar.xz
/util-linux-2.29-rc2.tar.xz
/util-linux-2.29.tar.xz
/util-linux-2.29.1.tar.xz
/util-linux-2.29.2.tar.xz
/util-linux-2.30-rc1.tar.xz
/util-linux-2.30.tar.xz
/util-linux-2.30.1.tar.xz
/util-linux-2.30.2.tar.xz
/util-linux-2.31-rc1.tar.xz
/util-linux-2.31-rc2.tar.xz
/util-linux-2.31.tar.xz
/util-linux-2.32-rc1.tar.xz
/util-linux-2.32.tar.xz
/util-linux-2.32.1.tar.xz
/util-linux-2.33-rc2.tar.xz
/util-linux-2.33.1.tar.xz
/util-linux-2.33.2.tar.xz
/util-linux-2.34-rc1.tar.xz
/util-linux-2.34-rc2.tar.xz
/util-linux-2.34.tar.xz
/util-linux-2.35-rc1.tar.xz
/util-linux-2.35-rc1-20-63f8.tar.xz
/util-linux-2.35-rc2.tar.xz
/util-linux-2.35.tar.xz
/util-linux-2.35.1.tar.xz
/util-linux-2.35.2.tar.xz
/util-linux-2.36.tar.xz
/util-linux-2.36.1.tar.xz
/util-linux-2.36.2.tar.xz
/util-linux-2.37-rc2.tar.xz
/util-linux-2.37.tar.xz
/util-linux-2.37.2.tar.xz
/util-linux-2.38-rc1.tar.xz
/util-linux-2.38-rc3.tar.xz
/util-linux-2.38.tar.xz
/util-linux-2.38.1.tar.xz
/util-linux-2.39-rc1.tar.xz
/util-linux-2.39-rc2.tar.xz
/util-linux-2.39-rc3.tar.xz
/util-linux-2.39.tar.xz
/util-linux-2.39.1.tar.xz
/util-linux-2.39.2.tar.xz
/util-linux-2.39.3.tar.xz
/util-linux-2.40-rc1.tar.xz
/util-linux-2.40.tar.xz
/util-linux-2.40.1.tar.xz
/util-linux-2.40.2.tar.xz
/util-linux-2.40.4.tar.xz
/util-linux-2.41.tar.xz
/util-linux-2.41.1.tar.xz
/util-linux-2.41.2.tar.xz
/util-linux-2.41.3.tar.xz
/util-linux-2.42.tar.xz
/util-linux-2.42.1.tar.xz
/util-linux-2.42.2.tar.xz

View file

@ -1,27 +0,0 @@
From a2357184ff3dc3beb001fcb12e1e4c0dcf8d0dbd Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 2 Dec 2025 16:15:44 +0100
Subject: login: use O_CREAT on lastlog
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=151635
Signed-off-by: Karel Zak <kzak@redhat.com>
---
login-utils/login.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/login-utils/login.c b/login-utils/login.c
index 321f9d6ce..edc69fd9a 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -682,7 +682,7 @@ static void log_lastlog(struct login_context *cxt)
sa.sa_handler = SIG_IGN;
sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
- fd = open(_PATH_LASTLOG, O_RDWR, 0);
+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
if (fd < 0)
goto done;
offset = cxt->pwd->pw_uid * sizeof(ll);
--
2.51.1

View file

@ -1,27 +0,0 @@
From 617a887a6ec7e433f6a9f4c60592ed38b12b9f18 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 2 Dec 2025 16:17:55 +0100
Subject: login: add /run/motd.d` to the hardcoded MOTD_FILE
Addresses: https://github.com/coreos/console-login-helper-messages/issues/60
Signed-off-by: Karel Zak <kzak@redhat.com>
---
include/pathnames.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/pathnames.h b/include/pathnames.h
index 34ba11ca3..c91a077e1 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -41,7 +41,7 @@
#ifndef _PATH_MAILDIR
# define _PATH_MAILDIR "/var/spool/mail"
#endif
-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
+#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d"
#ifndef _PATH_NOLOGIN
# define _PATH_NOLOGIN "/etc/nologin"
#endif
--
2.51.1

View file

@ -0,0 +1,11 @@
diff -up util-linux-2.23.2/login-utils/login.c.kzak util-linux-2.23.2/login-utils/login.c
--- util-linux-2.23.2/login-utils/login.c.kzak 2013-07-30 10:39:26.222738397 +0200
+++ util-linux-2.23.2/login-utils/login.c 2013-09-09 09:01:39.923225757 +0200
@@ -502,7 +502,7 @@ static void log_lastlog(struct login_con
if (!cxt->pwd)
return;
- fd = open(_PATH_LASTLOG, O_RDWR, 0);
+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
if (fd < 0)
return;

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

@ -1,2 +0,0 @@
0.0 0 0.0
0

2341
changelog

File diff suppressed because it is too large Load diff

View file

@ -1,5 +0,0 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View file

@ -1 +1 @@
SHA512 (util-linux-2.42.2.tar.xz) = 7415add0be2930654e322830808dde03ff6d511bd357f0679e6b6287a13ca79fe58ce4ac05edef86b76fb381b3a36ca2da9d3c31b5dc0a1d889c203156a57277
9bdf368c395f1b70325d0eb22c7f48fb util-linux-2.26.2.tar.xz

View file

@ -1,64 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/util-linux/various
# Description: This test groups small sanity and regression tests for util-linux
# Author: Miroslav Vadkerti <mvadkert@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/util-linux/Sanity/various
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Miroslav Vadkerti <mvadkert@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: This test groups small sanity and regression tests for util-linux" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: util-linux" >> $(METADATA)
@echo "Requires: util-linux util-linux-user" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL3 -RHEL4 -RHEL5Server -RHEL5Client -RHEL6" >> $(METADATA)
rhts-lint $(METADATA)

View file

@ -1,3 +0,0 @@
PURPOSE of /CoreOS/util-linux/various
Description: This test groups small sanity and regression tests for util-linux
Author: Miroslav Vadkerti <mvadkert@redhat.com>

View file

@ -1,13 +0,0 @@
summary: This test groups small sanity and regression tests for util-linux
description: ''
contact: Miroslav Vadkerti <mvadkert@redhat.com>
component:
- util-linux
test: ./runtest.sh
framework: beakerlib
recommend:
- util-linux
- util-linux-user
duration: 10m
extra-summary: /CoreOS/util-linux/Sanity/various
extra-task: /CoreOS/util-linux/Sanity/various

View file

@ -1,51 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/util-linux/various
# Description: This test groups small sanity and regression tests for util-linux
# Author: Miroslav Vadkerti <mvadkert@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="util-linux"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlPhaseEnd
rlPhaseStartTest "return code of chfn should be always 1 in case failure"
rlRun "chfn -f a:b" 1
rlRun "chfn -o a:b" 1
rlRun "chfn -p a:b" 1
rlRun "chfn -h a:b" 1
rlRun "chfn -x a:b" 1
rlRun "chfn -f a -o b -p c -h d unknown-user" 1
rlPhaseEnd
rlPhaseStartCleanup
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

8
util-linux-60-raw.rules Normal file
View file

@ -0,0 +1,8 @@
#
# Enter raw device bindings here.
#
# An example would be:
# ACTION=="add", KERNEL=="sda", RUN+="/usr/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
# ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/usr/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.

View file

@ -7,6 +7,7 @@ password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open
session required pam_namespace.so

View file

@ -1,5 +1,4 @@
#%PAM-1.0
auth required pam_env.so
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
d /run/uuidd 2775 uuidd uuidd