Dominique Leuenberger 2021-02-02 13:24:25 +00:00 committed by Git OBS Bridge
commit b3fbff74ff
17 changed files with 817 additions and 744 deletions

View File

@ -8,12 +8,12 @@ Signed-off-by: Martin Wilck <mwilck@suse.com>
sys-utils/mount.8 | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index da0ac5b..c231e12 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -338,6 +338,32 @@ The
option is similar, with the restriction that the user must be
Index: util-linux-2.36/sys-utils/mount.8
===================================================================
--- util-linux-2.36.orig/sys-utils/mount.8
+++ util-linux-2.36/sys-utils/mount.8
@@ -400,6 +400,32 @@ The
option is similar, with the restriction that the user must be a
member of the group of the special file.
+.SS Blacklisted file systems
@ -45,6 +45,3 @@ index da0ac5b..c231e12 100644
.SS Bind mount operation
Remount part of the file hierarchy somewhere else. The call is:
--
2.19.2

View File

@ -1,12 +1,20 @@
libuuid1
libuuid-devel
requires -libuuid-<targettype>
requires "libuuid1-<targettype> = <version>"
libblkid1
libblkid-devel
requires -libblkid-<targettype>
requires "libblkid1-<targettype> = <version>"
libfdisk1
libfdisk-devel
requires -libfdisk-<targettype>
requires "libfdisk1-<targettype> = <version>"
libmount1
libmount-devel
requires -libmount-<targettype>
requires "libmount1-<targettype> = <version>"
libsmartcols1
libsmartcols-devel
requires -libsmartcols-<targettype>
requires "libsmartcols1-<targettype> = <version>"
libuuid1
libuuid-devel
requires -libuuid-<targettype>
requires "libuuid1-<targettype> = <version>"

View File

