commit fbf36f5502feda47ac75bc372be6b461a17bd3567bf8d89b83d112c529daf706 Author: Thorsten Kukuk Date: Mon Jan 27 07:32:32 2025 +0000 - Update to version 0.70.0+git20250121.3e409b5: * Fix installation of all wtmpdbd man page variants * Release version 0.70.0 * Add wtmpdbd.8 manual page * wtmpdbd: fix printing help text * wtmpdbd: more fine granular log level filtering * wtmpdbd: implement varlink_event_loop_with_idle * wtmpdbd.socket: fix socket descriptor name * meson: no longer check for v258 sd-varlink function - Update to version 0.60.0+git20250120.64d23d8: * Release version 0.60.0 * Merge reader/write socket to one generic one * wtmpdbd: add Ping, SetLogLevel and GetEnvironment - Update to version 0.50.0+git20250117.a9b48cf: * wtmpdbd.service: secure more * wtmpdb: Implement json output for last (#20) - Update to version 0.50.0+git20250110.cbabeb7: * Harden wtmpdbd.service * libwtmpdb: fallback to sqlite if SELinux blocks varlink socket - Update to version 0.50.0+git20250110.12da60f: * Release version 0.50.0 * README: add wtmpdbd * wtmpdbd: Print stopped message * wtmpdbd.service: preset WTMPDBD_OPTS * wtmpdbd: don't call listen if started by a socket * tst-varlink: skip if varlink is not supported OBS-URL: https://build.opensuse.org/package/show/Linux-PAM/wtmpdb?expand=0&rev=41 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..8466014 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + https://github.com/thkukuk/wtmpdb.git + git + enable + wtmpdb + main + 0.70.0+git%cd.%h + + + *.tar + xz + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..ac74d8f --- /dev/null +++ b/_servicedata @@ -0,0 +1,7 @@ + + + https://github.com/SUSE/pam-config.git + + + https://github.com/thkukuk/wtmpdb.git + 3e409b5b57ef4514bb9955abb69739180bbe0c36 \ No newline at end of file diff --git a/wtmpdb-0.12.0+git.20240508.tar.xz b/wtmpdb-0.12.0+git.20240508.tar.xz new file mode 100644 index 0000000..3e50ab5 --- /dev/null +++ b/wtmpdb-0.12.0+git.20240508.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b47b5d5641e7d28ef4420198bf45ddbfd7115bff2ea138a567505d8d8c84026 +size 21512 diff --git a/wtmpdb-0.13.0+git.20240814.tar.xz b/wtmpdb-0.13.0+git.20240814.tar.xz new file mode 100644 index 0000000..00b4def --- /dev/null +++ b/wtmpdb-0.13.0+git.20240814.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:def187fec960290b272d441a64548b186f6cb35b510486d5c4c7c771c7a81447 +size 21580 diff --git a/wtmpdb-0.70.0+git20250121.3e409b5.tar.xz b/wtmpdb-0.70.0+git20250121.3e409b5.tar.xz new file mode 100644 index 0000000..6fbe567 --- /dev/null +++ b/wtmpdb-0.70.0+git20250121.3e409b5.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6048ad1155a62aa5e9360c857f16cb4ab20b408f7d8a20433dc1436dea911ab4 +size 31792 diff --git a/wtmpdb.changes b/wtmpdb.changes new file mode 100644 index 0000000..05ce808 --- /dev/null +++ b/wtmpdb.changes @@ -0,0 +1,218 @@ +------------------------------------------------------------------- +Tue Jan 21 15:45:20 UTC 2025 - kukuk@suse.com + +- Update to version 0.70.0+git20250121.3e409b5: + * Fix installation of all wtmpdbd man page variants + * Release version 0.70.0 + * Add wtmpdbd.8 manual page + * wtmpdbd: fix printing help text + * wtmpdbd: more fine granular log level filtering + * wtmpdbd: implement varlink_event_loop_with_idle + * wtmpdbd.socket: fix socket descriptor name + * meson: no longer check for v258 sd-varlink function + +------------------------------------------------------------------- +Mon Jan 20 13:52:51 UTC 2025 - kukuk@suse.com + +- Update to version 0.60.0+git20250120.64d23d8: + * Release version 0.60.0 + * Merge reader/write socket to one generic one + * wtmpdbd: add Ping, SetLogLevel and GetEnvironment + +------------------------------------------------------------------- +Fri Jan 17 10:17:17 UTC 2025 - kukuk@suse.com + +- Update to version 0.50.0+git20250117.a9b48cf: + * wtmpdbd.service: secure more + * wtmpdb: Implement json output for last (#20) + +------------------------------------------------------------------- +Thu Jan 16 14:20:26 UTC 2025 - kukuk@suse.com + +- Update to version 0.50.0+git20250110.cbabeb7: + * Harden wtmpdbd.service + * libwtmpdb: fallback to sqlite if SELinux blocks varlink socket + +------------------------------------------------------------------- +Fri Jan 10 13:02:32 UTC 2025 - kukuk@suse.com + +- Update to version 0.50.0+git20250110.12da60f: + * Release version 0.50.0 + * README: add wtmpdbd + * wtmpdbd: Print stopped message + * wtmpdbd.service: preset WTMPDBD_OPTS + * wtmpdbd: don't call listen if started by a socket + * tst-varlink: skip if varlink is not supported + * libwtmpdb: set varlink_is_active to 0 without systemd + * libwtmpdb: always define varlink checks + * wtmpdb: define quiet only if we have systemd + * libwtmpdb: return error if varlink support is missing + * Send sd_notify(STOPPING=1); + * Check if systemd has sd_varlink_server_listen_name() + * wtmpdbd.service: optional read /etc/default/wtmpdbd + * wtmpdbd: simplify creation of varlink sockets + * Set umaks with varlink to 0077, improve error reporting + * wtmpdbd: enable to start via sockets + * libwtmpdb: handle ECONNRESET as wtmpdbd not running + * libwtmpdb: fix crash in varlink if error==NULL + * Install daemon in libexec directory + * tst-get_id: skip if there is no db file + * libwtmpdb: improve error return code + * db path "varlink" will enforce varlink interface + * Add service and socket files + * wmtpdb: call wtmpdb_* functions with NULL as path + * wtmpdbd: add socket activation + * Implement varlink read_all client side + * Make wtmpdbd support compiletime config + * Add daemon using varlink for communication + * Document that openssh is special + * libwtmpdb: create wrapper around sqlite functions + * Make mkdir_p more robust + +------------------------------------------------------------------- +Wed Aug 14 09:59:01 UTC 2024 - kukuk@suse.com + +- Update to version 0.13.0+git.20240814: + * wtmpdb-update-boot service requires dbus + +------------------------------------------------------------------- +Fri Jul 26 13:40:32 UTC 2024 - kukuk@suse.com + +- Update to version 0.13.0+git.20240726: + * Release version 0.13.0 + * Fix variable overflow and check for it (#15) + +------------------------------------------------------------------- +Wed May 08 08:54:44 UTC 2024 - kukuk@suse.com + +- Update to version 0.12.0+git.20240508: + - boot: Query systemd if soft-reboot was done + +------------------------------------------------------------------- +Mon Jan 8 14:53:09 UTC 2024 - Thorsten Kukuk + +- Update to version 0.11.0 + - last: add support for time-format option + +------------------------------------------------------------------- +Wed Dec 13 14:01:00 UTC 2023 - Thorsten Kukuk + +- Update to version 0.10.0 + - last: support matching for username and/or tty + +------------------------------------------------------------------- +Thu Oct 26 13:07:54 UTC 2023 - Thorsten Kukuk + +- Update to version 0.9.3 + - wtmpdb last: don't print date in the future if there is no + db entry + +------------------------------------------------------------------- +Tue Sep 19 07:53:57 UTC 2023 - Stefan Schubert + +- Update to version 0.9.2 + - Set busy timeout for DB access: The process is waiting until + 5 seconds for DB connection if the DB is locked by another + process. + +------------------------------------------------------------------- +Tue Aug 22 13:47:10 UTC 2023 - Thorsten Kukuk + +- Fix last.1 manual page reference +- Update to version 0.9.1 + - Fix printf format specifier on 32bit + +------------------------------------------------------------------- +Mon Aug 14 15:04:26 UTC 2023 - Thorsten Kukuk + +- Update to version 0.9.0 + - Try to detect systemctl soft-reboot + - Many conversation warning/error fixes + +------------------------------------------------------------------- +Wed Aug 9 14:13:17 UTC 2023 - Thorsten Kukuk + +- Update to version 0.8.0 + - wtmpdb boottime: print boot time + +------------------------------------------------------------------- +Sat Jul 1 23:43:32 UTC 2023 - Jan Engelhardt + +- https://en.opensuse.org/SourceUrls +- Use noun phrase for Summary. +- Wrap descriptions at 70 (for yast2 textmode). + +------------------------------------------------------------------- +Thu Jun 29 12:09:19 UTC 2023 - Thorsten Kukuk + +- Update to version 0.7.1 + - wtmpdb last: Support "YYYY-MM-DD", "today" and "yesterday" as + time option + +------------------------------------------------------------------- +Tue Jun 27 06:30:33 UTC 2023 - Thorsten Kukuk + +- Add last compat symlink and manual page + +------------------------------------------------------------------- +Wed Jun 21 06:52:21 UTC 2023 - Thorsten Kukuk + +- Update to version 0.7.0 + - wtmpdb rotate: use sqlite3_bind_* internal + - wtmpdb last: Implement -x, -d, -i and -w options + +------------------------------------------------------------------- +Wed Jun 7 15:18:21 UTC 2023 - Thorsten Kukuk + +- Update to version 0.6.0 + - wtmpdb rotate: move old log entries into wtmpdb_.db + +------------------------------------------------------------------- +Wed Apr 26 09:11:23 UTC 2023 - Thorsten Kukuk + +- Update to version 0.5.0 + - Use uint64_t instead of usec_t to avoid conflicts + - wtmpdb boot: more accurate calculation of boot time + +------------------------------------------------------------------- +Mon Apr 24 09:46:56 UTC 2023 - Thorsten Kukuk + +- Use Requires(pre) and Requires(post) instead of PreReq + +------------------------------------------------------------------- +Tue Apr 18 06:21:02 UTC 2023 - Thorsten Kukuk + +- Update to version 0.4.0 + - libwtmpdb: Use project version for library version + - libwtmpdb: Always use _PATH_WTMPDB as fallback + +------------------------------------------------------------------- +Mon Apr 17 13:28:05 UTC 2023 - Thorsten Kukuk + +- Skip pam_wtmpdb for sshd + +------------------------------------------------------------------- +Wed Apr 12 13:28:47 UTC 2023 - Thorsten Kukuk + +- Update to version 0.3.0 + - pam_wtmpdb: Add skip_if option + - Add manual pages + - wtmpdb last: fix wtmp begins timestamp if no matching entry was found + - wtmpdb last: Add --since and --until options + - Add compat symlink for "last" + - wtmpdb last: add --present option + - wtmpdb last: implement -n/--limit + - pam_wtmpdb: Try XDG_VTNR if PAM_TTY is not a tty + +------------------------------------------------------------------- +Mon Apr 3 09:17:15 UTC 2023 - Thorsten Kukuk + +- Update to version 0.2.0 + - pam_lastlog: support PAM_XDISPLAY + - wtmpdb last: show PAM service on request + - wtmpdb: log audit records for boot/shutdown + +------------------------------------------------------------------- +Thu Mar 30 13:12:09 UTC 2023 - Thorsten Kukuk + +- Initial package diff --git a/wtmpdb.spec b/wtmpdb.spec new file mode 100644 index 0000000..7f14211 --- /dev/null +++ b/wtmpdb.spec @@ -0,0 +1,126 @@ +# +# spec file for package wtmpdb +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define lname libwtmpdb0 +Name: wtmpdb +Version: 0.70.0+git20250121.3e409b5 +Release: 0 +Summary: Database for recording the last logged in users and system reboots +License: BSD-2-Clause +URL: https://github.com/thkukuk/wtmpdb +Source: %{name}-%{version}.tar.xz +BuildRequires: docbook5-xsl-stylesheets +BuildRequires: meson +BuildRequires: pkgconfig +BuildRequires: pkgconfig(audit) +BuildRequires: pkgconfig(libsystemd) >= 257 +BuildRequires: pkgconfig(pam) +BuildRequires: pkgconfig(sqlite3) +Requires(post): pam-config +Requires(postun): pam-config +# Split provide for last +Provides: util-linux:/usr/bin/last + +%description +pam_wtmpdb and wtmpdb are Y2038-safe versions of wtmp and the last +utility. pam_wtmpdb collects all data in a sqlite3 database and the +wtmpdb utility creates boot and shutdown entries or formats and +prints the contents of the wtmp database. + +%package -n %{lname} +Summary: PAM module to store login and logout of users + +%description -n %{lname} +The libwtmpdb provides various interfaces to read, write or modify +the wtmpdb database. + +%package devel +Summary: Development files for libwtmpdb +Requires: %{lname} = %{version} + +%description devel +This package contains all necessary include files and libraries +needed to develop applications that needs to read, write or modify +the wtmpdb database. + +%prep +%autosetup + +%build +%meson -Dman=true -Dcompat-symlink=true -Dwtmpdbd=true +%meson_build + +%install +%meson_install +mkdir -p %{buildroot}%{_mandir}/man1 +echo ".so man8/wtmpdb.8" > %{buildroot}%{_mandir}/man1/last.1 + +%check +%meson_test + +%pre +%service_add_pre wtmpdb-update-boot.service wtmpdb-rotate.timer wtmpdbd.socket + +%preun +%service_del_preun wtmpdb-update-boot.service wtmpdb-rotate.timer wtmpdbd.socket + +%post +%tmpfiles_create wtmpdb.conf +%service_add_post wtmpdb-update-boot.service wtmpdb-rotate.timer wtmpdbd.socket +pam-config -a --wtmpdb --wtmpdb-skip_if=sshd + +%postun +if [ "$1" -eq 0 ]; then + pam-config -d --wtmpdb +fi +%service_del_postun_without_restart wtmpdb-update-boot.service +%service_del_postun wtmpdb-rotate.timer wtmpdbd.socket + +%post -n %{lname} -p /sbin/ldconfig +%postun -n %{lname} -p /sbin/ldconfig + +%files +%license LICENSE +%{_bindir}/last +%{_bindir}/wtmpdb +%{_libexecdir}/wtmpdbd +%{_unitdir}/wtmpdb-update-boot.service +%{_unitdir}/wtmpdb-rotate.service +%{_unitdir}/wtmpdb-rotate.timer +%{_prefix}/lib/systemd/system/wtmpdbd.service +%{_prefix}/lib/systemd/system/wtmpdbd.socket +%{_tmpfilesdir}/wtmpdb.conf +%{_pam_moduledir}/pam_wtmpdb.so +%ghost %{_localstatedir}/lib/wtmpdb +%{_mandir}/man1/last.1%{?ext_man} +%{_mandir}/man8/wtmpdb.8%{?ext_man} +%{_mandir}/man8/wtmpdbd.8%{?ext_man} +%{_mandir}/man8/wtmpdbd.service.8%{?ext_man} +%{_mandir}/man8/wtmpdbd.socket.8%{?ext_man} +%{_mandir}/man8/pam_wtmpdb.8%{?ext_man} + +%files -n %{lname} +%license LICENSE +%{_libdir}/libwtmpdb.so.* + +%files devel +%{_libdir}/libwtmpdb.so +%{_includedir}/wtmpdb.h +%{_libdir}/pkgconfig/libwtmpdb.pc + +%changelog