Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lastlog2 for openSUSE:Factory checked in at 2023-04-04 21:17:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lastlog2 (Old) and /work/SRC/openSUSE:Factory/.lastlog2.new.19717 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lastlog2" Tue Apr 4 21:17:56 2023 rev:3 rq:1077081 version:0.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/lastlog2/lastlog2.changes 2023-03-29 23:28:16.419801244 +0200 +++ /work/SRC/openSUSE:Factory/.lastlog2.new.19717/lastlog2.changes 2023-04-04 21:18:13.816352588 +0200 @@ -1,0 +2,18 @@ +Mon Apr 3 20:34:17 UTC 2023 - Thorsten Kukuk <ku...@suse.com> + +- Require pam-config 2.4 or newer (postlogin read fix) + +------------------------------------------------------------------- +Mon Apr 3 12:51:05 UTC 2023 - Thorsten Kukuk <ku...@suse.com> + +- Require current enough pam-config for silent_if= option +- Don't print lastlog messages with display manager + +------------------------------------------------------------------- +Mon Apr 3 10:01:03 UTC 2023 - Thorsten Kukuk <ku...@suse.com> + +- Version 0.7.0 + - pam_lastlog2: add silent_if= option + - pam_lastlog2: try PAM_XDISPLAY if PAM_RHOST is not set + +------------------------------------------------------------------- Old: ---- lastlog2-0.6.2.tar.xz New: ---- lastlog2-0.7.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lastlog2.spec ++++++ --- /var/tmp/diff_new_pack.CqjeCP/_old 2023-04-04 21:18:14.264355444 +0200 +++ /var/tmp/diff_new_pack.CqjeCP/_new 2023-04-04 21:18:14.272355495 +0200 @@ -18,7 +18,7 @@ %define lname liblastlog2-0 Name: lastlog2 -Version: 0.6.2 +Version: 0.7.0 Release: 0 Summary: Reports most recent login of users License: BSD-2-Clause @@ -29,7 +29,8 @@ BuildRequires: pkgconfig BuildRequires: pkgconfig(pam) BuildRequires: pkgconfig(sqlite3) -PreReq: pam-config +Requires(pre): pam-config >= 2.4 +Requires(post): pam-config >= 2.4 %description pam_lastlog2 and lastlog2 are Y2038 safe versions of the old lastlog utility. pam_lastlog2 collects all data in a sqlite3 database and lastlog2 formats and prints the contents. The username, port, and last login time will be printed. @@ -70,7 +71,7 @@ %post %tmpfiles_create lastlog2.conf %service_add_post lastlog2-import.service -pam-config -a --lastlog2 +pam-config -a --lastlog2 --lastlog2-silent_if=gdm,gdm-password,lxdm,lightdm,mdm,sddm %postun if [ "$1" -eq 0 ]; then ++++++ lastlog2-0.6.2.tar.xz -> lastlog2-0.7.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-0.6.2/NEWS new/lastlog2-0.7.0/NEWS --- old/lastlog2-0.6.2/NEWS 2023-03-29 14:37:28.000000000 +0200 +++ new/lastlog2-0.7.0/NEWS 2023-04-03 11:58:46.000000000 +0200 @@ -1,3 +1,7 @@ +Version 0.7.0 +* pam_lastlog2: add silent_if= option +* pam_lastlog2: try PAM_XDISPLAY if PAM_RHOST is not set + Version 0.6.2 * Add more test cases * Add --version option for lastlog2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-0.6.2/README.md new/lastlog2-0.7.0/README.md --- old/lastlog2-0.6.2/README.md 2023-03-29 14:37:28.000000000 +0200 +++ new/lastlog2-0.7.0/README.md 2023-04-03 11:58:46.000000000 +0200 @@ -39,7 +39,7 @@ ## Configuration The `pam_lastlog2.so` module will be added in the `session` section of the service, which should display the last login message and store the new data. -On openSUSE Tumbleweed and MicroOS, the following line needs be added at the end of `/etc/pam.d/common-session`: +On openSUSE Tumbleweed and MicroOS, the following line needs be added to `/etc/pam.d/postlogin-session`: ``` session optional pam_lastlog2.so diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-0.6.2/man/pam_lastlog2.8.xml new/lastlog2-0.7.0/man/pam_lastlog2.8.xml --- old/lastlog2-0.6.2/man/pam_lastlog2.8.xml 2023-03-29 14:37:28.000000000 +0200 +++ new/lastlog2-0.7.0/man/pam_lastlog2.8.xml 2023-04-03 11:58:46.000000000 +0200 @@ -5,12 +5,12 @@ <refmiscinfo class="source">lastlog2 %version%</refmiscinfo> <refmiscinfo class="manual">pam_lastlog2</refmiscinfo> </refmeta> - + <refnamediv> <refname>pam_lastlog2</refname> <refpurpose>PAM module to display date of last login</refpurpose> </refnamediv> - + <refsynopsisdiv> <cmdsynopsis sepchar=" "> <command>pam_lastlog2.so</command> @@ -21,6 +21,9 @@ silent </arg> <arg choice="opt" rep="norepeat"> + silent_if=<services> + </arg> + <arg choice="opt" rep="norepeat"> database=<file> </arg> </cmdsynopsis> @@ -70,6 +73,18 @@ </varlistentry> <varlistentry> <term> + silent_if=<services> + </term> + <listitem> + <para> + The argument <option>services</option> is a comma separated list + of PAM services. If a service is listed here, the last login + message will not be shown. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> database=<file> </term> <listitem> @@ -143,10 +158,10 @@ display the last login time of a user: </para> <programlisting> - session required pam_lastlog2.so + session required pam_lastlog2.so silent_if=gdm,gdm-password </programlisting> </refsect1> - + <refsect1> <title>FILES</title> <variablelist> @@ -158,7 +173,7 @@ </varlistentry> </variablelist> </refsect1> - + <refsect1> <title>SEE ALSO</title> <para> @@ -183,5 +198,5 @@ pam_lastlog2 was written by Thorsten Kukuk <ku...@suse.com>. </para> </refsect1> - + </refentry> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-0.6.2/meson.build new/lastlog2-0.7.0/meson.build --- old/lastlog2-0.6.2/meson.build 2023-03-29 14:37:28.000000000 +0200 +++ new/lastlog2-0.7.0/meson.build 2023-04-03 11:58:46.000000000 +0200 @@ -11,7 +11,7 @@ 'b_pie=true', 'warning_level=2',], license : ['BSD-2-Clause',], - version : '0.6.2', + version : '0.7.0', ) cc = meson.get_compiler('c') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-0.6.2/src/pam_lastlog2.c new/lastlog2-0.7.0/src/pam_lastlog2.c --- old/lastlog2-0.6.2/src/pam_lastlog2.c 2023-03-29 14:37:28.000000000 +0200 +++ new/lastlog2-0.7.0/src/pam_lastlog2.c 2023-04-03 11:58:46.000000000 +0200 @@ -55,6 +55,43 @@ return strncmp(str, prefix, prefix_len) ? NULL : str + prefix_len; } +/* check for list match. */ +static int +check_in_list (const char *service, const char *arg) +{ + const char *item; + const char *remaining; + + if (!service) + return 0; + + remaining = arg; + + for (;;) { + item = strstr (remaining, service); + if (item == NULL) + break; + + /* is it really the start of an item in the list? */ + if (item == arg || *(item - 1) == ',') { + item += strlen (service); + /* is item really the service? */ + if (*item == '\0' || *item == ',') + return 1; + } + + remaining = strchr (item, ','); + if (remaining == NULL) + break; + + /* skip ',' */ + ++remaining; + } + + return 0; +} + + static int _pam_parse_args (pam_handle_t *pamh, int flags, int argc, @@ -67,6 +104,14 @@ if (flags & PAM_SILENT) ctrl |= LASTLOG2_QUIET; + const void *void_str = NULL; + const char *service; + if ((pam_get_item (pamh, PAM_SERVICE, &void_str) != PAM_SUCCESS) || + void_str == NULL) + service = ""; + else + service = void_str; + /* step through arguments */ for (; argc-- > 0; ++argv) { @@ -74,8 +119,17 @@ ctrl |= LASTLOG2_DEBUG; else if (strcmp (*argv, "silent") == 0) ctrl |= LASTLOG2_QUIET; - else if ((str = skip_prefix(*argv, "database=")) != NULL) + else if ((str = skip_prefix (*argv, "database=")) != NULL) lastlog2_path = str; + else if ((str = skip_prefix (*argv, "silent_if=")) != NULL) + { + if (check_in_list (service, str)) + { + if (ctrl & LASTLOG2_DEBUG) + pam_syslog (pamh, LOG_DEBUG, "silent_if='%s' contains '%s'", str, service); + ctrl |= LASTLOG2_QUIET; + } + } else pam_syslog (pamh, LOG_ERR, "Unknown option: %s", *argv); } @@ -111,12 +165,24 @@ void_str = NULL; retval = pam_get_item (pamh, PAM_RHOST, &void_str); if (retval != PAM_SUCCESS || void_str == NULL) - rhost = ""; + { + void_str = NULL; + retval = pam_get_item (pamh, PAM_XDISPLAY, &void_str); + if (retval != PAM_SUCCESS || void_str == NULL) + rhost = ""; + else + { + rhost = void_str; + if (ctrl & LASTLOG2_DEBUG) + pam_syslog (pamh, LOG_DEBUG, "rhost(PAM_XDISPLAY)=%s", rhost); + } + } else - rhost = void_str; - - if (ctrl & LASTLOG2_DEBUG) - pam_syslog (pamh, LOG_DEBUG, "rhost=%s", rhost); + { + rhost = void_str; + if (ctrl & LASTLOG2_DEBUG) + pam_syslog (pamh, LOG_DEBUG, "rhost(PAM_RHOST)=%s", rhost); + } if (time (&ll_time) < 0) return PAM_SYSTEM_ERR;