fix requirement for liblastlog2 [release 2.40-2mamba;Wed Apr 03 2024]

This commit is contained in:
Silvan Calarco 2024-04-04 18:48:34 +02:00
parent 3c7b1b683c
commit 9a19af60df
6 changed files with 47 additions and 297 deletions

View File

@ -1,18 +0,0 @@
--- a/login-utils/su.c.badpaths Tue Apr 05 14:26:55 2005
+++ b/login-utils/su.c Tue Apr 05 14:40:21 EDT 2005
@@ -147,6 +147,15 @@
#define DEFAULT_ROOT_LOGIN_PATH "/usr/ucb:/bin:/usr/bin:/etc"
#endif
+/* The default paths which get set are both bogus and oddly influenced
+ by <paths.h> and -D on the commands line. Just to be clear, we'll set
+ these explicitly. -ewt */
+#undef DEFAULT_LOGIN_PATH
+#undef DEFAULT_ROOT_LOGIN_PATH
+#define DEFAULT_LOGIN_PATH "/bin:/usr/bin:/usr/local/bin"
+#define DEFAULT_ROOT_LOGIN_PATH \
+ "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
+
/* The shell to run if none is given in the user's passwd entry. */
#define DEFAULT_SHELL "/bin/sh"

View File

@ -1,82 +0,0 @@
From 73b193f8da0437d1b399903cf0f8e4c827adc03c Mon Sep 17 00:00:00 2001
From: Mattias Nissler <mnissler@chromium.org>
Date: Thu, 17 Nov 2016 14:47:51 +0100
Subject: [PATCH] mount: Add support for "nosymfollow" mount option.
This adds support for the "nosymfollow" mount option, which indicates
that symlinks should not be traversed on the mount this option is
applied to. Also update the mount(8) man page with information about
this option.
Signed-off-by: Mattias Nissler <mnissler@chromium.org>
Signed-off-by: Ross Zwisler <zwisler@google.com>
---
libmount/src/context_mount.c | 2 ++
libmount/src/libmount.h.in | 3 +++
libmount/src/optmap.c | 4 ++++
sys-utils/mount.8 | 10 ++++++++++
4 files changed, 19 insertions(+)
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index e0ef550b0..8c394c1ff 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -422,6 +422,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);
}
diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in
index 321c0540b..e6710ae01 100644
--- a/libmount/src/libmount.h.in
+++ b/libmount/src/libmount.h.in
@@ -941,6 +941,9 @@ extern int mnt_context_set_syscall_status(struct libmnt_context *cxt, int status
#ifndef MS_DIRSYNC
#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
#endif
+#ifndef MS_NOSYMFOLLOW
+#define MS_NOSYMFOLLOW 256 /* Don't follow symlinks */
+#endif
#ifndef MS_NOATIME
#define MS_NOATIME 0x400 /* 1024: Do not update access times. */
#endif
diff --git a/libmount/src/optmap.c b/libmount/src/optmap.c
index a080d8df6..49e8113d2 100644
--- a/libmount/src/optmap.c
+++ b/libmount/src/optmap.c
@@ -131,6 +131,10 @@ static const struct libmnt_optmap linux_flags_map[] =
{ "rslave", MS_SLAVE | MS_REC, MNT_NOHLPS | MNT_NOMTAB },
{ "shared", MS_SHARED, MNT_NOHLPS | MNT_NOMTAB }, /* Shared */
{ "rshared", MS_SHARED | MS_REC, MNT_NOHLPS | MNT_NOMTAB },
+#endif
+#ifdef MS_NOSYMFOLLOW
+ { "symfollow", MS_NOSYMFOLLOW, MNT_INVERT }, /* Don't follow symlinks */
+ { "nosymfollow", MS_NOSYMFOLLOW },
#endif
{ NULL, 0, 0 }
};
diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index d633d25a4..d5fa55f43 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -1472,6 +1472,16 @@ specifies the filesystem access mode used for
in octal notation. The default mode is 0755. This functionality is supported
only for root users or when mount executed without suid permissions. The option
is also supported as x-mount.mkdir, this notation is deprecated since v2.30.
+.TP
+.B nosymfollow
+Do not follow symlinks when resolving paths. Symlinks can still be created,
+and
+.BR readlink (1),
+.BR readlink (2),
+.BR realpath (1)
+and
+.BR realpath (3)
+all still work properly.
.SH FILESYSTEM-SPECIFIC MOUNT OPTIONS
This section lists options that are specific to particular filesystems.

