Accepting request 1164989 from home:kukuk:cleanup

- Update to release 2.40
  * Add lastlog2
  * agetty: Load autologin user from agetty.autologin credential
  * agetty: use get_terminal_default_type()
  * agetty: use sd_get_sessions() for number of users (#2088)
  * blockdev: add support for BLKGETZONESZ
  * cfdisk: ask y/n before wipe
  * cfdisk: properly handle out-of-order partitions during resize
  * chcpu: document limitations of -g
  * chsh: use libeconf to read /etc/shells
  * column: fix -l
  * column: fix memory leak
  * dmesg: fix FD leak
  * dmesg: fix delta calculation
  * dmesg: fix wrong size calculation
  * dmesg: support reading kmsg format from file
  * enosys: a new small command to make syscalls fail with ENOSYS
  * exch: new command to atomically exchanges paths between two files
  * fdisk: add support for partition resizing
  * fdisk: remove usage of VLA
  * fincore: add --output-all
  * findmnt: add --list-columns
  * findmnt: add -I, --dfi options for imitating the output of df -i
  * findmnt: add inode-related columns for implementing "df -i" like output
  * hexdump: add '--one-byte-hex' format option
  * hwclock: add support for RTC_VL_READ/RTC_VL_CLR ioctls
  * login: initialize noauth from login.noauth credential
  * lsblk: add --filter
  * lsblk: add --highlight
  * lsblk: add --list-columns

OBS-URL: https://build.opensuse.org/request/show/1164989
OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=552
This commit is contained in:
Jan Engelhardt 2024-04-04 22:34:28 +00:00 committed by Git OBS Bridge
parent db8cb8ac35
commit 796cf6f6e1
11 changed files with 203 additions and 742 deletions

View File

@ -1,44 +0,0 @@
From 93ba7961779789217a1f814ce3110ff8c040c8c3 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.de>
Date: Wed, 12 Jul 2023 15:48:27 +0200
Subject: [PATCH] Revert "libblkid: try LUKS2 first when probing"
References: https://github.com/util-linux/util-linux/pull/2373
mdadm superblocks before 1.1 are placed at the end of the device, which
means that the data contained inside the array starts at offset 0. For
LUKS inside MD, blkid falsely detects this as plain LUKS instead of a
linux_raid_member. This causes e.g. dracut to not assemble the array
during boot and system startup fails.
This reverts commit b8889c0a214aeb3dd47bf1ab280fe5534b64d2aa.
---
libblkid/src/superblocks/superblocks.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/libblkid/src/superblocks/superblocks.c b/libblkid/src/superblocks/superblocks.c
index fb0392707..c7789a15b 100644
--- a/libblkid/src/superblocks/superblocks.c
+++ b/libblkid/src/superblocks/superblocks.c
@@ -94,11 +94,6 @@ static int blkid_probe_set_usage(blkid_probe pr, int usage);
*/
static const struct blkid_idinfo *idinfos[] =
{
- /* In case the volume is locked with OPAL we are going to get
- * an I/O error when reading past the LUKS header, so try it
- * first. */
- &luks_idinfo,
-
/* RAIDs */
&linuxraid_idinfo,
&ddfraid_idinfo,
@@ -124,6 +119,7 @@ static const struct blkid_idinfo *idinfos[] =
&snapcow_idinfo,
&verity_hash_idinfo,
&integrity_idinfo,
+ &luks_idinfo,
&vmfs_volume_idinfo,
&ubi_idinfo,
&vdo_idinfo,
--
2.41.0

View File

@ -0,0 +1,60 @@
From f98a4c12b366ae2b5e01fa30d72eef34f3bab681 Mon Sep 17 00:00:00 2001
From: Masatake YAMATO <yamato@redhat.com>
Date: Tue, 2 Apr 2024 06:34:40 +0900
Subject: [PATCH 2/2] tests: (test_mkfds::sockdiag) verify the recieved message
to detect whether the socket is usable or not
Close #2822.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
tests/helpers/test_mkfds.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c
index 39427ba09a..4b138c2efd 100644
--- a/tests/helpers/test_mkfds.c
+++ b/tests/helpers/test_mkfds.c
@@ -3200,6 +3200,25 @@ static int send_diag_request(int diagsd, void *req, size_t req_size)
return 0;
}
+static int recv_diag_request(int diagsd)
+{
+ __attribute__((aligned(sizeof(void *)))) uint8_t buf[8192];
+ const struct nlmsghdr *h;
+ int r = recvfrom(diagsd, buf, sizeof(buf), 0, NULL, NULL);;
+ if (r < 0)
+ return errno;
+
+ h = (void *)buf;
+ if (!NLMSG_OK(h, (size_t)r))
+ return -1;
+
+ if (h->nlmsg_type == NLMSG_ERROR) {
+ struct nlmsgerr *e = (struct nlmsgerr *)NLMSG_DATA(h);
+ return - e->error;
+ }
+ return 0;
+}
+
static void *make_sockdiag(const struct factory *factory, struct fdesc fdescs[],
int argc, char ** argv)
{
@@ -3243,6 +3262,16 @@ static void *make_sockdiag(const struct factory *factory, struct fdesc fdescs[],
err(EXIT_FAILURE, "failed in sendmsg()");
}
+ e = recv_diag_request(diagsd);
+ if (e != 0) {
+ close (diagsd);
+ if (e == ENOENT)
+ err(EXIT_ENOENT, "failed in recvfrom()");
+ if (e > 0)
+ err(EXIT_FAILURE, "failed in recvfrom()");
+ if (e < 0)
+ errx(EXIT_FAILURE, "failed in recvfrom() => -1");
+ }
if (diagsd != fdescs[0].fd) {
if (dup2(diagsd, fdescs[0].fd) < 0) {

View File

@ -1,36 +0,0 @@
From 4524f5d6b7d90684f2b205e472cd65a682d5fab5 Mon Sep 17 00:00:00 2001
From: Goldwyn Rodrigues <rgoldwyn@suse.de>
Date: Wed, 29 Nov 2023 11:36:23 -0600
Subject: [PATCH] tests: increase delay for waitpid test
References: bsc#1217651
In some test executions on s390x, the waitpid test fails because 1
gets printed before 2.
[ 557s] --- /home/abuild/rpmbuild/BUILD/util-linux-2.39.2/tests/expected/misc/waitpid-normal 2023-06-14 09:11:15.910887765 +0000
[ 557s] +++ /home/abuild/rpmbuild/BUILD/util-linux-2.39.2/tests/output/misc/waitpid-normal 2023-11-27 23:30:30.406675022 +0000
[ 557s] @@ -1,4 +1,4 @@
[ 557s] 3
[ 557s] -2
[ 557s] 1
[ 557s] +2
[ 557s] 4
Increase the time to print 1, so the test numbers are printed in
expected order.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
diff --git a/tests/ts/misc/waitpid b/tests/ts/misc/waitpid
index daed74fe0..904222c05 100755
--- a/tests/ts/misc/waitpid
+++ b/tests/ts/misc/waitpid
@@ -24,7 +24,7 @@ ts_check_test_command "$TS_CMD_WAITPID"
ts_init_subtest normal
-(sleep 0.2; echo 1 >> "$TS_OUTPUT") &
+(sleep 0.5; echo 1 >> "$TS_OUTPUT") &
BG1="$!"
(sleep 0.1; echo 2 >> "$TS_OUTPUT") &

View File

@ -1,357 +0,0 @@
From: Thorsten Kukuk <kukuk@suse.com>
Date: 2023-08-17 08:03:09+0000
References: https://github.com/util-linux/util-linux/pull/2100
diff --git a/configure.ac b/configure.ac
index d631b062d2..17d3ab703b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2491,6 +2491,7 @@ AS_IF([test "x$with_systemd" != xno], [
[*:yes],
AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available])
AC_DEFINE([USE_SYSTEMD], [1], [Define if systemd support is wanted ])
+ AC_CHECK_DECLS([sd_session_get_username], [], [], [#include <systemd/sd-login.h>])
)
])
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = xyes])
diff --git a/term-utils/Makemodule.am b/term-utils/Makemodule.am
index 07004d43ca..1542320422 100644
--- a/term-utils/Makemodule.am
+++ b/term-utils/Makemodule.am
@@ -98,6 +98,10 @@ dist_noinst_DATA += term-utils/wall.1.adoc
wall_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
wall_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
wall_LDADD = $(LDADD) libcommon.la
+if HAVE_SYSTEMD
+wall_LDADD += $(SYSTEMD_LIBS)
+wall_CFLAGS += $(SYSTEMD_CFLAGS)
+endif
if USE_TTY_GROUP
if MAKEINSTALL_DO_CHOWN
install-exec-hook-wall::
diff --git a/term-utils/wall.c b/term-utils/wall.c
index c601d3e5b7..313b1bdee5 100644
--- a/term-utils/wall.c
+++ b/term-utils/wall.c
@@ -61,6 +61,11 @@
#include <sys/types.h>
#include <grp.h>
+#if defined(USE_SYSTEMD) && HAVE_DECL_SD_SESSION_GET_USERNAME == 1
+# include <systemd/sd-login.h>
+# include <systemd/sd-daemon.h>
+#endif
+
#include "nls.h"
#include "xalloc.h"
#include "strutils.h"
@@ -246,6 +251,37 @@ int main(int argc, char **argv)
iov.iov_base = mbuf;
iov.iov_len = mbufsize;
+#if defined(USE_SYSTEMD) && HAVE_DECL_SD_SESSION_GET_USERNAME == 1
+ if (sd_booted() > 0) {
+ char **sessions_list;
+ int sessions;
+
+ sessions = sd_get_sessions(&sessions_list);
+ if (sessions < 0)
+ errx(EXIT_FAILURE, _("error getting sessions: %s"),
+ strerror(-sessions));
+
+ for (int i = 0; i < sessions; i++) {
+ char *name, *tty;
+ int r;
+
+ if ((r = sd_session_get_username(sessions_list[i], &name)) < 0)
+ errx(EXIT_FAILURE, _("get user name failed: %s"), strerror (-r));
+
+ if (!(group_buf && !is_gr_member(name, group_buf))) {
+ if (sd_session_get_tty(sessions_list[i], &tty) >= 0) {
+ if ((p = ttymsg(&iov, 1, tty, timeout)) != NULL)
+ warnx("%s", p);
+
+ free(tty);
+ }
+ }
+ free(name);
+ free(sessions_list[i]);
+ }
+ free(sessions_list);
+ } else {
+#endif
while((utmpptr = getutxent())) {
if (!utmpptr->ut_user[0])
continue;
@@ -269,6 +305,9 @@ int main(int argc, char **argv)
warnx("%s", p);
}
endutxent();
+#if defined(USE_SYSTEMD) && HAVE_DECL_SD_SESSION_GET_USERNAME == 1
+ }
+#endif
free(mbuf);
free_group_workspace(group_buf);
exit(EXIT_SUCCESS);
From e915e6baeba3cbce154336a4f1f24a8be93e85ae Mon Sep 17 00:00:00 2001
From: Thorsten Kukuk <kukuk@suse.com>
Date: Wed, 31 May 2023 08:57:01 +0200
Subject: [PATCH 2/3] agetty: use sd_get_sessions() for number of users (#2088)
---
term-utils/Makemodule.am | 4 ++++
term-utils/agetty.c | 28 ++++++++++++++++++++++------
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/term-utils/Makemodule.am b/term-utils/Makemodule.am
index 1542320422..b7037fb116 100644
--- a/term-utils/Makemodule.am
+++ b/term-utils/Makemodule.am
@@ -58,6 +58,10 @@ endif
if HAVE_ECONF
agetty_LDADD += -leconf
endif
+if HAVE_SYSTEMD
+agetty_LDADD += $(SYSTEMD_LIBS)
+agetty_CFLAGS = $(SYSTEMD_CFLAGS)
+endif
endif # BUILD_AGETTY
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index cf8725537b..6bc3e5b5a8 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -73,6 +73,11 @@
# endif
#endif
+#ifdef USE_SYSTEMD
+# include <systemd/sd-daemon.h>
+# include <systemd/sd-login.h>
+#endif
+
#ifdef __linux__
# include <sys/kd.h>
# define USE_SYSLOG
@@ -2864,12 +2869,23 @@ static void output_special_char(struct issue *ie,
case 'U':
{
int users = 0;
- struct utmpx *ut;
- setutxent();
- while ((ut = getutxent()))
- if (ut->ut_type == USER_PROCESS)
- users++;
- endutxent();
+#ifdef USE_SYSTEMD
+ if (sd_booted() > 0) {
+ users = sd_get_sessions(NULL);
+ if (users < 0)
+ users = 0;
+ } else {
+#endif
+ users = 0;
+ struct utmpx *ut;
+ setutxent();
+ while ((ut = getutxent()))
+ if (ut->ut_type == USER_PROCESS)
+ users++;
+ endutxent();
+#ifdef USE_SYSTEMD
+ }
+#endif
if (c == 'U')
fprintf(ie->output, P_("%d user", "%d users", users), users);
else
From 5c62c27001467f3ef0baaa66ae4e3bb80a0298a6 Mon Sep 17 00:00:00 2001
From: Thorsten Kukuk <kukuk@suse.com>
Date: Wed, 31 May 2023 09:00:09 +0200
Subject: [PATCH 3/3] write: query logind for list of users with tty (#2088)
---
term-utils/Makemodule.am | 4 ++
term-utils/write.c | 130 +++++++++++++++++++++++++++++++++++----
2 files changed, 123 insertions(+), 11 deletions(-)
diff --git a/term-utils/Makemodule.am b/term-utils/Makemodule.am
index b7037fb116..1efe1c57e3 100644
--- a/term-utils/Makemodule.am
+++ b/term-utils/Makemodule.am
@@ -126,6 +126,10 @@ write_SOURCES = term-utils/write.c
write_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
write_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
write_LDADD = $(LDADD) libcommon.la
+if HAVE_SYSTEMD
+write_LDADD += $(SYSTEMD_LIBS)
+write_CFLAGS += $(SYSTEMD_CFLAGS)
+endif
if USE_TTY_GROUP
if MAKEINSTALL_DO_CHOWN
diff --git a/term-utils/write.c b/term-utils/write.c
index 8b86e9a9d5..8aa450d563 100644
--- a/term-utils/write.c
+++ b/term-utils/write.c
@@ -59,6 +59,11 @@
#include <unistd.h>
#include <utmpx.h>
+#if defined(USE_SYSTEMD) && HAVE_DECL_SD_SESSION_GET_USERNAME == 1
+# include <systemd/sd-login.h>
+# include <systemd/sd-daemon.h>
+#endif
+
#include "c.h"
#include "carefulputc.h"
#include "closestream.h"
@@ -131,19 +136,56 @@ static int check_utmp(const struct write_control *ctl)
{
struct utmpx *u;
int res = 1;
-
- utmpxname(_PATH_UTMP);
- setutxent();
-
- while ((u = getutxent())) {
- if (strncmp(ctl->dst_login, u->ut_user, sizeof(u->ut_user)) == 0 &&
- strncmp(ctl->dst_tty_name, u->ut_line, sizeof(u->ut_line)) == 0) {
- res = 0;
- break;
+#if defined(USE_SYSTEMD) && HAVE_DECL_SD_SESSION_GET_USERNAME == 1
+ if (sd_booted() > 0) {
+ char **sessions_list;
+ int sessions = sd_get_sessions(&sessions_list);
+ if (sessions < 0)
+ errx(EXIT_FAILURE, _("error getting sessions: %s"),
+ strerror(-sessions));
+
+ for (int i = 0; i < sessions; i++) {
+
+ char *name, *tty;
+ int r;
+
+ if ((r = sd_session_get_username(sessions_list[i], &name)) < 0)
+ errx(EXIT_FAILURE, _("get user name failed: %s"), strerror (-r));
+ if (sd_session_get_tty(sessions_list[i], &tty) < 0) {
+ free(name);
+ continue;
+ }
+
+ if (strcmp(ctl->dst_login, name) == 0 &&
+ strcmp(ctl->dst_tty_name, tty) == 0) {
+ free(name);
+ free(tty);
+ res = 0;
+ break;
+ }
+ free(name);
+ free(tty);
+ }
+ for (int i = 0; i < sessions; i++)
+ free(sessions_list[i]);
+ free(sessions_list);
+ } else {
+#endif
+ utmpxname(_PATH_UTMP);
+ setutxent();
+
+ while ((u = getutxent())) {
+ if (strncmp(ctl->dst_login, u->ut_user, sizeof(u->ut_user)) == 0 &&
+ strncmp(ctl->dst_tty_name, u->ut_line, sizeof(u->ut_line)) == 0) {
+ res = 0;
+ break;
+ }
}
- }
- endutxent();
+ endutxent();
+#if defined(USE_SYSTEMD) && HAVE_DECL_SD_SESSION_GET_USERNAME == 1
+ }
+#endif
return res;
}
@@ -163,6 +205,69 @@ static void search_utmp(struct write_control *ctl)
struct utmpx *u;
time_t best_atime = 0, tty_atime;
int num_ttys = 0, valid_ttys = 0, tty_writeable = 0, user_is_me = 0;
+
+#if defined(USE_SYSTEMD) && HAVE_DECL_SD_SESSION_GET_USERNAME == 1
+ if (sd_booted() > 0) {
+ char path[256];
+ char **sessions_list;
+ int sessions = sd_get_sessions(&sessions_list);
+ if (sessions < 0)
+ errx(EXIT_FAILURE, _("error getting sessions: %s"),
+ strerror(-sessions));
+
+ for (int i = 0; i < sessions; i++) {
+ char *name, *tty;
+ int r;
+
+ if ((r = sd_session_get_username(sessions_list[i], &name)) < 0)
+ errx(EXIT_FAILURE, _("get user name failed: %s"), strerror (-r));
+
+ if (strcmp(ctl->dst_login, name) != 0) {
+ free(name);
+ continue;
+ }
+
+ if (sd_session_get_tty(sessions_list[i], &tty) < 0) {
+ free(name);
+ continue;
+ }
+
+ num_ttys++;
+ snprintf(path, sizeof(path), "/dev/%s", tty);
+ if (check_tty(path, &tty_writeable, &tty_atime, 0)) {
+ /* bad term? skip */
+ free(name);
+ free(tty);
+ continue;
+ }
+ if (ctl->src_uid && !tty_writeable) {
+ /* skip ttys with msgs off */
+ free(name);
+ free(tty);
+ continue;
+ }
+ if (strcmp(tty, ctl->src_tty_name) == 0) {
+ user_is_me = 1;
+ free(name);
+ free(tty);
+ /* don't write to yourself */
+ continue;
+ }
+ valid_ttys++;
+ if (best_atime < tty_atime) {
+ best_atime = tty_atime;
+ free(ctl->dst_tty_path);
+ ctl->dst_tty_path = xstrdup(path);
+ ctl->dst_tty_name = ctl->dst_tty_path + 5;
+ }
+ free(name);
+ free(tty);
+ }
+ for (int i = 0; i < sessions; i++)
+ free(sessions_list[i]);
+ free(sessions_list);
+ } else {
+#endif
char path[sizeof(u->ut_line) + 6];
utmpxname(_PATH_UTMP);
@@ -197,6 +302,9 @@ static void search_utmp(struct write_control *ctl)
}
endutxent();
+#if defined(USE_SYSTEMD) && HAVE_DECL_SD_SESSION_GET_USERNAME == 1
+ }
+#endif
if (num_ttys == 0)
errx(EXIT_FAILURE, _("%s is not logged in"), ctl->dst_login);
if (valid_ttys == 0) {

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEsMZNFDAcxu+u32Dk5LcdXuw5woQFAmVuLVMACgkQ5LcdXuw5
woTWRg/+KBoZc5EjgFEUQMGzblNyuqrvcFqCbhEcoaEEMtEKPrQGVZgwgs+SZcel
n0ygCOes7M/nNmAvn4dVM8sZRvEPKjdRFErmghNuWKfZLbE9szadNcnPunmzZ1Nc
Cd2E1R6bo0B5X3tZ4ISW3keAnWKlnRucPIrW2qZiWT36LfJT4s9vZ/dyAnJ3eAtQ
aFgUVMWRwDFYYr79iXq6Wq60bHbxw1HT+KrpoLEkjIXN+DmuSffVQfjmCpamT1UH
oGgUGDhrUFr8XRUC0q07n1CxxgirjlR+KeLDiNAXuzGTWK2naBYCtCwGJpxM5Dvd
cyKenmCC1Ie+cl9m3w7MfP7WgtoPogpttEiZ1lsLJcDEbeuAu1z+O/B52YwOi7O3
WLpe6bqW/dQsAljC6q2UMZrwnRjK7Zr5CwkTlV/o0DuCmAidcoXEZAcVQDvY1H6k
uYD9NFtQotS0ufOFH08AJxBYWVznbmiNG7NdGeMm/ysfe807fQYD25FYhP4/r4jt
k6qWnfDrt9OooFNx6e7s2cBZSkTmJzJ8nxGv0a4WgOhZ6hnLpx/Cv2RIpux5DeMq
wOuWuMDF9lOVWiv6iWiuy8shQ+hGF4+riFy8LfqJZf94wqZmp0tA8CHKFSDI99iC
ci4tz2MEpQqeVeEx1sd18DRjkXycs5Wmy7ZAUtqnR1rUxKbhVLo=
=4wcm
-----END PGP SIGNATURE-----

BIN
util-linux-2.39.3.tar.xz (Stored with Git LFS)

Binary file not shown.

16
util-linux-2.40.tar.sign Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEsMZNFDAcxu+u32Dk5LcdXuw5woQFAmYECuEACgkQ5LcdXuw5
woTCTg/9HwvHA+Gzd1rMO4UakgavnNqxzFP0rcC5HTTPHHX7rXLWVtd4u2pjStCt
EWodiy7doRRuVOAKwn93nygt/m22w23omfODdTWejCAX1ALx00LliiySkFDFWUlY
angRDG4p8nyLn03I3XBAWEvcWa7OIM4ddXlEuWSTNHTeBWSzCs0be0bbFgws2m/p
ejqo7CAHXNVx4lbtsgLQgemAkr6WhALxPEcBrXj2V/rwYF8a/uwnWK3AfGDaTeoK
DeYYsgWGkQdsPL3GDPiDttYtO9sJC8THvEOA1l0pzRyA0lI4hRbcqTXD+kvLGrZq
csk5dprZ+CvejmBtagymQoSfAEJH0b6rKBmzJYhgbKreM8byy51sQ4pmUVAB/pBz
MGAtj7PAAwcrot3CC5whMHsnB77qx0xBDlxrc+3BUKgZBiVhqe55gVGh2LnLdgCa
rAVA3QhjgZlvuH/EsVJIv0cCIBMpYTyUJLDW1Or1CLDKAl+nR2Xu9X9Hj5sXc3In
k9oU6i8/DOi1EZWJqwhf4nFZMFHgwgkHHaOXDLwlTTCFN11pOrEAnxRcsC/319Za
RlfMhX56J+GYhmFW8I5OxRrvS6PInZ4WZ/1+Qzdmas/nqBGbnctZGqv3bF/Cp/qQ
KAYTcaGqvjURmM9vcRWKjW33ZtGkD8JDrt1DvC3yQ/R/h+/Hy6I=
=7ZO0
-----END PGP SIGNATURE-----

3
util-linux-2.40.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d57a626081f9ead02fa44c63a6af162ec19c58f53e993f206ab7c3a6641c2cd7
size 8762888

View File

@ -1,276 +0,0 @@
From 8b36444f447949c3ab477f2c43b45a94c30ee7bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Sun, 21 May 2023 21:42:14 +0200
Subject: [PATCH 1/4] fadvise: (test) dynamically calculate expected test
values
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
tests/ts/fadvise/drop | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/ts/fadvise/drop b/tests/ts/fadvise/drop
index 7c7eee5dc..86c0d5b0a 100755
--- a/tests/ts/fadvise/drop
+++ b/tests/ts/fadvise/drop
@@ -16,7 +16,7 @@ ts_check_prog "sleep"
ts_cd "$TS_OUTDIR"
FILE="ddtest"
-BS=4k
+BS=4096
COUNT=8
FILE_FS="$("$TS_CMD_FINDMNT" -nr -o FSTYPE -T "$PWD")"
@@ -41,22 +41,22 @@ create_file() {
echo
create_file
- echo "offset: 8192"
- "$TS_CMD_FADVISE" -o 8192 "$FILE"
+ echo "offset: $(( 2 * $BS ))"
+ "$TS_CMD_FADVISE" -o $(( 2 * $BS )) "$FILE"
echo status: $?
"$TS_CMD_FINCORE" "$FILE"
echo
create_file
- echo "length: 16384"
- "$TS_CMD_FADVISE" -l 16384 "$FILE"
+ echo "length: $(( 4 * $BS ))"
+ "$TS_CMD_FADVISE" -l $(( 4 * $BS )) "$FILE"
echo status: $?
"$TS_CMD_FINCORE" "$FILE"
echo
create_file
- echo "offset: 8192, length: 16384 fd: 42"
- "$TS_CMD_FADVISE" -o 8192 -l 16384 --fd 42 42<"$FILE"
+ echo "offset: $(( 2 * $BS )), length: $(( 4 * $BS )) fd: 42"
+ "$TS_CMD_FADVISE" -o $(( 2 * $BS )) -l $(( 4 * $BS )) --fd 42 42<"$FILE"
echo status: $?
"$TS_CMD_FINCORE" "$FILE"
echo
--
2.40.0
From e5009e773fc801eca887dd43b721cd1b1aa327be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Sun, 21 May 2023 21:43:38 +0200
Subject: [PATCH 2/4] fadvise: (tests) factor out calls to "fincore"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This will make it easier to pass argument later.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
tests/ts/fadvise/drop | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tests/ts/fadvise/drop b/tests/ts/fadvise/drop
index 86c0d5b0a..8869b7da4 100755
--- a/tests/ts/fadvise/drop
+++ b/tests/ts/fadvise/drop
@@ -28,37 +28,41 @@ create_file() {
dd if=/dev/zero of="$FILE" bs=$BS count=$COUNT conv=fsync >& /dev/null
}
+do_fincore() {
+ "$TS_CMD_FINCORE" "$FILE"
+}
+
{
create_file
- "$TS_CMD_FINCORE" "$FILE"
+ do_fincore
echo
create_file
echo "whole file"
"$TS_CMD_FADVISE" "$FILE"
echo status: $?
- "$TS_CMD_FINCORE" "$FILE"
+ do_fincore
echo
create_file
echo "offset: $(( 2 * $BS ))"
"$TS_CMD_FADVISE" -o $(( 2 * $BS )) "$FILE"
echo status: $?
- "$TS_CMD_FINCORE" "$FILE"
+ do_fincore
echo
create_file
echo "length: $(( 4 * $BS ))"
"$TS_CMD_FADVISE" -l $(( 4 * $BS )) "$FILE"
echo status: $?
- "$TS_CMD_FINCORE" "$FILE"
+ do_fincore
echo
create_file
echo "offset: $(( 2 * $BS )), length: $(( 4 * $BS )) fd: 42"
"$TS_CMD_FADVISE" -o $(( 2 * $BS )) -l $(( 4 * $BS )) --fd 42 42<"$FILE"
echo status: $?
- "$TS_CMD_FINCORE" "$FILE"
+ do_fincore
echo
rm "$FILE"
--
2.40.0
From 33980996d0b429fc59c40f8352633c0a21a0f96a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Sun, 21 May 2023 21:44:20 +0200
Subject: [PATCH 3/4] fadvise: (test) don't compare fincore page counts
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
These depend on the machines pagesize and are therefore not a good
comparision.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
tests/expected/fadvise/drop | 20 ++++++++++----------
tests/ts/fadvise/drop | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/tests/expected/fadvise/drop b/tests/expected/fadvise/drop
index f2360b56f..25f23e050 100644
--- a/tests/expected/fadvise/drop
+++ b/tests/expected/fadvise/drop
@@ -1,23 +1,23 @@
- RES PAGES SIZE FILE
- 32K 8 32K ddtest
+ RES SIZE FILE
+ 32K 32K ddtest
whole file
status: 0
-RES PAGES SIZE FILE
- 0B 0 32K ddtest
+RES SIZE FILE
+ 0B 32K ddtest
offset: 8192
status: 0
-RES PAGES SIZE FILE
- 8K 2 32K ddtest
+RES SIZE FILE
+ 8K 32K ddtest
length: 16384
status: 0
- RES PAGES SIZE FILE
- 16K 4 32K ddtest
+ RES SIZE FILE
+ 16K 32K ddtest
offset: 8192, length: 16384 fd: 42
status: 0
- RES PAGES SIZE FILE
- 16K 4 32K ddtest
+ RES SIZE FILE
+ 16K 32K ddtest
diff --git a/tests/ts/fadvise/drop b/tests/ts/fadvise/drop
index 8869b7da4..6c4298e87 100755
--- a/tests/ts/fadvise/drop
+++ b/tests/ts/fadvise/drop
@@ -29,7 +29,7 @@ create_file() {
}
do_fincore() {
- "$TS_CMD_FINCORE" "$FILE"
+ "$TS_CMD_FINCORE" -o RES,SIZE,FILE "$FILE"
}
{
--
2.40.0
From c0f31b79f5d1c665cdc057fb32f4d161d28aa5b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Sun, 21 May 2023 21:45:10 +0200
Subject: [PATCH 4/4] fadvise: (test) test with 64k blocks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This will allow the tests to also pass on systems with 64k pagesizes.
Closes #2249
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
tests/expected/fadvise/drop | 26 +++++++++++++-------------
tests/ts/fadvise/drop | 2 +-
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/tests/expected/fadvise/drop b/tests/expected/fadvise/drop
index 25f23e050..e7bb26b6e 100644
--- a/tests/expected/fadvise/drop
+++ b/tests/expected/fadvise/drop
@@ -1,23 +1,23 @@
- RES SIZE FILE
- 32K 32K ddtest
+ RES SIZE FILE
+ 512K 512K ddtest
whole file
status: 0
-RES SIZE FILE
- 0B 32K ddtest
+RES SIZE FILE
+ 0B 512K ddtest
-offset: 8192
+offset: 131072
status: 0
-RES SIZE FILE
- 8K 32K ddtest
+ RES SIZE FILE
+ 128K 512K ddtest
-length: 16384
+length: 262144
status: 0
- RES SIZE FILE
- 16K 32K ddtest
+ RES SIZE FILE
+ 256K 512K ddtest
-offset: 8192, length: 16384 fd: 42
+offset: 131072, length: 262144 fd: 42
status: 0
- RES SIZE FILE
- 16K 32K ddtest
+ RES SIZE FILE
+ 256K 512K ddtest
diff --git a/tests/ts/fadvise/drop b/tests/ts/fadvise/drop
index 6c4298e87..45dcb9110 100755
--- a/tests/ts/fadvise/drop
+++ b/tests/ts/fadvise/drop
@@ -16,7 +16,7 @@ ts_check_prog "sleep"
ts_cd "$TS_OUTDIR"
FILE="ddtest"
-BS=4096
+BS=65536
COUNT=8
FILE_FS="$("$TS_CMD_FINDMNT" -nr -o FSTYPE -T "$PWD")"
--
2.40.0

View File

@ -1,3 +1,57 @@
-------------------------------------------------------------------
Thu Apr 4 12:27:18 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
- Update to release 2.40
* Add lastlog2
* agetty: Load autologin user from agetty.autologin credential
* agetty: use get_terminal_default_type()
* agetty: use sd_get_sessions() for number of users (#2088)
* blockdev: add support for BLKGETZONESZ
* cfdisk: ask y/n before wipe
* cfdisk: properly handle out-of-order partitions during resize
* chcpu: document limitations of -g
* chsh: use libeconf to read /etc/shells
* column: fix -l
* column: fix memory leak
* dmesg: fix FD leak
* dmesg: fix delta calculation
* dmesg: fix wrong size calculation
* dmesg: support reading kmsg format from file
* enosys: a new small command to make syscalls fail with ENOSYS
* exch: new command to atomically exchanges paths between two files
* fdisk: add support for partition resizing
* fdisk: remove usage of VLA
* fincore: add --output-all
* findmnt: add --list-columns
* findmnt: add -I, --dfi options for imitating the output of df -i
* findmnt: add inode-related columns for implementing "df -i" like output
* hexdump: add '--one-byte-hex' format option
* hwclock: add support for RTC_VL_READ/RTC_VL_CLR ioctls
* login: initialize noauth from login.noauth credential
* lsblk: add --filter
* lsblk: add --highlight
* lsblk: add --list-columns
* lsclocks: new command to show clocks
* lscpu: even more Arm part numbers
* mkfs.minix: handle 64bit time on 32bit system
* mkswap: implement --file
* mkswap: implement --offset
* mount: add --map-users and --map-groups convenience options
* nsenter: add option `-c` to join the cgroup of target process
* setarch: add riscv64/riscv32 support
* setpgid: new command to run a program in a new process group
* uuidd: add cont_clock persistence
* uuidgen: add option --count
* wall: query logind for list of users with tty (#2088)
* write: query logind for list of users with tty (#2088)
* libuuid: improved support for 64-bit time
- skip-lsfd-tests-PR2888.patch: skip some lsfd tests which OBS does
not support (https://github.com/util-linux/util-linux/issues/2822)
- use-logind-not-utmp.patch: removed, accepted upstream
- tests-increase-delay-for-waitpid-test.patch: removed, upstreamed
- 0001-Revert-libblkid-try-LUKS2-first-when-probing.patch: reverted upstream
- util-linux-fix-tests-with-64k-pagesize.patch: was a backport
-------------------------------------------------------------------
Fri Feb 9 17:56:16 UTC 2024 - Stanislav Brabec <sbrabec@suse.com>

View File

@ -20,7 +20,7 @@
# Parts description:
# core: libraries, all binaries except those dependent on libsystemd
# systemd: binaries dependent on systemd, man pages (generator is dependent on ruby)
# systemd: binaries dependent on systemd or sqlite3, man pages (generator is dependent on ruby)
# python: Python bindings
%if "%{flavor}" == ""
@ -85,11 +85,11 @@ Group: Development/Languages/Python
%endif
# ulbuild == python
Version: 2.39.3
Version: 2.40
Release: 0
License: GPL-2.0-or-later
URL: https://www.kernel.org/pub/linux/utils/util-linux/
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-%{version}.tar.xz
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.40/util-linux-%{version}.tar.xz
Source2: util-linux-login_defs-check.sh
Source3: util-linux-rpmlintrc
Source7: baselibs.conf
@ -107,10 +107,7 @@ Patch0: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff
Patch1: libmount-print-a-blacklist-hint-for-unknown-filesyst.patch
Patch2: Add-documentation-on-blacklisted-modules-to-mount-8-.patch
Patch3: util-linux-bash-completion-su-chsh-l.patch
Patch4: 0001-Revert-libblkid-try-LUKS2-first-when-probing.patch
Patch5: util-linux-fix-tests-with-64k-pagesize.patch
Patch6: use-logind-not-utmp.patch
Patch7: tests-increase-delay-for-waitpid-test.patch
Patch4: skip-lsfd-tests-PR2888.patch
BuildRequires: audit-devel
BuildRequires: bc
@ -132,7 +129,7 @@ BuildRequires: utempter-devel
%endif
BuildRequires: zlib-devel
Requires(post): permissions
Requires(verify):permissions
Requires(verify): permissions
# util-linux is part of VMInstall, but we can well build without it
# Helps shorten a cycle and eliminate a bootstrap issue
#!BuildIgnore: util-linux
@ -148,12 +145,16 @@ BuildRequires: libudev-devel
BuildRequires: socat
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: rubygem(asciidoctor)
Supplements: (util-linux and systemd)
# Split-provides for upgrade from SLE < 12 and openSUSE <= 13.1
Provides: util-linux:/bin/logger
# man pages were moved to -systemd subpackage with 2.38.x (SLE15 SP6, Leap 15.6)
Conflicts: util-linux < 2.38
# lastlog2 got merged into util-linux 2.40
Provides: lastlog2 = %{version}-%{release}
Obsoletes: lastlog2 <= 1.3.1
%systemd_requires
%endif
# ulsubset == systemd
@ -368,6 +369,27 @@ unique IDs (UUIDs).
%endif
# ulsubset == core
%if "%ulsubset" == "systemd"
%package -n liblastlog2-2
Summary: Library to report most recent login of users
License: BSD-2-Clause
Group: System/Libraries
%description -n liblastlog2-2
The liblastlog2 library provides various interfaces to read, write or modify the lastlog 2 database.
%package -n liblastlog2-devel
Summary: Development files for the lastlog2 library
License: BSD-2-Clause
Group: Development/Libraries/C and C++
Requires: liblastlog2-2 = %{version}
%description -n liblastlog2-devel
Files to develop applications using the liblastlog2 library.
%endif
# ulsubset == systemd
####################
# Systemd packages #
####################
@ -377,7 +399,7 @@ Summary: Tools for writing to TTYs
License: BSD-3-Clause
Requires(pre): group(tty)
Requires(post): permissions
Requires(verify):permissions
Requires(verify): permissions
Provides: util-linux:%{_bindir}/mesg
Provides: util-linux:%{_bindir}/wall
Provides: util-linux:%{_bindir}/write
@ -450,7 +472,7 @@ configure_options+="--without-python "
# ulbuild == base
%if "%ulsubset" == "core"
configure_options+="--without-systemd "
configure_options+="--without-systemd --disable-liblastlog2"
%endif
# ulsubset == core
@ -651,6 +673,12 @@ ln -sf /sbin/service %{buildroot}%{_sbindir}/rcfstrim
%endif
# ulsubset == core, ulbuild == base
%if "%ulsubset" == "systemd"
# No *.la packages
rm -r %{buildroot}%{_pam_moduledir}/*.la
%endif
# ulsubset == systemd
%endif
# ulbuild == base
@ -853,6 +881,10 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%post -n util-linux-tty-tools
%set_permissions %{_bindir}/wall %{_bindir}/write
%post -n liblastlog2-2 -p /sbin/ldconfig
%postun -n liblastlog2-2 -p /sbin/ldconfig
%endif
%dnl # ulsubset == systemd, pre & post
%dnl
@ -947,6 +979,8 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%core %{_bindir}/colrm
%core %{_bindir}/column
%core %{_bindir}/dmesg
%core %{_bindir}/enosys
%core %{_bindir}/exch
%core %{_bindir}/fadvise
%core %{_bindir}/fallocate
%core %{_bindir}/fincore
@ -980,6 +1014,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%endif
# ul_extra_bin_sbin
%core %{_bindir}/lsclocks
%core %{_bindir}/lscpu
%core %{_bindir}/lsfd
%core %{_bindir}/lsipc
@ -1001,6 +1036,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%core %{_bindir}/scriptlive
%core %{_bindir}/scriptreplay
%core %{_bindir}/setarch
%core %{_bindir}/setpgid
%core %{_bindir}/setpriv
%core %{_bindir}/setsid
%core %{_bindir}/taskset
@ -1155,7 +1191,9 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%core %{_mandir}/man1/colrm.1.gz
%core %{_mandir}/man1/column.1.gz
%core %{_mandir}/man1/dmesg.1.gz
%core %{_mandir}/man1/enosys.1.gz
%core %{_mandir}/man1/eject.1.gz
%core %{_mandir}/man1/exch.1.gz
%core %{_mandir}/man1/fadvise.1.gz
%core %{_mandir}/man1/fallocate.1.gz
%core %{_mandir}/man1/fincore.1.gz
@ -1179,6 +1217,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%core %{_mandir}/man1/login.1.gz
%core %{_mandir}/man1/look.1.gz
%core %{_mandir}/man1/lscpu.1.gz
%core %{_mandir}/man1/lsclocks.1.gz
%core %{_mandir}/man1/lsfd.1.gz
%core %{_mandir}/man1/lsipc.1.gz
%core %{_mandir}/man1/lsirq.1.gz
@ -1199,6 +1238,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%core %{_mandir}/man1/script.1.gz
%core %{_mandir}/man1/scriptlive.1.gz
%core %{_mandir}/man1/scriptreplay.1.gz
%core %{_mandir}/man1/setpgid.1.gz
%core %{_mandir}/man1/setterm.1.gz
%core %{_mandir}/man1/taskset.1.gz
%core %{_mandir}/man1/ul.1.gz
@ -1214,6 +1254,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%core %{_mandir}/man1/waitpid.1.gz
%core %{_mandir}/man5/adjtime_config.5.gz
%core %{_mandir}/man5/fstab.5.gz
%core %{_mandir}/man5/scols-filter.5.gz
%core %{_mandir}/man5/terminal-colors.d.5.gz
%core %{_mandir}/man8/addpart.8.gz
%core %{_mandir}/man8/agetty.8.gz
@ -1314,14 +1355,19 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
# ul_extra_bin_sbin
%{_bindir}/findmnt
%{_bindir}/lastlog2
%{_bindir}/logger
%{_bindir}/lsblk
%{_bindir}/lslogins
%{_pam_moduledir}/pam_lastlog2.so
%{_mandir}/man8/findmnt.8.gz
%{_mandir}/man8/lastlog2.8.gz
%{_mandir}/man1/logger.1.gz
%{_mandir}/man8/lsblk.8.gz
%{_mandir}/man1/lslogins.1.gz
%{_mandir}/man8/pam_lastlog2.8.gz
%{_unitdir}/lastlog2-import.service
# Exclude core binaries bash-completion
%exclude %{_datadir}/bash-completion/completions/addpart
@ -1342,6 +1388,8 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%exclude %{_datadir}/bash-completion/completions/delpart
%exclude %{_datadir}/bash-completion/completions/dmesg
%exclude %{_datadir}/bash-completion/completions/eject
%exclude %{_datadir}/bash-completion/completions/enosys
%exclude %{_datadir}/bash-completion/completions/exch
%exclude %{_datadir}/bash-completion/completions/fallocate
%exclude %{_datadir}/bash-completion/completions/fadvise
%exclude %{_datadir}/bash-completion/completions/fdformat
@ -1369,6 +1417,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%exclude %{_datadir}/bash-completion/completions/ldattach
%exclude %{_datadir}/bash-completion/completions/look
%exclude %{_datadir}/bash-completion/completions/losetup
%exclude %{_datadir}/bash-completion/completions/lsclocks
%exclude %{_datadir}/bash-completion/completions/lscpu
%exclude %{_datadir}/bash-completion/completions/lsipc
%exclude %{_datadir}/bash-completion/completions/lsirq
@ -1402,6 +1451,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%exclude %{_datadir}/bash-completion/completions/scriptlive
%exclude %{_datadir}/bash-completion/completions/scriptreplay
%exclude %{_datadir}/bash-completion/completions/setarch
%exclude %{_datadir}/bash-completion/completions/setpgid
%exclude %{_datadir}/bash-completion/completions/setpriv
%exclude %{_datadir}/bash-completion/completions/setsid
%exclude %{_datadir}/bash-completion/completions/setterm
@ -1426,6 +1476,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%exclude %{_datadir}/bash-completion/completions/zramctl
%{_datadir}/bash-completion/completions/findmnt
%{_datadir}/bash-completion/completions/lastlog2
%{_datadir}/bash-completion/completions/logger
%{_datadir}/bash-completion/completions/lsblk
%{_datadir}/bash-completion/completions/lslogins
@ -1602,6 +1653,15 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_datadir}/bash-completion/completions/write
%{_datadir}/bash-completion/completions/mesg
%files -n liblastlog2-2
%{_libdir}/liblastlog2.so.2
%{_libdir}/liblastlog2.so.2.*
%files -n liblastlog2-devel
%{_libdir}/liblastlog2.so
%{_mandir}/man3/lastlog2.3.gz
%{_mandir}/man3/ll2_*
%endif
# ulsubset == systemd