summaryrefslogtreecommitdiff
path: root/sys-apps/util-linux/files
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/util-linux/files')
-rw-r--r--sys-apps/util-linux/files/util-linux-2.35.1-hwclock-glibc-2.31.patch165
-rw-r--r--sys-apps/util-linux/files/util-linux-2.35.1-include_sys_types-header.patch58
-rw-r--r--sys-apps/util-linux/files/util-linux-2.36.1-libmount_dont_use_symfollow.patch40
3 files changed, 40 insertions, 223 deletions
diff --git a/sys-apps/util-linux/files/util-linux-2.35.1-hwclock-glibc-2.31.patch b/sys-apps/util-linux/files/util-linux-2.35.1-hwclock-glibc-2.31.patch
deleted file mode 100644
index c8b5cf76a23c..000000000000
--- a/sys-apps/util-linux/files/util-linux-2.35.1-hwclock-glibc-2.31.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-From cd781c405be82540484da3bfe3d3f17a39b8eb5c Mon Sep 17 00:00:00 2001
-From: J William Piggott <elseifthen@gmx.com>
-Date: Fri, 21 Feb 2020 20:03:47 -0500
-Subject: hwclock: make glibc 2.31 compatible
-
-______________________________________________________
-GNU C Library NEWS -- history of user-visible changes.
-Version 2.31
-Deprecated and removed features, and other changes affecting compatibility:
-
-* The settimeofday function can still be used to set a system-wide time
- zone when the operating system supports it. This is because the Linux
- kernel reused the API, on some architectures, to describe a system-wide
- time-zone-like offset between the software clock maintained by the kernel,
- and the "RTC" clock that keeps time when the system is shut down.
-
- However, to reduce the odds of this offset being set by accident,
- settimeofday can no longer be used to set the time and the offset
- simultaneously. If both of its two arguments are non-null, the call
- will fail (setting errno to EINVAL).
-
- Callers attempting to set this offset should also be prepared for the call
- to fail and set errno to ENOSYS; this already happens on the Hurd and on
- some Linux architectures. The Linux kernel maintainers are discussing a
- more principled replacement for the reused API. After a replacement
- becomes available, we will change settimeofday to fail with ENOSYS on all
- platforms when its 'tzp' argument is not a null pointer.
-
- settimeofday itself is obsolescent according to POSIX. Programs that set
- the system time should use clock_settime and/or the adjtime family of
- functions instead. We may cease to make settimeofday available to newly
- linked binaries after there is a replacement for Linux's time-zone-like
- offset API.
-______________________________________________________
-
-hwclock(8) had one settimeofday(2) call where both args were set for
---hctosys when the RTC was ticking UTC. This allowed setting the system
-time, timezone, and locking the warp_clock function with a single call.
-That operation now takes 3 calls of settimeofday(2).
-
-Although this common operation now takes three calls, the overall logic
-for the set_system_clock() function was simplified.
-
-Co-Author: Karel Zak <kzak@redhat.com>
-Signed-off-by: J William Piggott <elseifthen@gmx.com>
----
- sys-utils/hwclock.c | 71 ++++++++++++++++++++++++++++-------------------------
- 1 file changed, 37 insertions(+), 34 deletions(-)
-
-diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
-index e736da717..1191a8571 100644
---- a/sys-utils/hwclock.c
-+++ b/sys-utils/hwclock.c
-@@ -643,28 +643,28 @@ display_time(struct timeval hwctime)
- * tz.tz_minuteswest argument and sets PCIL (see below). At boot settimeofday(2)
- * has one-shot access to this function as shown in the table below.
- *
-- * +-------------------------------------------------------------------+
-- * | settimeofday(tv, tz) |
-- * |-------------------------------------------------------------------|
-- * | Arguments | System Time | PCIL | | warp_clock |
-- * | tv | tz | set | warped | set | firsttime | locked |
-- * |---------|---------|---------------|------|-----------|------------|
-- * | pointer | NULL | yes | no | no | 1 | no |
-- * | pointer | pointer | yes | no | no | 0 | yes |
-- * | NULL | ptr2utc | no | no | no | 0 | yes |
-- * | NULL | pointer | no | yes | yes | 0 | yes |
-- * +-------------------------------------------------------------------+
-+ * +-------------------------------------------------------------------------+
-+ * | settimeofday(tv, tz) |
-+ * |-------------------------------------------------------------------------|
-+ * | Arguments | System Time | TZ | PCIL | | warp_clock |
-+ * | tv | tz | set | warped | set | set | firsttime | locked |
-+ * |---------|---------|---------------|-----|------|-----------|------------|
-+ * | pointer | NULL | yes | no | no | no | 1 | no |
-+ * | NULL | ptr2utc | no | no | yes | no | 0 | yes |
-+ * | NULL | pointer | no | yes | yes | yes | 0 | yes |
-+ * +-------------------------------------------------------------------------+
- * ptr2utc: tz.tz_minuteswest is zero (UTC).
- * PCIL: persistent_clock_is_local, sets the "11 minute mode" timescale.
- * firsttime: locks the warp_clock function (initialized to 1 at boot).
-+ * Since glibc v2.31 settimeofday() will fail if both args are non NULL
- *
- * +---------------------------------------------------------------------------+
- * | op | RTC scale | settimeofday calls |
- * |---------|-----------|-----------------------------------------------------|
- * | systz | Local | 1) warps system time*, sets PCIL* and kernel tz |
- * | systz | UTC | 1st) locks warp_clock* 2nd) sets kernel tz |
-- * | hctosys | Local | 1st) sets PCIL* 2nd) sets system time and kernel tz |
-- * | hctosys | UTC | 1) sets system time and kernel tz |
-+ * | hctosys | Local | 1st) sets PCIL* & kernel tz 2nd) sets system time |
-+ * | hctosys | UTC | 1st) locks warp* 2nd) sets tz 3rd) sets system time |
- * +---------------------------------------------------------------------------+
- * * only on first call after boot
- */
-@@ -675,42 +675,45 @@ set_system_clock(const struct hwclock_control *ctl,
- struct tm broken;
- int minuteswest;
- int rc = 0;
-- const struct timezone tz_utc = { 0 };
-
- localtime_r(&newtime.tv_sec, &broken);
- minuteswest = -get_gmtoff(&broken) / 60;
-
- if (ctl->verbose) {
-- if (ctl->hctosys && !ctl->universal)
-- printf(_("Calling settimeofday(NULL, %d) to set "
-- "persistent_clock_is_local.\n"), minuteswest);
-- if (ctl->systz && ctl->universal)
-+ if (ctl->universal) {
- puts(_("Calling settimeofday(NULL, 0) "
-- "to lock the warp function."));
-+ "to lock the warp_clock function."));
-+ if (!( ctl->universal && !minuteswest ))
-+ printf(_("Calling settimeofday(NULL, %d) "
-+ "to set the kernel timezone.\n"),
-+ minuteswest);
-+ } else
-+ printf(_("Calling settimeofday(NULL, %d) to warp "
-+ "System time, set PCIL and the kernel tz.\n"),
-+ minuteswest);
-+
- if (ctl->hctosys)
-- printf(_("Calling settimeofday(%ld.%06ld, %d)\n"),
-- newtime.tv_sec, newtime.tv_usec, minuteswest);
-- else {
-- printf(_("Calling settimeofday(NULL, %d) "), minuteswest);
-- if (ctl->universal)
-- puts(_("to set the kernel timezone."));
-- else
-- puts(_("to warp System time."));
-- }
-+ printf(_("Calling settimeofday(%ld.%06ld, NULL) "
-+ "to set the System time.\n"),
-+ newtime.tv_sec, newtime.tv_usec);
- }
-
- if (!ctl->testing) {
-+ const struct timezone tz_utc = { 0 };
- const struct timezone tz = { minuteswest };
-
-- if (ctl->hctosys && !ctl->universal) /* set PCIL */
-- rc = settimeofday(NULL, &tz);
-- if (ctl->systz && ctl->universal) /* lock warp_clock */
-+ /* If UTC RTC: lock warp_clock and PCIL */
-+ if (ctl->universal)
- rc = settimeofday(NULL, &tz_utc);
-- if (!rc && ctl->hctosys)
-- rc = settimeofday(&newtime, &tz);
-- else if (!rc)
-+
-+ /* Set kernel tz; if localtime RTC: warp_clock and set PCIL */
-+ if (!rc && !( ctl->universal && !minuteswest ))
- rc = settimeofday(NULL, &tz);
-
-+ /* Set the System Clock */
-+ if ((!rc || errno == ENOSYS) && ctl->hctosys)
-+ rc = settimeofday(&newtime, NULL);
-+
- if (rc) {
- warn(_("settimeofday() failed"));
- return EXIT_FAILURE;
---
-cgit 1.2-0.3.lf.el7
-
diff --git a/sys-apps/util-linux/files/util-linux-2.35.1-include_sys_types-header.patch b/sys-apps/util-linux/files/util-linux-2.35.1-include_sys_types-header.patch
deleted file mode 100644
index 8c646ee73a9d..000000000000
--- a/sys-apps/util-linux/files/util-linux-2.35.1-include_sys_types-header.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 3cfde0370d3a8949df0c5bcf447cec6692910ed2 Mon Sep 17 00:00:00 2001
-From: Sami Kerola <kerolasa@iki.fi>
-Date: Sat, 15 Feb 2020 21:12:50 +0000
-Subject: [PATCH] kill: include sys/types.h before checking
- SYS_pidfd_send_signal
-
-Including sys/types.h must happen before SYS_pidfd_send_signal is checked,
-because that header defines variable in normal conditions. When sys/types.h
-does not have SYS_pidfd_send_signal then fallback is defined in config.h
-that is included by default, and has therefore worked fine before and after
-this change.
-
-Signed-off-by: Sami Kerola <kerolasa@iki.fi>
----
- include/pidfd-utils.h | 18 ++++++++++--------
- 1 file changed, 10 insertions(+), 8 deletions(-)
-
-diff --git a/include/pidfd-utils.h b/include/pidfd-utils.h
-index 593346576..0baedd2c9 100644
---- a/include/pidfd-utils.h
-+++ b/include/pidfd-utils.h
-@@ -1,26 +1,28 @@
- #ifndef UTIL_LINUX_PIDFD_UTILS
- #define UTIL_LINUX_PIDFD_UTILS
-
--#if defined(__linux__) && defined(SYS_pidfd_send_signal)
--# include <sys/types.h>
-+#if defined(__linux__)
- # include <sys/syscall.h>
-+# if defined(SYS_pidfd_send_signal)
-+# include <sys/types.h>
-
--# ifndef HAVE_PIDFD_OPEN
-+# ifndef HAVE_PIDFD_OPEN
- static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
- unsigned int flags)
- {
- return syscall(SYS_pidfd_send_signal, pidfd, sig, info, flags);
- }
--# endif
-+# endif
-
--# ifndef HAVE_PIDFD_SEND_SIGNAL
-+# ifndef HAVE_PIDFD_SEND_SIGNAL
- static inline int pidfd_open(pid_t pid, unsigned int flags)
- {
- return syscall(SYS_pidfd_open, pid, flags);
- }
--# endif
-+# endif
-
--# define UL_HAVE_PIDFD 1
-+# define UL_HAVE_PIDFD 1
-
--#endif /* __linux__ && SYS_pidfd_send_signal */
-+# endif /* SYS_pidfd_send_signal */
-+#endif /* __linux__ */
- #endif /* UTIL_LINUX_PIDFD_UTILS */
diff --git a/sys-apps/util-linux/files/util-linux-2.36.1-libmount_dont_use_symfollow.patch b/sys-apps/util-linux/files/util-linux-2.36.1-libmount_dont_use_symfollow.patch
new file mode 100644
index 000000000000..7c0b73f49d78
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.36.1-libmount_dont_use_symfollow.patch
@@ -0,0 +1,40 @@
+From 76bb9b30cfcf54b59591a57a3d2a747e514469b2 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Thu, 19 Nov 2020 09:49:16 +0100
+Subject: [PATCH] libmount: don't use "symfollow" for helpers on user mounts
+
+Addresses: https://github.com/karelzak/util-linux/issues/1193
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ libmount/src/context_mount.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
+index 8c394c1ff..dd1786176 100644
+--- a/libmount/src/context_mount.c
++++ b/libmount/src/context_mount.c
+@@ -415,6 +415,9 @@ static int generate_helper_optstr(struct libmnt_context *cxt, char **optstr)
+ * string, because there is nothing like MS_EXEC (we only have
+ * MS_NOEXEC in mount flags and we don't care about the original
+ * mount string in libmount for VFS options).
++ *
++ * This use-case makes sense for MS_SECURE flags only (see
++ * mnt_optstr_get_flags() and mnt_context_merge_mflags()).
+ */
+ if (!(cxt->mountflags & MS_NOEXEC))
+ mnt_optstr_append_option(optstr, "exec", NULL);
+@@ -422,11 +425,8 @@ static int generate_helper_optstr(struct libmnt_context *cxt, char **optstr)
+ mnt_optstr_append_option(optstr, "suid", NULL);
+ if (!(cxt->mountflags & MS_NODEV))
+ mnt_optstr_append_option(optstr, "dev", NULL);
+- if (!(cxt->mountflags & MS_NOSYMFOLLOW))
+- mnt_optstr_append_option(optstr, "symfollow", NULL);
+ }
+
+-
+ if (cxt->flags & MNT_FL_SAVED_USER)
+ rc = mnt_optstr_set_option(optstr, "user", cxt->orig_user);
+ if (rc)
+--
+2.29.2
+