View File

@ -1,82 +0,0 @@
From f94a7760ed7ce81389a6059f020238981627a70d Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 25 May 2023 11:48:24 +0200
Subject: [PATCH] libmount: don't call hooks after mount.<type> helper
In case more filesystems are specified (or when libmount follows
/{etc,proc}/filesystems) then the library may try to use and
initialize the new API because for some filesystems, we need
exec(/sbin/mount.<type>) and for another fsopen().
The hooks that use the API have to smart and detect that the mount
operation was done in external /sbin/mount.<type> helper. And in this
case, the new API file descriptors must be ignored.
The exception is propagation flags, mount(8) can set the flags after
exec(/sbin/mount.<type>), for example, "mount -t ntfs --make-private".
Fixes: https://github.com/util-linux/util-linux/issues/2267
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libmount/src/context_mount.c | 2 ++
libmount/src/hook_mount.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index cbb4f1fdfa..40f9ed0733 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -508,6 +508,8 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
+ mnt_context_reset_status(cxt);
+
if (try_type) {
rc = mnt_context_prepare_helper(cxt, "mount", try_type);
if (rc)
diff --git a/libmount/src/hook_mount.c b/libmount/src/hook_mount.c
index 924c714448..91483afa68 100644
--- a/libmount/src/hook_mount.c
+++ b/libmount/src/hook_mount.c
@@ -239,6 +239,10 @@ static int hook_create_mount(struct libmnt_context *cxt,
int rc = 0;
assert(cxt);
+
+ if (mnt_context_helper_executed(cxt))
+ return 0;
+
assert(cxt->fs);
api = get_sysapi(cxt);
@@ -309,6 +313,9 @@ static int hook_reconfigure_mount(struct libmnt_context *cxt,
assert(cxt);
+ if (mnt_context_helper_executed(cxt))
+ return 0;
+
api = get_sysapi(cxt);
assert(api);
assert(api->fd_tree >= 0);
@@ -379,6 +386,9 @@ static int hook_set_vfsflags(struct libmnt_context *cxt,
uint64_t set = 0, clr = 0;
int rc = 0;
+ if (mnt_context_helper_executed(cxt))
+ return 0;
+
DBG(HOOK, ul_debugobj(hs, "setting VFS flags"));
ol = mnt_context_get_optlist(cxt);
@@ -471,6 +481,9 @@ static int hook_attach_target(struct libmnt_context *cxt,
const char *target;
int rc = 0;
+ if (mnt_context_helper_executed(cxt))
+ return 0;
+
target = mnt_fs_get_target(cxt->fs);
if (!target)
return -EINVAL;

View File

@ -1,50 +0,0 @@
diff -pur util-linux-2.12q/hwclock/hwclock.c util-linux-2.12q-fix/hwclock/hwclock.c
--- util-linux-2.12q/hwclock/hwclock.c 2004-12-15 20:13:48.000000000 +0100
+++ util-linux-2.12q-fix/hwclock/hwclock.c 2005-09-20 10:27:49.000000000 +0200
@@ -45,7 +45,7 @@
* reading '/etc/clock -au' instead of '/etc/clock -u -s', this error
* is automatically corrected at every boot.
*
- * To do this job, the program reads and writes the file '/etc/adjtime'
+ * To do this job, the program reads and writes the file '/var/lib/hwclock/adjtime'
* to determine the correction, and to save its data. In this file are
* three numbers:
*
@@ -58,13 +58,13 @@
*
* Installation and use of this program:
*
- * a) create a file '/etc/adjtime' containing as the first and only line:
+ * a) create a file '/var/lib/hwclock/adjtime' containing as the first and only line:
* '0.0 0 0.0'
* b) run 'clock -au' or 'clock -a', depending on whether your cmos is in
* universal or local time. This updates the second number.
* c) set your system time using the 'date' command.
* d) update your cmos time using 'clock -wu' or 'clock -w'
- * e) replace the first number in /etc/adjtime by your correction.
+ * e) replace the first number in /var/lib/hwclock/adjtime by your correction.
* f) put the command 'clock -au' or 'clock -a' in your '/etc/rc.local'
*/
@@ -96,7 +96,7 @@ struct clock_ops *ur;
#define FLOOR(arg) ((arg >= 0 ? (int) arg : ((int) arg) - 1));
/* Here the information for time adjustments is kept. */
-#define ADJPATH "/etc/adjtime"
+#define ADJPATH "/var/lib/hwclock/adjtime"
/* Store the date here when "badyear" flag is set. */
#define LASTDATE "/var/lib/lastdate"
@@ -231,10 +231,10 @@ hw_clock_is_utc(const bool utc, const bo
static int
read_adjtime(struct adjtime *adjtime_p) {
/*----------------------------------------------------------------------------
- Read the adjustment parameters out of the /etc/adjtime file.
+ Read the adjustment parameters out of the /var/lib/hwclock/adjtime file.
Return them as the adjtime structure <*adjtime_p>.
- If there is no /etc/adjtime file, return defaults.
+ If there is no /var/lib/hwclock/adjtime file, return defaults.
If values are missing from the file, return defaults for them.
return value 0 if all OK, !=0 otherwise.

View File

@ -1,12 +0,0 @@
diff -Nru util-linux-ng-2.15/libs/blkid/src/probers/reiserfs.c util-linux-ng-2.15.patched/libs/blkid/src/probers/reiserfs.c
--- util-linux-ng-2.15/libs/blkid/src/probers/reiserfs.c 2009-03-25 13:20:17.000000000 +0100
+++ util-linux-ng-2.15.patched/libs/blkid/src/probers/reiserfs.c 2009-05-20 02:42:54.000000000 +0200
@@ -95,7 +95,7 @@
const struct blkid_idinfo reiser_idinfo =
{
- .name = "reiser",
+ .name = "reiserfs",
.usage = BLKID_USAGE_FILESYSTEM,
.probefunc = probe_reiser,
.magics =

View File

@ -1,14 +1,11 @@
%define majorminor %(echo %version | cut -d. -f 1-2) %define majorminor %(echo %version | cut -d. -f 1-2)
# '/bin/raw' is deprecated (applications needing raw device access
# should open regular block devices with O_DIRECT)
%define build_raw 1
%define uuidd_groupid 65052 %define uuidd_groupid 65052
%define uuidd_userid 65052 %define uuidd_userid 65052
Name: util-linux Name: util-linux
Version: 2.39.3 Version: 2.40
Release: 1mamba Release: 2mamba
Epoch: 1 Epoch: 1
Summary: Miscellaneous utilities for Linux Summary: Miscellaneous utilities for Linux
Group: System/Tools Group: System/Tools
@ -30,12 +27,7 @@ Source10: util-linux-pam-runuser-l
Source11: util-linux-pam-remote Source11: util-linux-pam-remote
Source12: util-linux-pam-chfn Source12: util-linux-pam-chfn
Source13: util-linux-pam-chsh Source13: util-linux-pam-chsh
Patch0: %{name}-ng-2.12q-adjtime_path.patch
Patch1: %{name}-ng-2.15-reiserfs_fix_name.patch
Patch2: util-linux-2.22-su_paths.patch
Patch3: util-linux-2.34-blkid-pkgconfig-add-uuid.patch Patch3: util-linux-2.34-blkid-pkgconfig-add-uuid.patch
Patch4: util-linux-2.36.1-revert-add-nosymfollow.patch
Patch5: util-linux-2.39-upstream-libmount_dont_call_hooks_after_mount.patch
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
@ -46,6 +38,7 @@ BuildRequires: libpam-devel
BuildRequires: libpython311-devel BuildRequires: libpython311-devel
BuildRequires: libreadline-devel BuildRequires: libreadline-devel
BuildRequires: libselinux-devel BuildRequires: libselinux-devel
BuildRequires: libsqlite-devel
BuildRequires: libsystemd-devel BuildRequires: libsystemd-devel
BuildRequires: libudev-devel BuildRequires: libudev-devel
BuildRequires: libxcrypt-devel BuildRequires: libxcrypt-devel
@ -70,6 +63,7 @@ Provides: eject
Obsoletes: eject < 1:2.37 Obsoletes: eject < 1:2.37
Provides: schedutils Provides: schedutils
Obsoletes: schedutils < 1:2.37 Obsoletes: schedutils < 1:2.37
#Requires: liblastlog2 = %{?epoch:%epoch:}%{version}-%{release}
Requires: libuuid = %{?epoch:%epoch:}%{version}-%{release} Requires: libuuid = %{?epoch:%epoch:}%{version}-%{release}
Requires: libblkid = %{?epoch:%epoch:}%{version}-%{release} Requires: libblkid = %{?epoch:%epoch:}%{version}-%{release}
Requires: libmount = %{?epoch:%epoch:}%{version}-%{release} Requires: libmount = %{?epoch:%epoch:}%{version}-%{release}
@ -151,6 +145,22 @@ Requires: libuuid = %{?epoch:%epoch:}%{version}-%{release}
Universal unique id library. Universal unique id library.
This package provides the development file for application which use libuuid. This package provides the development file for application which use libuuid.
%package -n liblastlog2
Summary: Last log library
Group: System/Libraries
%description -n liblastlog2
Last log library.
%package -n liblastlog2-devel
Summary: The development file for application which use liblastlog2
Group: Development/Libraries
Requires: liblastlog2 = %{?epoch:%epoch:}%{version}-%{release}
%description -n liblastlog2-devel
Last log library.
This package provides the development file for application which use libuuid.
%package -n libmount %package -n libmount
Summary: Mount library Summary: Mount library
Group: System/Libraries Group: System/Libraries
@ -202,6 +212,7 @@ Requires: libmount = %{?epoch:%epoch:}%{version}-%{release}
%description -n python-libmount %description -n python-libmount
Python binding to libmount. Python binding to libmount.
%debug_package %debug_package
%prep %prep
@ -209,10 +220,6 @@ Python binding to libmount.
#-D -T #-D -T
#:<< _EOF #:<< _EOF
%patch 3 -p1 %patch 3 -p1
#%patch4 -p1 -R
#%patch 5 -p1 -b .upstream-libmount_dont_call_hooks_after_mount
#cp %{S:1} nologin.c
%build %build
#:<< _EOF #:<< _EOF
@ -234,44 +241,12 @@ Python binding to libmount.
--with-ncursesw \ --with-ncursesw \
PYTHON=%{__python3} PYTHON=%{__python3}
# --disable-login-utils \
# --libdir=/%{_lib} \
%make CC="%{_target_platform}-gcc -std=gnu99" READLINE_LIBS="-lreadline -lncurses" %make CC="%{_target_platform}-gcc -std=gnu99" READLINE_LIBS="-lreadline -lncurses"
## build nologin
#%{_target_platform}-gcc %{optflags} -o nologin nologin.c
%install %install
[ "%{buildroot}" != / ] && rm -rf %{buildroot} [ "%{buildroot}" != / ] && rm -rf %{buildroot}
#install -d %{buildroot}/var/lib/hwclock
%makeinstall %makeinstall
# note: versions <=2.12 use path "%{_datadir}/misc/getopt/*"
#install -d %{buildroot}%{_datadir}/misc/getopt/
#mv %{buildroot}%{_datadir}/getopt/* \
# %{buildroot}%{_datadir}/misc/getopt/
## note: do not install tcsh scripts to avoid dependencies on tcsh
#rm %{buildroot}%{_datadir}/misc/getopt/getopt-parse.tcsh
## fix some wrong paths
#install -d %{buildroot}/sbin
#for f in addpart delpart partx; do
# mv %{buildroot}%{_sbindir}/$f %{buildroot}/sbin/$f
#done
#install -d %{buildroot}/bin
#%if %{build_raw}
##mv %{buildroot}/sbin/raw %{buildroot}/bin/raw
#install -D -m644 %{S:3} %{buildroot}%{_sysconfdir}/udev/rules.d/60-raw.rules
#echo '.so man8/raw.8' > %{buildroot}%{_mandir}/man8/rawdevices.8
#%endif
#mv %{buildroot}%{_bindir}/taskset %{buildroot}/bin/taskset
## install nologin
#install -D -m 755 nologin %{buildroot}%{_sbindir}/nologin
#install -D -m 644 %{S:2} %{buildroot}%{_mandir}/man8/nologin.8
rm -f %{buildroot}%{_mandir}/*/man*/{kill,newgrp,vigr,vipw}.* rm -f %{buildroot}%{_mandir}/*/man*/{kill,newgrp,vigr,vipw}.*
%find_lang %{name} --with-man --all-name %find_lang %{name} --with-man --all-name
@ -346,15 +321,15 @@ exit 0
%config %{_sysconfdir}/login.defs %config %{_sysconfdir}/login.defs
%{_bindir}/* %{_bindir}/*
%{_sbindir}/* %{_sbindir}/*
#%if %{build_raw}
#%config(noreplace) %{_sysconfdir}/udev/rules.d/60-raw.rules
#%endif
%attr(4755,root,root) %{_bindir}/mount %attr(4755,root,root) %{_bindir}/mount
%attr(4755,root,root) %{_bindir}/umount %attr(4755,root,root) %{_bindir}/umount
%{_unitdir}/lastlog2-import.service
%{_unitdir}/uuidd.service %{_unitdir}/uuidd.service
%{_unitdir}/uuidd.socket %{_unitdir}/uuidd.socket
%{_unitdir}/fstrim.service %{_unitdir}/fstrim.service
%{_unitdir}/fstrim.timer %{_unitdir}/fstrim.timer
%{_tmpfilesdir}/lastlog2-tmpfiles.conf
%{_tmpfilesdir}/uuidd-tmpfiles.conf
%{_datadir}/bash-completion/completions/* %{_datadir}/bash-completion/completions/*
%dir %{_localstatedir}/uuid %dir %{_localstatedir}/uuid
%dir %{_localstatedir}/lib/libuuid %dir %{_localstatedir}/lib/libuuid
@ -363,10 +338,8 @@ exit 0
%{_mandir}/man5/adjtime_config.5* %{_mandir}/man5/adjtime_config.5*
%{_mandir}/man5/fstab.* %{_mandir}/man5/fstab.*
%{_mandir}/man5/terminal-colors.d.5* %{_mandir}/man5/terminal-colors.d.5*
%{_mandir}/man5/scols-filter.5*
%{_mandir}/man8/* %{_mandir}/man8/*
#%{_infodir}/ipc.info.*
#%lang(ru) %{_mandir}/ru/man1/ddate.*
#%dir /var/lib/hwclock
%dir %{_docdir}/util-linux %dir %{_docdir}/util-linux
%{_docdir}/util-linux/getopt-example.bash %{_docdir}/util-linux/getopt-example.bash
%{_docdir}/util-linux/getopt-example.tcsh %{_docdir}/util-linux/getopt-example.tcsh
@ -430,7 +403,7 @@ exit 0
%files -n libfdisk %files -n libfdisk
%defattr(-,root,root) %defattr(-,root,root)
/%{_libdir}/libfdisk.so.* %{_libdir}/libfdisk.so.*
%files -n libfdisk-devel %files -n libfdisk-devel
%defattr(-,root,root) %defattr(-,root,root)
@ -440,7 +413,28 @@ exit 0
%{_libdir}/libfdisk.so %{_libdir}/libfdisk.so
%{_libdir}/pkgconfig/fdisk.pc %{_libdir}/pkgconfig/fdisk.pc
%files -n liblastlog2
%defattr(-,root,root)
%{_libdir}/liblastlog2.so.*
%{_pam_moduledir}/pam_lastlog2.so
%files -n liblastlog2-devel
%defattr(-,root,root)
%dir %{_includedir}/liblastlog2
%{_includedir}/liblastlog2/lastlog2.h
%{_libdir}/liblastlog2.a
%{_libdir}/liblastlog2.so
%{_mandir}/man3/lastlog2.3*
%{_mandir}/man3/ll2_*.3*
%{_libdir}/pkgconfig/lastlog2.pc
%changelog %changelog
* Wed Apr 03 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 2.40-2mamba
- fix requirement for liblastlog2
* Fri Mar 29 2024 Automatic Build System <autodist@openmamba.org> 2.40-1mamba
- automatic version update by autodist
* Tue Dec 05 2023 Automatic Build System <autodist@mambasoft.it> 2.39.3-1mamba * Tue Dec 05 2023 Automatic Build System <autodist@mambasoft.it> 2.39.3-1mamba
- automatic version update by autodist - automatic version update by autodist