@ -1,438 +0,0 @@
From 9e584ff32428b9832470d19a54bba4838f3a6c34 Mon Sep 17 00:00:00 2001
From: Thorsten Kukuk <kukuk@suse.com>
Date: Tue, 3 Sep 2019 15:04:43 +0200
Subject: [PATCH 1/2] Add support for libeconf
---
configure.ac | 27 ++++++
login-utils/Makemodule.am | 36 +++++++
login-utils/logindefs.c | 195 +++++++++++++++++++++++++++++++++++---
login-utils/su-common.c | 7 ++
4 files changed, 254 insertions(+), 11 deletions(-)
Index: util-linux-2.35.1/configure.ac
===================================================================
--- util-linux-2.35.1.orig/configure.ac
+++ util-linux-2.35.1/configure.ac
@@ -2274,6 +2274,31 @@ AS_IF([test "x$with_smack" = xyes], [
AC_DEFINE([HAVE_SMACK], [1], [Add SMACK support])
])
+AC_ARG_WITH([econf],
+ AS_HELP_STRING([--without-econf], [do not use libeconf]),
+ [], [with_econf=check]
+)
+
+have_econf=no
+AS_IF([test "x$with_econf" != xno], [
+ # new version -- all libsystemd-* libs merged into libsystemd
+ PKG_CHECK_MODULES([ECONF], [libeconf], [have_econf=yes], [have_econf=no])
+ AS_CASE([$with_econf:$have_econf],
+ [yes:no],
+ [AC_MSG_ERROR([libeconf expected but libeconf not found])],
+ [*:yes],
+ AC_DEFINE([HAVE_LIBECONF], [1], [Define if libeconf is available])
+ )
+])
+AM_CONDITIONAL([HAVE_ECONF], [test "x$have_econf" = xyes])
+
+AC_ARG_ENABLE([vendordir],
+ AS_HELP_STRING([--enable-vendordir=DIR], [Direcotry for istribution provided configuration files]),,
+ []
+)
+AC_SUBST([vendordir], [$enable_vendordir])
+AM_CONDITIONAL([HAVE_VENDORDIR], [test "x$enable_vendordir" != x])
+
AC_ARG_WITH([bashcompletiondir],
AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
@@ -2527,6 +2552,7 @@ AC_MSG_RESULT([
usrbin_execdir: ${usrbin_execdir}
usrsbin_execdir: ${usrsbin_execdir}
usrlib_execdir: ${usrlib_execdir}
+ vendordir: ${enable_vendordir}
compiler: ${CC}
cflags: ${CFLAGS}
@@ -2542,6 +2568,7 @@ AC_MSG_RESULT([
Bash completions: ${with_bashcompletiondir}
Systemd support: ${have_systemd}
Systemd unitdir: ${with_systemdsystemunitdir}
+ libeconf support: ${have_econf}
Btrfs support: ${have_btrfs}
Wide-char support: ${build_widechar}
Index: util-linux-2.35.1/login-utils/Makemodule.am
===================================================================
--- util-linux-2.35.1.orig/login-utils/Makemodule.am
+++ util-linux-2.35.1/login-utils/Makemodule.am
@@ -44,6 +44,9 @@ login_SOURCES = \
login-utils/logindefs.c \
login-utils/logindefs.h
login_LDADD = $(LDADD) libcommon.la -lpam
+if HAVE_VENDORDIR
+login_CFLAGS = $(AM_CFLAGS) -DHAVE_VENDORDIR -DVENDORDIR=\"@vendordir@\"
+endif
if HAVE_LINUXPAM
login_LDADD += -lpam_misc
endif
@@ -53,6 +56,9 @@ endif
if HAVE_SELINUX
login_LDADD += -lselinux
endif
+if HAVE_ECONF
+login_LDADD += -leconf
+endif
endif # BUILD_LOGIN
@@ -121,8 +127,14 @@ chfn_SOURCES = \
login-utils/logindefs.h \
$(chfn_chsh_sources)
chfn_CFLAGS = $(chfn_chsh_cflags)
+if HAVE_VENDORDIR
+chfn_CFLAGS += -DHAVE_VENDORDIR -DVENDORDIR=\"@vendordir@\"
+endif
chfn_LDFLAGS = $(chfn_chsh_ldflags)
chfn_LDADD = $(LDADD) $(chfn_chsh_ldadd)
+if HAVE_ECONF
+chfn_LDADD += -leconf
+endif
chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources)
chsh_CFLAGS = $(chfn_chsh_cflags)
@@ -141,6 +153,9 @@ su_SOURCES = \
login-utils/logindefs.c \
login-utils/logindefs.h
su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+if HAVE_VENDORDIR
+su_CFLAGS += -DHAVE_VENDORDIR -DVENDORDIR=\"@vendordir@\"
+endif
su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
su_LDADD = $(LDADD) libcommon.la -lpam
if HAVE_LINUXPAM
@@ -152,6 +167,9 @@ su_SOURCES += lib/pty-session.c \
lib/monotonic.c
su_LDADD += -lutil $(REALTIME_LIBS)
endif
+if HAVE_ECONF
+su_LDADD += -leconf
+endif
endif # BUILD_SU
@@ -174,6 +192,12 @@ runuser_SOURCES += lib/pty-session.c \
lib/monotonic.c
runuser_LDADD += -lutil $(REALTIME_LIBS)
endif
+if HAVE_ECONF
+runuser_LDADD += -leconf
+endif
+if HAVE_VENDORDIR
+runuser_CFLAGS = $(AM_CFLAGS) -DHAVE_VENDORDIR -DVENDORDIR=\"@vendordir@\"
+endif
endif # BUILD_RUNUSER
@@ -198,6 +222,9 @@ lslogins_SOURCES = \
login-utils/logindefs.h
lslogins_LDADD = $(LDADD) libcommon.la libsmartcols.la
lslogins_CFLAGS = $(AM_CFLAGS) -I$(ul_libsmartcols_incdir)
+if HAVE_VENDORDIR
+lslogins_CFLAGS += -DHAVE_VENDORDIR -DVENDORDIR=\"@vendordir@\"
+endif
if HAVE_SELINUX
lslogins_LDADD += -lselinux
endif
@@ -205,6 +232,9 @@ if HAVE_SYSTEMD
lslogins_LDADD += $(SYSTEMD_LIBS) $(SYSTEMD_JOURNAL_LIBS)
lslogins_CFLAGS += $(SYSTEMD_CFLAGS) $(SYSTEMD_JOURNAL_CFLAGS)
endif
+if HAVE_ECONF
+lslogins_LDADD += -leconf
+endif
endif # BUILD_LSLOGINS
if BUILD_VIPW
@@ -237,6 +267,12 @@ test_logindefs_SOURCES = \
login-utils/logindefs.c \
login-utils/logindefs.h
test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
+if HAVE_VENDORDIR
+test_logindefs_CPPFLAGS += -DHAVE_VENDORDIR -DVENDORDIR=\"@vendordir@\"
+endif
+if HAVE_ECONF
+test_logindefs_LDADD = -leconf
+endif
install-exec-hook:
Index: util-linux-2.35.1/login-utils/logindefs.c
===================================================================
--- util-linux-2.35.1.orig/login-utils/logindefs.c
+++ util-linux-2.35.1/login-utils/logindefs.c
@@ -38,6 +38,18 @@
#include "pathnames.h"
#include "xalloc.h"
+
+static void (*logindefs_loader)(void *) = NULL;
+static void *logindefs_loader_data = NULL;
+
+void logindefs_set_loader(void (*loader)(void *data), void *data)
+{
+ logindefs_loader = loader;
+ logindefs_loader_data = data;
+}
+
+#ifndef HAVE_LIBECONF
+
struct item {
char *name; /* name of the option. */
char *value; /* value of the option. */
@@ -48,9 +60,6 @@ struct item {
static struct item *list = NULL;
-static void (*logindefs_loader)(void *) = NULL;
-static void *logindefs_loader_data = NULL;
-
void free_getlogindefs_data(void)
{
struct item *ptr;
@@ -145,12 +154,6 @@ void logindefs_load_file(const char *fil
fclose(f);
}
-void logindefs_set_loader(void (*loader)(void *data), void *data)
-{
- logindefs_loader = loader;
- logindefs_loader_data = data;
-}
-
static void load_defaults(void)
{
if (logindefs_loader)
@@ -232,6 +235,156 @@ const char *getlogindefs_str(const char
return ptr->value;
}
+#else
+
+#include <libeconf.h>
+
+static econf_file *file = NULL;
+
+void free_getlogindefs_data(void)
+{
+ econf_free (file);
+ file = NULL;
+}
+
+#ifndef VENDORDIR
+#define VENDORDIR NULL
+#endif
+
+static void load_defaults(void)
+{
+ econf_err error;
+
+ if (file != NULL)
+ free_getlogindefs_data();
+
+ if ((error = econf_readDirs(&file, VENDORDIR, "/etc",
+ "login", "defs", "= \t", "#")))
+ syslog(LOG_NOTICE, _("Error reading login.defs: %s"),
+ econf_errString(error));
+
+ if (logindefs_loader)
+ logindefs_loader(logindefs_loader_data);
+
+}
+
+void logindefs_load_file(const char *filename)
+{
+ econf_file *file_l = NULL, *file_m = NULL;
+ char *path;
+
+ logindefs_loader = NULL; /* No recursion */
+
+#if HAVE_VENDORDIR
+ if (asprintf (&path, VENDORDIR"/%s", filename) == -1)
+ return;
+ if (!econf_readFile(&file_l, path, "= \t", "#")) {
+ if (file == NULL)
+ file = file_l;
+ else if (!econf_mergeFiles(&file_m, file, file_l)) {
+ econf_free(file);
+ file = file_m;
+ econf_free(file_l);
+ }
+ }
+ free (path);
+#endif
+
+ if (asprintf (&path, "/etc/%s", filename) == -1)
+ return;
+ if (!econf_readFile(&file_l, path, "= \t", "#")) {
+ if (file == NULL)
+ file = file_l;
+ else if (!econf_mergeFiles(&file_m, file, file_l)) {
+ econf_free(file);
+ file = file_m;
+ econf_free(file_l);
+ }
+ } else {
+ /* Try original filename, could be relative */
+ if (!econf_readFile(&file_l, filename, "= \t", "#")) {
+ if (file == NULL)
+ file = file_l;
+ else if (!econf_mergeFiles(&file_m, file, file_l)) {
+ econf_free(file);
+ file = file_m;
+ econf_free(file_l);
+ }
+ }
+ }
+ free (path);
+}
+
+int getlogindefs_bool(const char *name, int dflt)
+{
+ bool value;
+ econf_err error;
+
+ if (!file)
+ load_defaults();
+
+ if (!file)
+ return dflt;
+
+ if ((error = econf_getBoolValue(file, NULL, name, &value))) {
+ if (error != ECONF_NOKEY)
+ syslog(LOG_NOTICE, _("couldn't fetch %s: %s"), name,
+ econf_errString(error));
+ return dflt;
+ }
+ return value;
+}
+
+unsigned long getlogindefs_num(const char *name, unsigned long dflt)
+{
+ uint64_t value;
+ econf_err error;
+
+ if (!file)
+ load_defaults();
+
+ if (!file)
+ return dflt;
+
+ if ((error = econf_getUInt64Value(file, NULL, name, &value))) {
+ if (error != ECONF_NOKEY)
+ syslog(LOG_NOTICE, _("couldn't fetch %s: %s"), name,
+ econf_errString(error));
+ return dflt;
+ }
+ return value;
+}
+
+/*
+ * Returns:
+ * @dflt if @name not found
+ * "" (empty string) if found, but value not defined
+ * "string" if found
+ */
+const char *getlogindefs_str(const char *name, const char *dflt)
+{
+ char *value;
+ econf_err error;
+
+ if (!file)
+ load_defaults();
+
+ if (!file)
+ return dflt;
+
+ if ((error = econf_getStringValue(file, NULL, name, &value))) {
+ if (error != ECONF_NOKEY)
+ syslog(LOG_NOTICE, _("couldn't fetch %s: %s"), name,
+ econf_errString(error));
+ return dflt;
+ }
+ if (value)
+ return value;
+ else
+ return strdup("");
+}
+#endif /* !HAVE_LIBECONF */
+
/*
* For compatibility with shadow-utils we have to support additional
* syntax for environment variables in login.defs(5) file. The standard
@@ -283,7 +436,6 @@ int effective_access(const char *path, i
return fd == -1 ? -1 : 0;
}
-
/*
* Check the per-account or the global hush-login setting.
*
@@ -412,12 +564,28 @@ int main(int argc, char *argv[])
logindefs_load_file(argv[1]);
if (argc != 4) { /* list all */
+#ifdef HAVE_LIBECONF
+ int i;
+ char *keys[] = {"END", "EMPTY", "CRAZY3", "CRAZY2", "CRAZY1",
+ "BOOLEAN", "NUMBER", "STRING", "HELLO_WORLD",
+ NULL};
+
+ for (i = 0; keys[i] != NULL; i++) {
+ char *value = NULL;
+
+ econf_getStringValue(file, NULL, keys[i], &value);
+ printf ("%s: $%s: '%s'\n", argv[1], keys[i], value);
+ }
+
+ econf_free (file);
+
+#else
struct item *ptr;
for (ptr = list; ptr; ptr = ptr->next)
printf("%s: $%s: '%s'\n", ptr->path, ptr->name,
ptr->value);
-
+#endif
return EXIT_SUCCESS;
}
Index: util-linux-2.35.1/login-utils/su-common.c
===================================================================
--- util-linux-2.35.1.orig/login-utils/su-common.c
+++ util-linux-2.35.1/login-utils/su-common.c
@@ -90,8 +90,13 @@ UL_DEBUG_DEFINE_MASKNAMES(su) = UL_DEBUG
#define PAM_SRVNAME_RUNUSER "runuser"
#define PAM_SRVNAME_RUNUSER_L "runuser-l"
+#ifdef HAVE_LIBECONF
+#define _PATH_LOGINDEFS_SU "default/su"
+#define _PATH_LOGINDEFS_RUNUSER "default/runuser"
+#else
#define _PATH_LOGINDEFS_SU "/etc/default/su"
#define _PATH_LOGINDEFS_RUNUSER "/etc/default/runuser"
+#endif
#define is_pam_failure(_rc) ((_rc) != PAM_SUCCESS)
@@ -1038,7 +1043,9 @@ static void load_config(void *data)
struct su_context *su = (struct su_context *) data;
DBG(MISC, ul_debug("loading logindefs"));
+#ifndef HAVE_LIBECONF
logindefs_load_file(_PATH_LOGINDEFS);
+#endif
logindefs_load_file(su->runuser ? _PATH_LOGINDEFS_RUNUSER : _PATH_LOGINDEFS_SU);
}

View File

@ -1,131 +0,0 @@
From d8c68b52cc939a16f04ec976648a37f5f5de718c Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 4 Feb 2020 15:11:19 +0100
Subject: [PATCH] libfdisk: (script) accept sector-size, ignore unknown headers
- add sector-size between supported headers (already in --dump output)
- report unknown headers by -ENOTSUP
- ignore ENOTSUP in sfdisk (but print warning) and in fdisk_script_read_file()
Addresses: https://github.com/karelzak/util-linux/issues/949
Signed-off-by: Karel Zak <kzak@redhat.com>
---
disk-utils/sfdisk.c | 6 +++++-
libfdisk/src/script.c | 49 +++++++++++++++++++++++--------------------
2 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 0db797b2d..e08862aa8 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -1823,7 +1823,11 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv)
}
rc = fdisk_script_read_line(dp, stdin, buf, sizeof(buf));
- if (rc < 0) {
+ if (rc == -ENOTSUP) {
+ buf[sizeof(buf) - 1] = '\0';
+ fdisk_warnx(sf->cxt, _("Unknown script header '%s' -- ignore."), buf);
+ continue;
+ } else if (rc < 0) {
DBG(PARSE, ul_debug("script parsing failed, trying sfdisk specific commands"));
buf[sizeof(buf) - 1] = '\0';
rc = loop_control_commands(sf, dp, buf);
diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c
index a21771b6a..d3e67fa9c 100644
--- a/libfdisk/src/script.c
+++ b/libfdisk/src/script.c
@@ -805,8 +805,12 @@ static inline int is_header_line(const char *s)
/* parses "<name>: value", note modifies @s*/
static int parse_line_header(struct fdisk_script *dp, char *s)
{
- int rc = -EINVAL;
+ size_t i;
char *name, *value;
+ static const char *supported[] = {
+ "label", "unit", "label-id", "device", "grain",
+ "first-lba", "last-lba", "table-length", "sector-size"
+ };
DBG(SCRIPT, ul_debugobj(dp, " parse header '%s'", s));
@@ -816,7 +820,7 @@ static int parse_line_header(struct fdisk_script *dp, char *s)
name = s;
value = strchr(s, ':');
if (!value)
- goto done;
+ return -EINVAL;
*value = '\0';
value++;
@@ -825,32 +829,30 @@ static int parse_line_header(struct fdisk_script *dp, char *s)
ltrim_whitespace((unsigned char *) value);
rtrim_whitespace((unsigned char *) value);
+ if (!*name || !*value)
+ return -EINVAL;
+
+ /* check header name */
+ for (i = 0; i < ARRAY_SIZE(supported); i++) {
+ if (strcmp(name, supported[i]) == 0)
+ break;
+ }
+ if (i == ARRAY_SIZE(supported))
+ return -ENOTSUP;
+
+ /* header specific actions */
if (strcmp(name, "label") == 0) {
if (dp->cxt && !fdisk_get_label(dp->cxt, value))
- goto done; /* unknown label name */
+ return -EINVAL; /* unknown label name */
dp->force_label = 1;
+
} else if (strcmp(name, "unit") == 0) {
if (strcmp(value, "sectors") != 0)
- goto done; /* only "sectors" supported */
- } else if (strcmp(name, "label-id") == 0
- || strcmp(name, "device") == 0
- || strcmp(name, "grain") == 0
- || strcmp(name, "first-lba") == 0
- || strcmp(name, "last-lba") == 0
- || strcmp(name, "table-length") == 0) {
- ; /* whatever is possible */
- } else
- goto done; /* unknown header */
+ return -EINVAL; /* only "sectors" supported */
- if (*name && *value)
- rc = fdisk_script_set_header(dp, name, value);
-done:
- if (rc)
- DBG(SCRIPT, ul_debugobj(dp, "header parse error: "
- "[rc=%d, name='%s', value='%s']",
- rc, name, value));
- return rc;
+ }
+ return fdisk_script_set_header(dp, name, value);
}
/* returns zero terminated string with next token and @str is updated */
@@ -1363,7 +1365,8 @@ int fdisk_script_set_fgets(struct fdisk_script *dp,
*
* Reads next line into dump.
*
- * Returns: 0 on success, <0 on error, 1 when nothing to read.
+ * Returns: 0 on success, <0 on error, 1 when nothing to read. For unknown headers
+ * returns -ENOTSUP, it's usually safe to ignore this error.
*/
int fdisk_script_read_line(struct fdisk_script *dp, FILE *f, char *buf, size_t bufsz)
{
@@ -1428,7 +1431,7 @@ int fdisk_script_read_file(struct fdisk_script *dp, FILE *f)
while (!feof(f)) {
rc = fdisk_script_read_line(dp, f, buf, sizeof(buf));
- if (rc)
+ if (rc && rc != -ENOTSUP)
break;
}

View File

@ -1,42 +0,0 @@
From 7065cc0e5312cafc5ae3e4c342f78f264300fb5f Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.de>
Date: Wed, 1 Apr 2020 13:15:13 +0200
Subject: [PATCH 1/4] libmount: Avoid triggering autofs in
lookup_umount_fs_by_statfs
References: boo#1168389
Upstream: merged (gh#karelzak/util-linux#1002)
Currently, umount /foo results in a statfs("/foo") call, which triggers
autofs. This can create another mountpoint on /foo, which is then unmounted
later instead of the actual /foo at the time umount was called.
This is especially an issue for umount -R /bar, which just fails with
-EBUSY as the accidental mountpoint is never accounted for and so it tries
to umount /bar before /bar/someautofs.
Replace the direct statfs call with open(path, O_PATH) + fstatfs, which sees
the autofs mount directly, without triggering it.
---
libmount/src/context_umount.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Index: util-linux-2.34/libmount/src/context_umount.c
===================================================================
--- util-linux-2.34.orig/libmount/src/context_umount.c
+++ util-linux-2.34/libmount/src/context_umount.c
@@ -283,9 +283,13 @@ static int lookup_umount_fs(struct libmn
if (!type) {
struct statfs vfs;
- DBG(CXT, ul_debugobj(cxt, "umount: trying statfs()"));
- if (statfs(tgt, &vfs) == 0)
+ DBG(CXT, ul_debugobj(cxt, "umount: trying fstatfs()"));
+ /* O_PATH avoids triggering automount points. */
+ int pathfd = open(tgt, O_PATH);
+ if (pathfd >= 0 && fstatfs(pathfd, &vfs) == 0) {
type = mnt_statfs_get_fstype(&vfs);
+ close(pathfd);
+ }
if (type) {
rc = mnt_fs_set_fstype(cxt->fs, type);
if (rc)

View File

@ -1,3 +1,131 @@
-------------------------------------------------------------------
Fri Jan 29 02:18:58 UTC 2021 - Stanislav Brabec <sbrabec@suse.com>
- Do not require libeconf-devel on products without /usr/etc.
-------------------------------------------------------------------
Mon Jan 25 17:07:55 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
- s/--enable-vendordir/--with-vendordir/
- remove pam_securetty line again. As long as there is no agreement
from pam side having it would fail openQA (boo#1033626)
-------------------------------------------------------------------
Sat Jan 16 02:30:02 UTC 2021 - Stanislav Brabec <sbrabec@suse.com>
- Update to version 2.36.1:
* chrt: use SCHED_FLAG_RESET_ON_FORK for sched_setattr()
* fallocate: fix --dig-holes at end of files
* fdisk: always report fdisk_create_disklabel() errors
* flock: keep -E exit status more restrictive
* fstrim: remove fstab condition from fstrim.timer
* hexdump: automatically use -C when called as hd
* hwclock: add fallback if SYS_settimeofday does not exist, fix
SYS_settimeofday fallback
* libblkid: allow a lot of mac partitions, fix Atari prober logic,
limit amount of parsed partitions
* more libfdisk improvements
* losetup: avoid infinite busy loop, increase limit of setup
attempts
* lsblk: fix -T optional argument, fix SCSI_IDENT_SERIAL, print
zero rather than empty SIZE, read ID_SCSI_IDENT_SERIAL if
available
* lscpu: Add FUJITSU aarch64 A64FX cpupart, Even more Arm part
numbers, avoid segfault on PowerPC systems with valid hardware
configurations (bsc#1175623)
* mount: Add support for "nosymfollow" mount option.
* pg: fix wcstombs()
* sfdisk: correct --json --dump false exclusive, fix backward
--move-data
* vipw: fix short write handling in copyfile
* whereis: fix out of boundary read, support zst compressed man
pages
* minor code improvements and fixes
* minor licensing changes
* improve docs
- Require both group(uuidd) and user(uuidd).
-------------------------------------------------------------------
Thu Nov 26 20:15:46 UTC 2020 - Jan Engelhardt <jengelh@inai.de>
- Do search /usr/sbin for mount helpers. (This drops /sbin/fs,
/sbin/fs.d, which we do not use in openSUSE.)
-------------------------------------------------------------------
Fri Nov 20 15:06:37 UTC 2020 - Ludwig Nussel <lnussel@suse.de>
- prepare usrmerge (boo#1029961)
-------------------------------------------------------------------
Wed Nov 4 11:07:03 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Modernize patch util-linux-sulogin4bsc1175514.patch
* Try to autoconfigure broken serial lines
-------------------------------------------------------------------
Fri Oct 30 14:03:47 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Add patch util-linux-sulogin4bsc1175514.patch
Avoid sulogin failing on not existing or not functional console
devices (bsc#1175514)
-------------------------------------------------------------------
Wed Sep 16 00:10:11 UTC 2020 - Stanislav Brabec <sbrabec@suse.com>
- Fix default permissions of wall and write.
- Update to version 2.36:
* blkdiscard(8) refuses to proceed if filesystem or RAID
signatures are found in interactive mode (executed on a
terminal). The option --force is required to the discard
data.
* new commands irqtop(1) and lsirq(1)to monitor kernel
interrupts.
* cal(1) provides a new --vertical command line option.
* blkzone(8) implements open/close/finish commands now.
* unshare(1) and nsenter(1) commands support the time namespace
now.
* agetty(8) now supports multiple paths in the option
--issue-file.
* fdisk(8), sfdisk(8), cfdisk(8), mkswap(8) and wipefs(8) now
support block devices locking by flock(2), new command line
option --lock and $LOCK_BLOCK_DEVICE environmental variable.
* dmesg(1) new command line option --follow-new to wait and
print only new kernel messages.
* fdisk(8) new command line option --list-details and
--noauto-pt.
* fdisk(8) and sfdisk(8) support user-friendly aliases for
partition types.
* fstrim(8) supports new command line option --listed-in.
* libfdisk provides API to relocate GPT backup header. New
command line option "sfdisk --relocate".
* mount(8) now supports mount by ID= tag.
* login(1) supports list of "message of the day".
* All tools which read /etc/login.defs is possible to compile
with libeconf now.
* more(1) has been refactored.
* man pages cleanup
* other fixes and improvements, see:
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/v2.36-ReleaseNotes
- Refresh Add-documentation-on-blacklisted-modules-to-mount-8-.patch.
- Drop upstreamed libeconf.patch,
libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch.
- util-linux-login_defs-check.sh: Perform all steps to integrate
MOTD_FIRSTONLY.
- Update baselibs.conf.
-------------------------------------------------------------------
Fri May 22 11:15:01 UTC 2020 - Fabian Vogt <fvogt@suse.com>
- Use plain #!/bin/sh for flushb
-------------------------------------------------------------------
Thu May 21 12:48:40 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Include pam_securetty in login.pamd again (bsc#1033626)
- Update to 2.35.2
* make glibc 2.31 compatible
- Dropped unneeded patch libfdisk-script-accept-sector-size.patch
-------------------------------------------------------------------
Wed May 13 10:19:22 UTC 2020 - Fabian Vogt <fvogt@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package python3-libmount
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -79,13 +79,16 @@ Name: python3-libmount
%endif
Summary: %main_summary
License: GPL-2.0-or-later
Group: %group_pl
Group: %main_group
BuildRequires: audit-devel
BuildRequires: binutils-devel
BuildRequires: fdupes
BuildRequires: gettext-devel
BuildRequires: libcap-ng-devel
# It should be %%if %%{defined no_config}, but OBS cannot handle it:
%if 0%{?suse_version} >= 1550
BuildRequires: libeconf-devel
%endif
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
BuildRequires: libtool
@ -122,10 +125,10 @@ BuildRequires: libmount-devel
%endif
%endif
#END SECOND STAGE DEPENDENCIES
Version: 2.35.1
Version: 2.36.1
Release: 0
URL: https://www.kernel.org/pub/linux/utils/util-linux/
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-%{version}.tar.xz
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-%{version}.tar.xz
Source1: util-linux-rpmlintrc
Source2: util-linux-login_defs-check.sh
Source4: raw.service
@ -136,7 +139,7 @@ Source8: login.pamd
Source9: remote.pamd
Source10: su.pamd
Source11: su.default
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-%{version}.tar.sign
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-%{version}.tar.sign
Source13: %{_name}.keyring
Source14: runuser.pamd
Source15: runuser-l.pamd
@ -146,10 +149,8 @@ Source51: blkid.conf
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: libeconf.patch
Patch4: libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch
Patch5: libfdisk-script-accept-sector-size.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# PATCH-FIX-SUSE: Avoid sulogin failing on not existing or not functional console devices
Patch3: util-linux-sulogin4bsc1175514.patch
#
%if %build_util_linux
Supplements: filesystem(minix)
@ -179,12 +180,12 @@ Obsoletes: s390-32
Provides: s390-32
%endif
# uuid-runtime appeared in SLE11 SP1 to SLE11 SP3
Provides: uuid-runtime = %{version}-%{release}
Provides: uuid-runtime = %{version}
Obsoletes: uuid-runtime <= 2.19.1
# All login.defs variables require support from shadow side.
# Upgrade this symbol version only if new variables appear!
# Verify by shadow-login_defs-check.sh from shadow source package.
Requires: login_defs-support-for-util-linux >= 2.33.1
Requires: login_defs-support-for-util-linux >= 2.36
#
# Using "Requires" here would lend itself to help upgrading, but since
# util-linux is in the initial bootstrap, that is not a good thing to do:
@ -378,6 +379,7 @@ License: GPL-2.0-or-later
Group: System/Filesystems
%if 0%{?suse_version} >= 1330
Requires(pre): group(uuidd)
Requires(pre): user(uuidd)
%else
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
@ -550,11 +552,11 @@ AUTOPOINT=true autoreconf -vfi
--enable-static \
--disable-rpath \
--enable-all-programs \
--disable-reset \
--disable-chfn-chsh \
--disable-newgrp \
--disable-vipw \
--disable-pg \
--enable-fs-paths-default="/sbin:/usr/sbin" \
%if %{without enable_last}
--disable-last \
%endif
@ -574,7 +576,7 @@ AUTOPOINT=true autoreconf -vfi
%else
--without-python \
%endif
--enable-vendordir=%{_distconfdir}
--with-vendordir=%{_distconfdir}
#
# Safety check: HAVE_UUIDD should be always 1:
@ -637,7 +639,7 @@ install -m 644 runuser.default %{buildroot}%{_distconfdir}/default/runuser
%make_install
rm -f %{buildroot}%{python3_sitearch}/libmount/*.*a
%if %build_util_linux
#UsrMerge
%if !0%{?usrmerged}
ln -s %{_bindir}/kill %{buildroot}/bin
ln -s %{_bindir}/su %{buildroot}/bin
ln -s %{_bindir}/dmesg %{buildroot}/bin
@ -675,9 +677,9 @@ ln -s %{_sbindir}/fsfreeze %{buildroot}/sbin
ln -s %{_sbindir}/swaplabel %{buildroot}/sbin
ln -s %{_sbindir}/fstrim %{buildroot}/sbin
ln -s %{_sbindir}/chcpu %{buildroot}/sbin
#EndUsrMerge
%endif
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/filesystems
echo -e "#! /bin/bash\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb
echo -e "#!/bin/sh\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb
chmod 755 %{buildroot}%{_sbindir}/flushb
# Install scripts to configure raw devices at boot time
install -m 644 $RPM_SOURCE_DIR%{_sysconfdir}.raw %{buildroot}%{_sysconfdir}/raw
@ -688,16 +690,18 @@ ln -sf service %{buildroot}%{_sbindir}/rcraw
mv %{buildroot}%{_docdir}/%{_name}/getopt %{buildroot}%{_datadir}/
# Stupid hack so we don't have a tcsh dependency
chmod 644 %{buildroot}%{_datadir}/getopt/getopt*.tcsh
%if !0%{?usrmerged}
# login is always and only in /bin
mv %{buildroot}%{_bindir}/login %{buildroot}/bin/
%endif
# arch dependent
%ifarch s390 s390x
rm -f %{buildroot}%{_sysconfdir}/fdprm
rm -f %{buildroot}%{_sbindir}/fdformat
rm -f %{buildroot}%{_sbindir}/hwclock
#UsrMerge
%if !0%{?usrmerged}
rm -f %{buildroot}/sbin/hwclock
#EndUsrMerge
%endif
rm -f %{buildroot}%{_bindir}/setterm
rm -f %{buildroot}%{_sbindir}/tunelp
rm -f %{buildroot}%{_mandir}/man8/fdformat.8*
@ -708,19 +712,17 @@ rm -f %{buildroot}%{_mandir}/man8/tunelp.8*
rm -f %{buildroot}%{_mandir}/man8/cfdisk.8*
rm -f %{buildroot}%{_mandir}/man8/sfdisk.8*
rm -f %{buildroot}%{_sbindir}/cfdisk
#UsrMerge
rm -f %{buildroot}/sbin/cfdisk
#EndUsrMerge
rm -f %{buildroot}%{_sbindir}/sfdisk
#UsrMerge
%if !0%{?usrmerged}
rm -f %{buildroot}/sbin/cfdisk
rm -f %{buildroot}/sbin/sfdisk
#EndUsrMerge
%endif
%endif
%ifarch ia64 m68k
rm -f %{buildroot}%{_sbindir}/fdisk
#UsrMerge
%if !0%{?usrmerged}
rm -f %{buildroot}/sbin/fdisk
#EndUsrMerge
%endif
rm -f %{buildroot}%{_mandir}/man8/fdisk.8*
%endif
%find_lang %{name} %{name}.lang
@ -739,7 +741,9 @@ mkdir -p %{buildroot}/bin
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_localstatedir}/lib/libuuid
mkdir -p %{buildroot}/run/uuidd
%if !0%{?usrmerged}
ln -s %{_bindir}/logger %{buildroot}/bin
%endif
# clock.txt from uuidd is a ghost file
touch %{buildroot}%{_localstatedir}/lib/libuuid/clock.txt
ln -sf /sbin/service %{buildroot}/usr/sbin/rcuuidd
@ -763,6 +767,7 @@ done
%service_add_post raw.service
%set_permissions %{_bindir}/wall %{_bindir}/write %{_bindir}/mount %{_bindir}/umount
%set_permissions %{_bindir}/su
%if ! %{defined no_config}
#
# If outdated PAM file is detected, issue a warning.
for PAM_FILE in login remote runuser runuser-l su su-l ; do
@ -787,12 +792,15 @@ if ! grep -q "^# /etc/default/su is an override" %{_sysconfdir}/default/su ; the
echo "Please edit %{_sysconfdir}/login.defs or %{_sysconfdir}/default/su to restore your customization." >&2
fi
fi
%endif
%posttrans
%if %{defined no_config}
# Migration to /usr/etc.
for i in login remote runuser runuser-l su su-l; do
test -f /etc/pam.d/${i}.rpmsave && mv -v /etc/pam.d/${i}.rpmsave /etc/pam.d/${i} ||:
done
%endif
%preun
%service_del_preun raw.service
@ -898,7 +906,9 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_distconfdir}/pam.d/runuser-l
%{_distconfdir}/pam.d/su
%{_distconfdir}/pam.d/su-l
%{_distconfdir}/default
%if 0%{?suse_version} <= 1520
%dir %{_distconfdir}/default
%endif
%{_distconfdir}/default/runuser
%{_distconfdir}/default/su
%else
@ -912,7 +922,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%config(noreplace) %{_sysconfdir}/default/su
%endif
%config %dir %{_sysconfdir}/issue.d
#UsrMerge
%if !0%{?usrmerged}
/bin/kill
/bin/su
/bin/dmesg
@ -947,7 +957,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
/sbin/swaplabel
/sbin/fstrim
/sbin/chcpu
#EndUsrMerge
%endif
%{_bindir}/kill
%verify(not mode) %{_bindir}/su
%{_bindir}/eject
@ -971,6 +981,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_bindir}/ipcmk
%{_bindir}/ipcrm
%{_bindir}/ipcs
%{_bindir}/irqtop
%{_bindir}/isosize
%if %{with enable_last}
%{_bindir}/last
@ -978,9 +989,13 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%endif
%{_bindir}/line
%{_bindir}/look
%if 0%{?usrmerged}
%{_bindir}/login
%endif
%{_bindir}/lsblk
%{_bindir}/lscpu
%{_bindir}/lsipc
%{_bindir}/lsirq
%{_bindir}/lslocks
%{_bindir}/lsmem
%{_bindir}/lsns
@ -1082,6 +1097,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_mandir}/man1/look.1.gz
%{_mandir}/man1/lscpu.1.gz
%{_mandir}/man1/lsipc.1.gz
%{_mandir}/man1/lsirq.1.gz
%{_mandir}/man1/lsmem.1.gz
%{_mandir}/man1/mcookie.1.gz
%{_mandir}/man1/mesg.1.gz
@ -1089,6 +1105,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_mandir}/man1/namei.1.gz
%{_mandir}/man1/nsenter.1.gz
%{_mandir}/man1/ionice.1.gz
%{_mandir}/man1/irqtop.1.gz
%{_mandir}/man1/prlimit.1.gz
%{_mandir}/man1/rename.1.gz
%{_mandir}/man1/rev.1.gz
@ -1182,27 +1199,27 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%ifnarch ia64 m68k
#XXX: post our patches upstream
#XXX: call fdupes on /usr/share/man
#UsrMerge
%if !0%{?usrmerged}
/sbin/fdisk
#EndUsrMerge
%endif
%{_sbindir}/fdisk
%{_mandir}/man8/fdisk.8.gz
%endif
%ifnarch %sparc ia64 m68k
%{_mandir}/man8/cfdisk.8.gz
%{_mandir}/man8/sfdisk.8.gz
#UsrMerge
%if !0%{?usrmerged}
/sbin/cfdisk
/sbin/sfdisk
#EndUsrMerge
%endif
%{_sbindir}/cfdisk
%{_sbindir}/sfdisk
%endif
%ifnarch s390 s390x
%{_sbindir}/fdformat
#UsrMerge
%if !0%{?usrmerged}
/sbin/hwclock
#EndUsrMerge
%endif
%{_sbindir}/hwclock
%{_bindir}/setterm
%{_sbindir}/tunelp
@ -1301,7 +1318,9 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%files
%endif
%defattr(-, root, root)
%if !0%{?usrmerged}
/bin/logger
%endif
%{_bindir}/logger
%{_bindir}/lslogins
#BEGIN bootstrap_hack

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEsMZNFDAcxu+u32Dk5LcdXuw5woQFAl4z91YACgkQ5LcdXuw5
woR+HBAAitw3A7hcWjYo+SPHRtPtLr8PwbdJMNohAtRkTBa11bBTypgJY6tHq0iU
f3ny8XX+s9x65ccSOYtSyZRLjde5lliD53rOKSU32mjcgm7WVSSBavludf9JNRuE
ou/JbN8zhWk0y/EdEoav5d27wpCSMb8QJNWItI79QJqRks1hKPXkZqXSoZv6fmhZ
qUdGLoc7V90Xe3iLEQSSMi0PUkdXFyTBD0gEo7YIHhbTn6ElQZoUHCYKno7QHVUI
b422K64X7jEeAw2EQFOuVZ7eruMswItrt6hUTp20ZfkBTcTf7r/dYTJPU8YAY5+a
b0VWmd4cpFalCuifqeCwl9sufyVB61TN5NnSzM4vHLZukPIokZn9onKjWCfayze/
aSoTH7h/CIiYg7IIgAGPMOquU76Uyrsun5M034x9wZ4lobNyP5MFsPNhAmqJz+I/
c49FQWO7NhPDZKfAGajOK2jx33MopYtOxr2SyObFqBH8VhAGPdF1XYlC3HBYjQ44
4uXTeJ5AtTFOEdOYiGtyztR9am4QVrl1GOaO/ZHLDWXI5HHNNrAuQ7lI0u7NP4BS
mUqfOH+/AJL7srrgd0hWNGn7mnTQsHEIzt/cpZ+AfU93FQl8u7We4QQSjXMA3qPX
TXu9F1aEg9z2do/m/uWeYI3b8d8sE2i0Unon91Cb291EN6h5RWw=
=lzWN
-----END PGP SIGNATURE-----

View File

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

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEsMZNFDAcxu+u32Dk5LcdXuw5woQFAl+yYy4ACgkQ5LcdXuw5
woTeog/7B+1LH5MQZnBYo3Tx4g5NNj0fwky8Y6/B8LqsxVHs8padD3ur3sieaQLu
PlmFr6zKH0OM2AVQHOJOxmxuMil98bg5+SNBPDBuxlVJB3F3kr5/N4UIUHdH5VSW
LcpaFbNTKupt9C92BGSYpaYRqRV8O0Rm39kg7bnwybNVRRB/6S3HNfvRQt6bUszF
Kx9EGtQYKEMO1cBiT9G+mWhgmXgabQGErVJYizVkrnSqWI76PQge/N5N3yPRTyZW
0l56sGAI3pMl99xqWiHJZZ1lSBb5a7M6+MsvrggVs2NlYKwuzrKgI18wN14+NAxM
Lvs9XF1xtcffcuy0IDs8WEuJXpRpo587g0X+wdSefQGkUlcScZ2YXMhqjPl1GJM/
XImN1lUqDPKETY0BQmjqH+OLJTmtU/1iygLh4YQlugbxzpceXNO15LMqQFuiFz14
AwKvhoJu7LEWo8wMOUN8maEltD/kDV8a2BP0blU642S11A+Ei9voVHg8AsqW1uSO
uF6P/g0+kY5+jIm+HJykVwKdyuNn2VQPOw3+BIAx2NdHV06eGPDBM0n0UmCHENba
d63qeb6FfP/3NKOTPsI+GO5k6gBdzw6gUZhnGD+Da4Cd4i19vF9yPWfASCt/9QB+
yOUYD9anmP3KPwSpAhtjk+2UAe6kikdaRfopUboDrkNqd8lbBe8=
=M0k0
-----END PGP SIGNATURE-----

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

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

View File

@ -15,7 +15,7 @@ echo -n "Checking login.defs variables in util-linux... " >&2
sed -n 's/^.*logindefs_setenv*("[A-Z0-9_]*", "\([A-Z0-9_]*\)".*$/\1/p'
) | LC_ALL=C sort -u >util-linux-login_defs-vars.lst
if test $(sha1sum util-linux-login_defs-vars.lst | sed 's/ .*$//') != ca9ea2bf3ee8c8c0c623ace938cdf0f04869f8cf ; then
if test $(sha1sum util-linux-login_defs-vars.lst | sed 's/ .*$//') != bdea2548d823e727ddf2cc3318dfce4aa6a9b48f ; then
echo "does not match!" >&2
echo "Checksum is: $(sha1sum util-linux-login_defs-vars.lst | sed 's/ .*$//')" >&2

View File

@ -0,0 +1,238 @@
From: Werner Fink <werner@suse.de>
Date: Fri, 30 Oct 2020 14:54:59 +0100
Subject: [PATCH] sulogin: ignore not existing console devices
and also not functional console devices. Redirect the error
messages to the appropiate console device.
---
login-utils/sulogin-consoles.h | 1 +
login-utils/sulogin.c | 97 +++++++++++++++++++++++++++++++++++-------
2 files changed, 82 insertions(+), 16 deletions(-)
diff --git a/login-utils/sulogin-consoles.h b/login-utils/sulogin-consoles.h
index 0bfbc3871..12032c997 100644
--- a/login-utils/sulogin-consoles.h
+++ b/login-utils/sulogin-consoles.h
@@ -40,6 +40,7 @@ struct console {
int fd, id;
#define CON_SERIAL 0x0001
#define CON_NOTTY 0x0002
+#define CON_EIO 0x0004
pid_t pid;
struct chardata cp;
struct termios tio;
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 9091caf14..c833796e7 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -52,6 +52,7 @@
#ifdef __linux__
# include <sys/kd.h>
# include <sys/param.h>
+# include <linux/serial.h>
#endif
#include "c.h"
@@ -104,6 +105,9 @@ static void tcinit(struct console *con)
int flags = 0, mode = 0;
struct termios *tio = &con->tio;
const int fd = con->fd;
+#if defined(TIOCGSERIAL)
+ struct serial_struct serinfo;
+#endif
#ifdef USE_PLYMOUTH_SUPPORT
struct termios lock;
int i = (plymouth_command(MAGIC_PING)) ? PLYMOUTH_TERMIOS_FLAGS_DELAY : 0;
@@ -123,27 +127,72 @@ static void tcinit(struct console *con)
}
memset(&lock, 0, sizeof(struct termios));
ioctl(fd, TIOCSLCKTRMIOS, &lock);
+ errno = 0;
#endif
+
+#if defined(TIOCGSERIAL)
+ if (ioctl(fd, TIOCGSERIAL, &serinfo) >= 0)
+ con->flags |= CON_SERIAL;
+ errno = 0;
+#else
+# if defined(KDGKBMODE)
+ if (ioctl(fd, KDGKBMODE, &mode) < 0)
+ con->flags |= CON_SERIAL;
errno = 0;
+# endif
+#endif
if (tcgetattr(fd, tio) < 0) {
- warn(_("tcgetattr failed"));
- con->flags |= CON_NOTTY;
- return;
+ int saveno = errno;
+#if defined(KDGKBMODE) || defined(TIOCGSERIAL)
+ if (con->flags & CON_SERIAL) { /* Try to recover this */
+
+# if defined(TIOCGSERIAL)
+ serinfo.flags |= ASYNC_SKIP_TEST; /* Skip test of UART */
+
+ if (ioctl(fd, TIOCSSERIAL, &serinfo) < 0)
+ goto tcgeterr;
+ if (ioctl(fd, TIOCSERCONFIG) < 0) /* Try to autoconfigure */
+ goto tcgeterr;
+ if (ioctl(fd, TIOCGSERIAL, &serinfo) < 0)
+ goto tcgeterr; /* Ouch */
+# endif
+ if (tcgetattr(fd, tio) < 0) /* Retry to get tty attributes */
+ saveno = errno;
+ }
+# if defined(TIOCGSERIAL)
+ tcgeterr:
+# endif
+ if (saveno)
+#endif
+ {
+ FILE *fcerr = fdopen(fd, "w");
+ if (fcerr) {
+ fprintf(fcerr, _("tcgetattr failed"));
+ fclose(fcerr);
+ }
+ warn(_("tcgetattr failed"));
+
+ con->flags &= ~CON_SERIAL;
+ if (saveno != EIO)
+ con->flags |= CON_NOTTY;
+ else
+ con->flags |= CON_EIO;
+
+ errno = 0;
+ return;
+ }
}
/* Handle lines other than virtual consoles here */
-#if defined(KDGKBMODE)
- if (ioctl(fd, KDGKBMODE, &mode) < 0)
+#if defined(KDGKBMODE) || defined(TIOCGSERIAL)
+ if (con->flags & CON_SERIAL)
#endif
{
speed_t ispeed, ospeed;
struct winsize ws;
errno = 0;
- /* this is a modem line */
- con->flags |= CON_SERIAL;
-
/* Flush input and output queues on modem lines */
tcflush(fd, TCIOFLUSH);
@@ -220,6 +269,8 @@ static void tcfinal(struct console *con)
struct termios *tio = &con->tio;
const int fd = con->fd;
+ if (con->flags & CON_EIO)
+ return;
if ((con->flags & CON_SERIAL) == 0) {
xsetenv("TERM", "linux", 1);
return;
@@ -557,12 +608,16 @@ err:
static void setup(struct console *con)
{
int fd = con->fd;
- const pid_t pid = getpid(), pgrp = getpgid(0), ppgrp =
- getpgid(getppid()), ttypgrp = tcgetpgrp(fd);
+ const pid_t pid = getpid(), pgrp = getpgid(0), ppgrp = getpgid(getppid());
+ pid_t ttypgrp;
if (con->flags & CON_NOTTY)
+ goto notty;
+ if (con->flags & CON_EIO)
return;
+ ttypgrp = tcgetpgrp(fd);
+
/*
* Only go through this trouble if the new
* tty doesn't fall in this process group.
@@ -585,6 +640,7 @@ static void setup(struct console *con)
ioctl(fd, TIOCSCTTY, (char *)1);
tcsetpgrp(fd, ppgrp);
}
+notty:
dup2(fd, STDIN_FILENO);
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
@@ -608,20 +664,25 @@ static const char *getpasswd(struct console *con)
struct termios tty;
static char pass[128], *ptr;
struct chardata *cp;
- const char *ret = pass;
+ const char *ret = NULL;
unsigned char tc;
char c, ascval;
int eightbit;
const int fd = con->fd;
- if (con->flags & CON_NOTTY)
+ if (con->flags & CON_EIO)
goto out;
+
cp = &con->cp;
tty = con->tio;
+ tc = 0;
+ ret = pass;
tty.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY);
tty.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP|ISIG);
- tc = (tcsetattr(fd, TCSAFLUSH, &tty) == 0);
+
+ if ((con->flags & CON_NOTTY) == 0)
+ tc = (tcsetattr(fd, TCSAFLUSH, &tty) == 0);
sigemptyset(&sa.sa_mask);
sa.sa_handler = alrm_handler;
@@ -647,11 +708,12 @@ static const char *getpasswd(struct console *con)
}
ret = NULL;
switch (errno) {
- case 0:
case EIO:
+ con->flags |= CON_EIO;
case ESRCH:
case EINVAL:
case ENOENT:
+ case 0:
break;
default:
warn(_("cannot read %s"), con->tty);
@@ -775,7 +837,7 @@ static void sushell(struct passwd *pwd)
#ifdef HAVE_LIBSELINUX
if (is_selinux_enabled() > 0) {
- security_context_t scon=NULL;
+ char *scon=NULL;
char *seuser=NULL;
char *level=NULL;
if (getseuserbyname("root", &seuser, &level) == 0) {
@@ -968,10 +1030,13 @@ int main(int argc, char **argv)
con = list_entry(ptr, struct console, entry);
if (con->id >= CONMAX)
break;
+ if (con->flags & CON_EIO)
+ goto next;
switch ((con->pid = fork())) {
case 0:
mask_signal(SIGCHLD, SIG_DFL, NULL);
+ dup2(con->fd, STDERR_FILENO);
nofork:
setup(con);
while (1) {
@@ -1026,7 +1091,7 @@ int main(int argc, char **argv)
default:
break;
}
-
+ next:
ptr = ptr->next;
} while (ptr != &consoles);

View File

@ -1,3 +1,131 @@
-------------------------------------------------------------------
Fri Jan 29 02:18:58 UTC 2021 - Stanislav Brabec <sbrabec@suse.com>
- Do not require libeconf-devel on products without /usr/etc.
-------------------------------------------------------------------
Mon Jan 25 17:07:55 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
- s/--enable-vendordir/--with-vendordir/
- remove pam_securetty line again. As long as there is no agreement
from pam side having it would fail openQA (boo#1033626)
-------------------------------------------------------------------
Sat Jan 16 02:30:02 UTC 2021 - Stanislav Brabec <sbrabec@suse.com>
- Update to version 2.36.1:
* chrt: use SCHED_FLAG_RESET_ON_FORK for sched_setattr()
* fallocate: fix --dig-holes at end of files
* fdisk: always report fdisk_create_disklabel() errors
* flock: keep -E exit status more restrictive
* fstrim: remove fstab condition from fstrim.timer
* hexdump: automatically use -C when called as hd
* hwclock: add fallback if SYS_settimeofday does not exist, fix
SYS_settimeofday fallback
* libblkid: allow a lot of mac partitions, fix Atari prober logic,
limit amount of parsed partitions
* more libfdisk improvements
* losetup: avoid infinite busy loop, increase limit of setup
attempts
* lsblk: fix -T optional argument, fix SCSI_IDENT_SERIAL, print
zero rather than empty SIZE, read ID_SCSI_IDENT_SERIAL if
available
* lscpu: Add FUJITSU aarch64 A64FX cpupart, Even more Arm part
numbers, avoid segfault on PowerPC systems with valid hardware
configurations (bsc#1175623)
* mount: Add support for "nosymfollow" mount option.
* pg: fix wcstombs()
* sfdisk: correct --json --dump false exclusive, fix backward
--move-data
* vipw: fix short write handling in copyfile
* whereis: fix out of boundary read, support zst compressed man
pages
* minor code improvements and fixes
* minor licensing changes
* improve docs
- Require both group(uuidd) and user(uuidd).
-------------------------------------------------------------------
Thu Nov 26 20:15:46 UTC 2020 - Jan Engelhardt <jengelh@inai.de>
- Do search /usr/sbin for mount helpers. (This drops /sbin/fs,
/sbin/fs.d, which we do not use in openSUSE.)
-------------------------------------------------------------------
Fri Nov 20 15:06:37 UTC 2020 - Ludwig Nussel <lnussel@suse.de>
- prepare usrmerge (boo#1029961)
-------------------------------------------------------------------
Wed Nov 4 11:07:03 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Modernize patch util-linux-sulogin4bsc1175514.patch
* Try to autoconfigure broken serial lines
-------------------------------------------------------------------
Fri Oct 30 14:03:47 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Add patch util-linux-sulogin4bsc1175514.patch
Avoid sulogin failing on not existing or not functional console
devices (bsc#1175514)
-------------------------------------------------------------------
Wed Sep 16 00:10:11 UTC 2020 - Stanislav Brabec <sbrabec@suse.com>
- Fix default permissions of wall and write.
- Update to version 2.36:
* blkdiscard(8) refuses to proceed if filesystem or RAID
signatures are found in interactive mode (executed on a
terminal). The option --force is required to the discard
data.
* new commands irqtop(1) and lsirq(1)to monitor kernel
interrupts.
* cal(1) provides a new --vertical command line option.
* blkzone(8) implements open/close/finish commands now.
* unshare(1) and nsenter(1) commands support the time namespace
now.
* agetty(8) now supports multiple paths in the option
--issue-file.
* fdisk(8), sfdisk(8), cfdisk(8), mkswap(8) and wipefs(8) now
support block devices locking by flock(2), new command line
option --lock and $LOCK_BLOCK_DEVICE environmental variable.
* dmesg(1) new command line option --follow-new to wait and
print only new kernel messages.
* fdisk(8) new command line option --list-details and
--noauto-pt.
* fdisk(8) and sfdisk(8) support user-friendly aliases for
partition types.
* fstrim(8) supports new command line option --listed-in.
* libfdisk provides API to relocate GPT backup header. New
command line option "sfdisk --relocate".
* mount(8) now supports mount by ID= tag.
* login(1) supports list of "message of the day".
* All tools which read /etc/login.defs is possible to compile
with libeconf now.
* more(1) has been refactored.
* man pages cleanup
* other fixes and improvements, see:
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/v2.36-ReleaseNotes
- Refresh Add-documentation-on-blacklisted-modules-to-mount-8-.patch.
- Drop upstreamed libeconf.patch,
libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch.
- util-linux-login_defs-check.sh: Perform all steps to integrate
MOTD_FIRSTONLY.
- Update baselibs.conf.
-------------------------------------------------------------------
Fri May 22 11:15:01 UTC 2020 - Fabian Vogt <fvogt@suse.com>
- Use plain #!/bin/sh for flushb
-------------------------------------------------------------------
Thu May 21 12:48:40 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Include pam_securetty in login.pamd again (bsc#1033626)
- Update to 2.35.2
* make glibc 2.31 compatible
- Dropped unneeded patch libfdisk-script-accept-sector-size.patch
-------------------------------------------------------------------
Wed May 13 10:19:22 UTC 2020 - Fabian Vogt <fvogt@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package util-linux-systemd
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -85,7 +85,10 @@ BuildRequires: binutils-devel
BuildRequires: fdupes
BuildRequires: gettext-devel
BuildRequires: libcap-ng-devel
# It should be %%if %%{defined no_config}, but OBS cannot handle it:
%if 0%{?suse_version} >= 1550
BuildRequires: libeconf-devel
%endif
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
BuildRequires: libtool
@ -122,10 +125,10 @@ BuildRequires: libmount-devel
%endif
%endif
#END SECOND STAGE DEPENDENCIES
Version: 2.35.1
Version: 2.36.1
Release: 0
URL: https://www.kernel.org/pub/linux/utils/util-linux/
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-%{version}.tar.xz
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-%{version}.tar.xz
Source1: util-linux-rpmlintrc
Source2: util-linux-login_defs-check.sh
Source4: raw.service
@ -136,7 +139,7 @@ Source8: login.pamd
Source9: remote.pamd
Source10: su.pamd
Source11: su.default
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-%{version}.tar.sign
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-%{version}.tar.sign
Source13: %{_name}.keyring
Source14: runuser.pamd
Source15: runuser-l.pamd
@ -146,10 +149,8 @@ Source51: blkid.conf
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: libeconf.patch
Patch4: libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch
Patch5: libfdisk-script-accept-sector-size.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# PATCH-FIX-SUSE: Avoid sulogin failing on not existing or not functional console devices
Patch3: util-linux-sulogin4bsc1175514.patch
#
%if %build_util_linux
Supplements: filesystem(minix)
@ -179,12 +180,12 @@ Obsoletes: s390-32
Provides: s390-32
%endif
# uuid-runtime appeared in SLE11 SP1 to SLE11 SP3
Provides: uuid-runtime = %{version}-%{release}
Provides: uuid-runtime = %{version}
Obsoletes: uuid-runtime <= 2.19.1
# All login.defs variables require support from shadow side.
# Upgrade this symbol version only if new variables appear!
# Verify by shadow-login_defs-check.sh from shadow source package.
Requires: login_defs-support-for-util-linux >= 2.33.1
Requires: login_defs-support-for-util-linux >= 2.36
#
# Using "Requires" here would lend itself to help upgrading, but since
# util-linux is in the initial bootstrap, that is not a good thing to do:
@ -378,6 +379,7 @@ License: GPL-2.0-or-later
Group: System/Filesystems
%if 0%{?suse_version} >= 1330
Requires(pre): group(uuidd)
Requires(pre): user(uuidd)
%else
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
@ -550,11 +552,11 @@ AUTOPOINT=true autoreconf -vfi
--enable-static \
--disable-rpath \
--enable-all-programs \
--disable-reset \
--disable-chfn-chsh \
--disable-newgrp \
--disable-vipw \
--disable-pg \
--enable-fs-paths-default="/sbin:/usr/sbin" \
%if %{without enable_last}
--disable-last \
%endif
@ -574,7 +576,7 @@ AUTOPOINT=true autoreconf -vfi
%else
--without-python \
%endif
--enable-vendordir=%{_distconfdir}
--with-vendordir=%{_distconfdir}
#
# Safety check: HAVE_UUIDD should be always 1:
@ -637,7 +639,7 @@ install -m 644 runuser.default %{buildroot}%{_distconfdir}/default/runuser
%make_install
rm -f %{buildroot}%{python3_sitearch}/libmount/*.*a
%if %build_util_linux
#UsrMerge
%if !0%{?usrmerged}
ln -s %{_bindir}/kill %{buildroot}/bin
ln -s %{_bindir}/su %{buildroot}/bin
ln -s %{_bindir}/dmesg %{buildroot}/bin
@ -675,9 +677,9 @@ ln -s %{_sbindir}/fsfreeze %{buildroot}/sbin
ln -s %{_sbindir}/swaplabel %{buildroot}/sbin
ln -s %{_sbindir}/fstrim %{buildroot}/sbin
ln -s %{_sbindir}/chcpu %{buildroot}/sbin
#EndUsrMerge
%endif
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/filesystems
echo -e "#! /bin/bash\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb
echo -e "#!/bin/sh\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb
chmod 755 %{buildroot}%{_sbindir}/flushb
# Install scripts to configure raw devices at boot time
install -m 644 $RPM_SOURCE_DIR%{_sysconfdir}.raw %{buildroot}%{_sysconfdir}/raw
@ -688,16 +690,18 @@ ln -sf service %{buildroot}%{_sbindir}/rcraw
mv %{buildroot}%{_docdir}/%{_name}/getopt %{buildroot}%{_datadir}/
# Stupid hack so we don't have a tcsh dependency
chmod 644 %{buildroot}%{_datadir}/getopt/getopt*.tcsh
%if !0%{?usrmerged}
# login is always and only in /bin
mv %{buildroot}%{_bindir}/login %{buildroot}/bin/
%endif
# arch dependent
%ifarch s390 s390x
rm -f %{buildroot}%{_sysconfdir}/fdprm
rm -f %{buildroot}%{_sbindir}/fdformat
rm -f %{buildroot}%{_sbindir}/hwclock
#UsrMerge
%if !0%{?usrmerged}
rm -f %{buildroot}/sbin/hwclock
#EndUsrMerge
%endif
rm -f %{buildroot}%{_bindir}/setterm
rm -f %{buildroot}%{_sbindir}/tunelp
rm -f %{buildroot}%{_mandir}/man8/fdformat.8*
@ -708,19 +712,17 @@ rm -f %{buildroot}%{_mandir}/man8/tunelp.8*
rm -f %{buildroot}%{_mandir}/man8/cfdisk.8*
rm -f %{buildroot}%{_mandir}/man8/sfdisk.8*
rm -f %{buildroot}%{_sbindir}/cfdisk
#UsrMerge
rm -f %{buildroot}/sbin/cfdisk
#EndUsrMerge
rm -f %{buildroot}%{_sbindir}/sfdisk
#UsrMerge
%if !0%{?usrmerged}
rm -f %{buildroot}/sbin/cfdisk
rm -f %{buildroot}/sbin/sfdisk
#EndUsrMerge
%endif
%endif
%ifarch ia64 m68k
rm -f %{buildroot}%{_sbindir}/fdisk
#UsrMerge
%if !0%{?usrmerged}
rm -f %{buildroot}/sbin/fdisk
#EndUsrMerge
%endif
rm -f %{buildroot}%{_mandir}/man8/fdisk.8*
%endif
%find_lang %{name} %{name}.lang
@ -739,7 +741,9 @@ mkdir -p %{buildroot}/bin
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_localstatedir}/lib/libuuid
mkdir -p %{buildroot}/run/uuidd
%if !0%{?usrmerged}
ln -s %{_bindir}/logger %{buildroot}/bin
%endif
# clock.txt from uuidd is a ghost file
touch %{buildroot}%{_localstatedir}/lib/libuuid/clock.txt
ln -sf /sbin/service %{buildroot}/usr/sbin/rcuuidd
@ -763,6 +767,7 @@ done
%service_add_post raw.service
%set_permissions %{_bindir}/wall %{_bindir}/write %{_bindir}/mount %{_bindir}/umount
%set_permissions %{_bindir}/su
%if ! %{defined no_config}
#
# If outdated PAM file is detected, issue a warning.
for PAM_FILE in login remote runuser runuser-l su su-l ; do
@ -787,12 +792,15 @@ if ! grep -q "^# /etc/default/su is an override" %{_sysconfdir}/default/su ; the
echo "Please edit %{_sysconfdir}/login.defs or %{_sysconfdir}/default/su to restore your customization." >&2
fi
fi
%endif
%posttrans
%if %{defined no_config}
# Migration to /usr/etc.
for i in login remote runuser runuser-l su su-l; do
test -f /etc/pam.d/${i}.rpmsave && mv -v /etc/pam.d/${i}.rpmsave /etc/pam.d/${i} ||:
done
%endif
%preun
%service_del_preun raw.service
@ -898,7 +906,9 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_distconfdir}/pam.d/runuser-l
%{_distconfdir}/pam.d/su
%{_distconfdir}/pam.d/su-l
%{_distconfdir}/default
%if 0%{?suse_version} <= 1520
%dir %{_distconfdir}/default
%endif
%{_distconfdir}/default/runuser
%{_distconfdir}/default/su
%else
@ -912,7 +922,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%config(noreplace) %{_sysconfdir}/default/su
%endif
%config %dir %{_sysconfdir}/issue.d
#UsrMerge
%if !0%{?usrmerged}
/bin/kill
/bin/su
/bin/dmesg
@ -947,7 +957,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
/sbin/swaplabel
/sbin/fstrim
/sbin/chcpu
#EndUsrMerge
%endif
%{_bindir}/kill
%verify(not mode) %{_bindir}/su
%{_bindir}/eject
@ -971,6 +981,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_bindir}/ipcmk
%{_bindir}/ipcrm
%{_bindir}/ipcs
%{_bindir}/irqtop
%{_bindir}/isosize
%if %{with enable_last}
%{_bindir}/last
@ -978,9 +989,13 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%endif
%{_bindir}/line
%{_bindir}/look
%if 0%{?usrmerged}
%{_bindir}/login
%endif
%{_bindir}/lsblk
%{_bindir}/lscpu
%{_bindir}/lsipc
%{_bindir}/lsirq
%{_bindir}/lslocks
%{_bindir}/lsmem
%{_bindir}/lsns
@ -1082,6 +1097,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_mandir}/man1/look.1.gz
%{_mandir}/man1/lscpu.1.gz
%{_mandir}/man1/lsipc.1.gz
%{_mandir}/man1/lsirq.1.gz
%{_mandir}/man1/lsmem.1.gz
%{_mandir}/man1/mcookie.1.gz
%{_mandir}/man1/mesg.1.gz
@ -1089,6 +1105,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_mandir}/man1/namei.1.gz
%{_mandir}/man1/nsenter.1.gz
%{_mandir}/man1/ionice.1.gz
%{_mandir}/man1/irqtop.1.gz
%{_mandir}/man1/prlimit.1.gz
%{_mandir}/man1/rename.1.gz
%{_mandir}/man1/rev.1.gz
@ -1182,27 +1199,27 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%ifnarch ia64 m68k
#XXX: post our patches upstream
#XXX: call fdupes on /usr/share/man
#UsrMerge
%if !0%{?usrmerged}
/sbin/fdisk
#EndUsrMerge
%endif
%{_sbindir}/fdisk
%{_mandir}/man8/fdisk.8.gz
%endif
%ifnarch %sparc ia64 m68k
%{_mandir}/man8/cfdisk.8.gz
%{_mandir}/man8/sfdisk.8.gz
#UsrMerge
%if !0%{?usrmerged}
/sbin/cfdisk
/sbin/sfdisk
#EndUsrMerge
%endif
%{_sbindir}/cfdisk
%{_sbindir}/sfdisk
%endif
%ifnarch s390 s390x
%{_sbindir}/fdformat
#UsrMerge
%if !0%{?usrmerged}
/sbin/hwclock
#EndUsrMerge
%endif
%{_sbindir}/hwclock
%{_bindir}/setterm
%{_sbindir}/tunelp
@ -1301,7 +1318,9 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%files
%endif
%defattr(-, root, root)
%if !0%{?usrmerged}
/bin/logger
%endif
%{_bindir}/logger
%{_bindir}/lslogins
#BEGIN bootstrap_hack

View File

@ -1,3 +1,131 @@
-------------------------------------------------------------------
Fri Jan 29 02:18:58 UTC 2021 - Stanislav Brabec <sbrabec@suse.com>
- Do not require libeconf-devel on products without /usr/etc.
-------------------------------------------------------------------
Mon Jan 25 17:07:55 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
- s/--enable-vendordir/--with-vendordir/
- remove pam_securetty line again. As long as there is no agreement
from pam side having it would fail openQA (boo#1033626)
-------------------------------------------------------------------
Sat Jan 16 02:30:02 UTC 2021 - Stanislav Brabec <sbrabec@suse.com>
- Update to version 2.36.1:
* chrt: use SCHED_FLAG_RESET_ON_FORK for sched_setattr()
* fallocate: fix --dig-holes at end of files
* fdisk: always report fdisk_create_disklabel() errors
* flock: keep -E exit status more restrictive
* fstrim: remove fstab condition from fstrim.timer
* hexdump: automatically use -C when called as hd
* hwclock: add fallback if SYS_settimeofday does not exist, fix
SYS_settimeofday fallback
* libblkid: allow a lot of mac partitions, fix Atari prober logic,
limit amount of parsed partitions
* more libfdisk improvements
* losetup: avoid infinite busy loop, increase limit of setup
attempts
* lsblk: fix -T optional argument, fix SCSI_IDENT_SERIAL, print
zero rather than empty SIZE, read ID_SCSI_IDENT_SERIAL if
available
* lscpu: Add FUJITSU aarch64 A64FX cpupart, Even more Arm part
numbers, avoid segfault on PowerPC systems with valid hardware
configurations (bsc#1175623)
* mount: Add support for "nosymfollow" mount option.
* pg: fix wcstombs()
* sfdisk: correct --json --dump false exclusive, fix backward
--move-data
* vipw: fix short write handling in copyfile
* whereis: fix out of boundary read, support zst compressed man
pages
* minor code improvements and fixes
* minor licensing changes
* improve docs
- Require both group(uuidd) and user(uuidd).
-------------------------------------------------------------------
Thu Nov 26 20:15:46 UTC 2020 - Jan Engelhardt <jengelh@inai.de>
- Do search /usr/sbin for mount helpers. (This drops /sbin/fs,
/sbin/fs.d, which we do not use in openSUSE.)
-------------------------------------------------------------------
Fri Nov 20 15:06:37 UTC 2020 - Ludwig Nussel <lnussel@suse.de>
- prepare usrmerge (boo#1029961)
-------------------------------------------------------------------
Wed Nov 4 11:07:03 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Modernize patch util-linux-sulogin4bsc1175514.patch
* Try to autoconfigure broken serial lines
-------------------------------------------------------------------
Fri Oct 30 14:03:47 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Add patch util-linux-sulogin4bsc1175514.patch
Avoid sulogin failing on not existing or not functional console
devices (bsc#1175514)
-------------------------------------------------------------------
Wed Sep 16 00:10:11 UTC 2020 - Stanislav Brabec <sbrabec@suse.com>
- Fix default permissions of wall and write.
- Update to version 2.36:
* blkdiscard(8) refuses to proceed if filesystem or RAID
signatures are found in interactive mode (executed on a
terminal). The option --force is required to the discard
data.
* new commands irqtop(1) and lsirq(1)to monitor kernel
interrupts.
* cal(1) provides a new --vertical command line option.
* blkzone(8) implements open/close/finish commands now.
* unshare(1) and nsenter(1) commands support the time namespace
now.
* agetty(8) now supports multiple paths in the option
--issue-file.
* fdisk(8), sfdisk(8), cfdisk(8), mkswap(8) and wipefs(8) now
support block devices locking by flock(2), new command line
option --lock and $LOCK_BLOCK_DEVICE environmental variable.
* dmesg(1) new command line option --follow-new to wait and
print only new kernel messages.
* fdisk(8) new command line option --list-details and
--noauto-pt.
* fdisk(8) and sfdisk(8) support user-friendly aliases for
partition types.
* fstrim(8) supports new command line option --listed-in.
* libfdisk provides API to relocate GPT backup header. New
command line option "sfdisk --relocate".
* mount(8) now supports mount by ID= tag.
* login(1) supports list of "message of the day".
* All tools which read /etc/login.defs is possible to compile
with libeconf now.
* more(1) has been refactored.
* man pages cleanup
* other fixes and improvements, see:
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.36/v2.36-ReleaseNotes
- Refresh Add-documentation-on-blacklisted-modules-to-mount-8-.patch.
- Drop upstreamed libeconf.patch,
libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch.
- util-linux-login_defs-check.sh: Perform all steps to integrate
MOTD_FIRSTONLY.
- Update baselibs.conf.
-------------------------------------------------------------------
Fri May 22 11:15:01 UTC 2020 - Fabian Vogt <fvogt@suse.com>
- Use plain #!/bin/sh for flushb
-------------------------------------------------------------------
Thu May 21 12:48:40 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Include pam_securetty in login.pamd again (bsc#1033626)
- Update to 2.35.2
* make glibc 2.31 compatible
- Dropped unneeded patch libfdisk-script-accept-sector-size.patch
-------------------------------------------------------------------
Wed May 13 10:19:22 UTC 2020 - Fabian Vogt <fvogt@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package util-linux
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -85,7 +85,10 @@ BuildRequires: binutils-devel
BuildRequires: fdupes
BuildRequires: gettext-devel
BuildRequires: libcap-ng-devel
# It should be %%if %%{defined no_config}, but OBS cannot handle it:
%if 0%{?suse_version} >= 1550
BuildRequires: libeconf-devel
%endif
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
BuildRequires: libtool
@ -122,10 +125,10 @@ BuildRequires: libmount-devel
%endif
%endif
#END SECOND STAGE DEPENDENCIES
Version: 2.35.1
Version: 2.36.1
Release: 0
URL: https://www.kernel.org/pub/linux/utils/util-linux/
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-%{version}.tar.xz
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-%{version}.tar.xz
Source1: util-linux-rpmlintrc
Source2: util-linux-login_defs-check.sh
Source4: raw.service
@ -136,7 +139,7 @@ Source8: login.pamd
Source9: remote.pamd
Source10: su.pamd
Source11: su.default
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-%{version}.tar.sign
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.36/util-linux-%{version}.tar.sign
Source13: %{_name}.keyring
Source14: runuser.pamd
Source15: runuser-l.pamd
@ -146,10 +149,8 @@ Source51: blkid.conf
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: libeconf.patch
Patch4: libmount-Avoid-triggering-autofs-in-lookup_umount_fs.patch
Patch5: libfdisk-script-accept-sector-size.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# PATCH-FIX-SUSE: Avoid sulogin failing on not existing or not functional console devices
Patch3: util-linux-sulogin4bsc1175514.patch
#
%if %build_util_linux
Supplements: filesystem(minix)
@ -179,12 +180,12 @@ Obsoletes: s390-32
Provides: s390-32
%endif
# uuid-runtime appeared in SLE11 SP1 to SLE11 SP3
Provides: uuid-runtime = %{version}-%{release}
Provides: uuid-runtime = %{version}
Obsoletes: uuid-runtime <= 2.19.1
# All login.defs variables require support from shadow side.
# Upgrade this symbol version only if new variables appear!
# Verify by shadow-login_defs-check.sh from shadow source package.
Requires: login_defs-support-for-util-linux >= 2.33.1
Requires: login_defs-support-for-util-linux >= 2.36
#
# Using "Requires" here would lend itself to help upgrading, but since
# util-linux is in the initial bootstrap, that is not a good thing to do:
@ -378,6 +379,7 @@ License: GPL-2.0-or-later
Group: System/Filesystems
%if 0%{?suse_version} >= 1330
Requires(pre): group(uuidd)
Requires(pre): user(uuidd)
%else
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
@ -550,11 +552,11 @@ AUTOPOINT=true autoreconf -vfi
--enable-static \
--disable-rpath \
--enable-all-programs \
--disable-reset \
--disable-chfn-chsh \
--disable-newgrp \
--disable-vipw \
--disable-pg \
--enable-fs-paths-default="/sbin:/usr/sbin" \
%if %{without enable_last}
--disable-last \
%endif
@ -574,7 +576,7 @@ AUTOPOINT=true autoreconf -vfi
%else
--without-python \
%endif
--enable-vendordir=%{_distconfdir}
--with-vendordir=%{_distconfdir}
#
# Safety check: HAVE_UUIDD should be always 1:
@ -637,7 +639,7 @@ install -m 644 runuser.default %{buildroot}%{_distconfdir}/default/runuser
%make_install
rm -f %{buildroot}%{python3_sitearch}/libmount/*.*a
%if %build_util_linux
#UsrMerge
%if !0%{?usrmerged}
ln -s %{_bindir}/kill %{buildroot}/bin
ln -s %{_bindir}/su %{buildroot}/bin
ln -s %{_bindir}/dmesg %{buildroot}/bin
@ -675,9 +677,9 @@ ln -s %{_sbindir}/fsfreeze %{buildroot}/sbin
ln -s %{_sbindir}/swaplabel %{buildroot}/sbin
ln -s %{_sbindir}/fstrim %{buildroot}/sbin
ln -s %{_sbindir}/chcpu %{buildroot}/sbin
#EndUsrMerge
%endif
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/filesystems
echo -e "#! /bin/bash\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb
echo -e "#!/bin/sh\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb
chmod 755 %{buildroot}%{_sbindir}/flushb
# Install scripts to configure raw devices at boot time
install -m 644 $RPM_SOURCE_DIR%{_sysconfdir}.raw %{buildroot}%{_sysconfdir}/raw
@ -688,16 +690,18 @@ ln -sf service %{buildroot}%{_sbindir}/rcraw
mv %{buildroot}%{_docdir}/%{_name}/getopt %{buildroot}%{_datadir}/
# Stupid hack so we don't have a tcsh dependency
chmod 644 %{buildroot}%{_datadir}/getopt/getopt*.tcsh
%if !0%{?usrmerged}
# login is always and only in /bin
mv %{buildroot}%{_bindir}/login %{buildroot}/bin/
%endif
# arch dependent
%ifarch s390 s390x
rm -f %{buildroot}%{_sysconfdir}/fdprm
rm -f %{buildroot}%{_sbindir}/fdformat
rm -f %{buildroot}%{_sbindir}/hwclock
#UsrMerge
%if !0%{?usrmerged}
rm -f %{buildroot}/sbin/hwclock
#EndUsrMerge
%endif
rm -f %{buildroot}%{_bindir}/setterm
rm -f %{buildroot}%{_sbindir}/tunelp
rm -f %{buildroot}%{_mandir}/man8/fdformat.8*
@ -708,19 +712,17 @@ rm -f %{buildroot}%{_mandir}/man8/tunelp.8*
rm -f %{buildroot}%{_mandir}/man8/cfdisk.8*
rm -f %{buildroot}%{_mandir}/man8/sfdisk.8*
rm -f %{buildroot}%{_sbindir}/cfdisk
#UsrMerge
rm -f %{buildroot}/sbin/cfdisk
#EndUsrMerge
rm -f %{buildroot}%{_sbindir}/sfdisk
#UsrMerge
%if !0%{?usrmerged}
rm -f %{buildroot}/sbin/cfdisk
rm -f %{buildroot}/sbin/sfdisk
#EndUsrMerge
%endif
%endif
%ifarch ia64 m68k
rm -f %{buildroot}%{_sbindir}/fdisk
#UsrMerge
%if !0%{?usrmerged}
rm -f %{buildroot}/sbin/fdisk
#EndUsrMerge
%endif
rm -f %{buildroot}%{_mandir}/man8/fdisk.8*
%endif
%find_lang %{name} %{name}.lang
@ -739,7 +741,9 @@ mkdir -p %{buildroot}/bin
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_localstatedir}/lib/libuuid
mkdir -p %{buildroot}/run/uuidd
%if !0%{?usrmerged}
ln -s %{_bindir}/logger %{buildroot}/bin
%endif
# clock.txt from uuidd is a ghost file
touch %{buildroot}%{_localstatedir}/lib/libuuid/clock.txt
ln -sf /sbin/service %{buildroot}/usr/sbin/rcuuidd
@ -763,6 +767,7 @@ done
%service_add_post raw.service
%set_permissions %{_bindir}/wall %{_bindir}/write %{_bindir}/mount %{_bindir}/umount
%set_permissions %{_bindir}/su
%if ! %{defined no_config}
#
# If outdated PAM file is detected, issue a warning.
for PAM_FILE in login remote runuser runuser-l su su-l ; do
@ -787,12 +792,15 @@ if ! grep -q "^# /etc/default/su is an override" %{_sysconfdir}/default/su ; the
echo "Please edit %{_sysconfdir}/login.defs or %{_sysconfdir}/default/su to restore your customization." >&2
fi
fi
%endif
%posttrans
%if %{defined no_config}
# Migration to /usr/etc.
for i in login remote runuser runuser-l su su-l; do
test -f /etc/pam.d/${i}.rpmsave && mv -v /etc/pam.d/${i}.rpmsave /etc/pam.d/${i} ||:
done
%endif
%preun
%service_del_preun raw.service
@ -898,7 +906,9 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_distconfdir}/pam.d/runuser-l
%{_distconfdir}/pam.d/su
%{_distconfdir}/pam.d/su-l
%{_distconfdir}/default
%if 0%{?suse_version} <= 1520
%dir %{_distconfdir}/default
%endif
%{_distconfdir}/default/runuser
%{_distconfdir}/default/su
%else
@ -912,7 +922,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%config(noreplace) %{_sysconfdir}/default/su
%endif
%config %dir %{_sysconfdir}/issue.d
#UsrMerge
%if !0%{?usrmerged}
/bin/kill
/bin/su
/bin/dmesg
@ -947,7 +957,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
/sbin/swaplabel
/sbin/fstrim
/sbin/chcpu
#EndUsrMerge
%endif
%{_bindir}/kill
%verify(not mode) %{_bindir}/su
%{_bindir}/eject
@ -971,6 +981,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_bindir}/ipcmk
%{_bindir}/ipcrm
%{_bindir}/ipcs
%{_bindir}/irqtop
%{_bindir}/isosize
%if %{with enable_last}
%{_bindir}/last
@ -978,9 +989,13 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%endif
%{_bindir}/line
%{_bindir}/look
%if 0%{?usrmerged}
%{_bindir}/login
%endif
%{_bindir}/lsblk
%{_bindir}/lscpu
%{_bindir}/lsipc
%{_bindir}/lsirq
%{_bindir}/lslocks
%{_bindir}/lsmem
%{_bindir}/lsns
@ -1082,6 +1097,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_mandir}/man1/look.1.gz
%{_mandir}/man1/lscpu.1.gz
%{_mandir}/man1/lsipc.1.gz
%{_mandir}/man1/lsirq.1.gz
%{_mandir}/man1/lsmem.1.gz
%{_mandir}/man1/mcookie.1.gz
%{_mandir}/man1/mesg.1.gz
@ -1089,6 +1105,7 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%{_mandir}/man1/namei.1.gz
%{_mandir}/man1/nsenter.1.gz
%{_mandir}/man1/ionice.1.gz
%{_mandir}/man1/irqtop.1.gz
%{_mandir}/man1/prlimit.1.gz
%{_mandir}/man1/rename.1.gz
%{_mandir}/man1/rev.1.gz
@ -1182,27 +1199,27 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%ifnarch ia64 m68k
#XXX: post our patches upstream
#XXX: call fdupes on /usr/share/man
#UsrMerge
%if !0%{?usrmerged}
/sbin/fdisk
#EndUsrMerge
%endif
%{_sbindir}/fdisk
%{_mandir}/man8/fdisk.8.gz
%endif
%ifnarch %sparc ia64 m68k
%{_mandir}/man8/cfdisk.8.gz
%{_mandir}/man8/sfdisk.8.gz
#UsrMerge
%if !0%{?usrmerged}
/sbin/cfdisk
/sbin/sfdisk
#EndUsrMerge
%endif
%{_sbindir}/cfdisk
%{_sbindir}/sfdisk
%endif
%ifnarch s390 s390x
%{_sbindir}/fdformat
#UsrMerge
%if !0%{?usrmerged}
/sbin/hwclock
#EndUsrMerge
%endif
%{_sbindir}/hwclock
%{_bindir}/setterm
%{_sbindir}/tunelp
@ -1301,7 +1318,9 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || :
%files
%endif
%defattr(-, root, root)
%if !0%{?usrmerged}
/bin/logger
%endif
%{_bindir}/logger
%{_bindir}/lslogins
#BEGIN bootstrap_hack