Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lastlog2 for openSUSE:Factory checked in at 2024-02-15 20:58:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lastlog2 (Old) and /work/SRC/openSUSE:Factory/.lastlog2.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lastlog2" Thu Feb 15 20:58:56 2024 rev:9 rq:1146554 version:1.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/lastlog2/lastlog2.changes 2023-10-19 22:49:47.687818783 +0200 +++ /work/SRC/openSUSE:Factory/.lastlog2.new.1815/lastlog2.changes 2024-02-15 20:59:10.417381159 +0100 @@ -1,0 +2,6 @@ +Wed Feb 14 11:04:48 UTC 2024 - Thorsten Kukuk <ku...@suse.com> + +- Version 1.3.0 + - fix sqlite3_step error handling + +------------------------------------------------------------------- Old: ---- lastlog2-1.2.0.tar.xz New: ---- lastlog2-1.3.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lastlog2.spec ++++++ --- /var/tmp/diff_new_pack.zsk79a/_old 2024-02-15 20:59:10.885398078 +0100 +++ /var/tmp/diff_new_pack.zsk79a/_new 2024-02-15 20:59:10.885398078 +0100 @@ -1,7 +1,7 @@ # # spec file for package lastlog2 # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define lname liblastlog2-1 Name: lastlog2 -Version: 1.2.0 +Version: 1.3.0 Release: 0 Summary: Reports most recent login of users License: BSD-2-Clause ++++++ lastlog2-1.2.0.tar.xz -> lastlog2-1.3.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-1.2.0/.github/workflows/meson-sanitizer.yml new/lastlog2-1.3.0/.github/workflows/meson-sanitizer.yml --- old/lastlog2-1.2.0/.github/workflows/meson-sanitizer.yml 2023-09-08 10:46:34.000000000 +0200 +++ new/lastlog2-1.3.0/.github/workflows/meson-sanitizer.yml 2024-02-14 12:04:07.000000000 +0100 @@ -16,9 +16,11 @@ directory: build setup-options: -Db_sanitize=address,undefined options: --verbose + meson-version: 0.61.4 - uses: BSFishy/meson-build@v1.0.3 with: action: test directory: build setup-options: -Db_sanitize=address,undefined options: --verbose + meson-version: 0.61.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-1.2.0/.github/workflows/meson.yml new/lastlog2-1.3.0/.github/workflows/meson.yml --- old/lastlog2-1.2.0/.github/workflows/meson.yml 2023-09-08 10:46:34.000000000 +0200 +++ new/lastlog2-1.3.0/.github/workflows/meson.yml 2024-02-14 12:04:07.000000000 +0100 @@ -14,7 +14,9 @@ with: action: build options: --verbose + meson-version: 0.61.4 - uses: BSFishy/meson-build@v1.0.3 with: action: test options: --verbose + meson-version: 0.61.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-1.2.0/lib/lastlog2.c new/lastlog2-1.3.0/lib/lastlog2.c --- old/lastlog2-1.2.0/lib/lastlog2.c 2023-09-08 10:46:34.000000000 +0200 +++ new/lastlog2-1.3.0/lib/lastlog2.c 2024-02-14 12:04:07.000000000 +0100 @@ -154,11 +154,22 @@ *pam_service = strdup ((const char *)uc); } } - else + else if (step == SQLITE_DONE) + { + retval = -ENOENT; + } + else if (step == SQLITE_BUSY) { if (error) - if (asprintf (error, "User '%s' not found (%d)", user, step) < 0) - *error = strdup("Out of memory"); + *error = strdup ("Database busy"); + + retval = -1; + } + else if (step == SQLITE_ERROR) + { + if (error) + if (asprintf (error, "Error stepping through database: %s", sqlite3_errmsg (db)) < 0) + *error = strdup ("Out of memory"); retval = -1; } @@ -277,10 +288,20 @@ if (step != SQLITE_DONE) { - if (error) - if (asprintf (error, "Delete statement did not return SQLITE_DONE: %d", - step) < 0) - *error = strdup("Out of memory"); + if (step == SQLITE_ERROR) + { + if (error) + if (asprintf (error, "Delete statement failed: %s", + sqlite3_errmsg (db)) < 0) + *error = strdup("Out of memory"); + } + else + { + if (error) + if (asprintf (error, "Delete statement did not return SQLITE_DONE: %d", + step) < 0) + *error = strdup("Out of memory"); + } sqlite3_finalize(res); return -1; @@ -362,7 +383,7 @@ for (int i = 0; i < argc; i++) fprintf (stderr, " %s=%s", azColName[i], argv[i] ? argv[i] : "NULL"); fprintf (stderr, "\n"); - exit (EXIT_FAILURE); + return 0; } errno = 0; @@ -441,11 +462,20 @@ if (step != SQLITE_DONE) { - if (error) - if (asprintf (error, "Delete statement did not return SQLITE_DONE: %d", - step) < 0) - *error = strdup("Out of memory"); - + if (step == SQLITE_ERROR) + { + if (error) + if (asprintf (error, "Delete statement failed: %s", + sqlite3_errmsg (db)) < 0) + *error = strdup("Out of memory"); + } + else + { + if (error) + if (asprintf (error, "Delete statement did not return SQLITE_DONE: %d", + step) < 0) + *error = strdup("Out of memory"); + } sqlite3_finalize(res); return -1; } @@ -479,7 +509,7 @@ const char *newname, char **error) { sqlite3 *db; - time_t ll_time; + int64_t ll_time; char *tty; char *rhost; char *pam_service; @@ -580,7 +610,7 @@ if (ll.ll_time != 0) { - time_t ll_time; + int64_t ll_time; char tty[UT_LINESIZE+1]; char rhost[UT_HOSTSIZE+1]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-1.2.0/meson.build new/lastlog2-1.3.0/meson.build --- old/lastlog2-1.2.0/meson.build 2023-09-08 10:46:34.000000000 +0200 +++ new/lastlog2-1.3.0/meson.build 2024-02-14 12:04:07.000000000 +0100 @@ -1,7 +1,7 @@ project( 'lastlog2', 'c', - meson_version : '>= 0.53.0', + meson_version : '>= 0.61.0', default_options : [ 'prefix=/usr', 'sysconfdir=/etc', @@ -11,7 +11,7 @@ 'b_pie=true', 'warning_level=2',], license : ['BSD-2-Clause',], - version : '1.2.0', + version : '1.3.0', ) cc = meson.get_compiler('c') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lastlog2-1.2.0/src/lastlog2.c new/lastlog2-1.3.0/src/lastlog2.c --- old/lastlog2-1.2.0/src/lastlog2.c 2023-09-08 10:46:34.000000000 +0200 +++ new/lastlog2-1.3.0/src/lastlog2.c 2024-02-14 12:04:07.000000000 +0100 @@ -45,7 +45,7 @@ static int sflg = 0; static int -print_entry (const char *user, time_t ll_time, +print_entry (const char *user, int64_t ll_time, const char *tty, const char *rhost, const char *pam_service) { @@ -66,7 +66,10 @@ if (tflg && ((time (NULL) - ll_time) > t_days)) return 0; - tm = localtime (&ll_time); + /* this is necessary if you compile this on architectures with + a 32bit time_t type. */ + time_t t_time = ll_time; + tm = localtime (&t_time); if (tm == NULL) datep = "(unknown)"; else @@ -75,7 +78,7 @@ datep = datetime; } - if (ll_time == (time_t) 0) + if (ll_time == 0) datep = "**Never logged in**"; if (!once) @@ -330,7 +333,7 @@ if (user) { - time_t ll_time = 0; + int64_t ll_time = 0; char *tty = NULL; char *rhost = NULL; char *service = NULL;