]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
utmp-wtmp: fix wrong suffix assignment on putting dead process
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 27 Nov 2023 23:45:31 +0000 (08:45 +0900)
committerMike Yuan <me@yhndnzj.com>
Tue, 28 Nov 2023 09:46:01 +0000 (17:46 +0800)
Fixes a bug introduced by f1d553e9dfd56f95b7564dd20a0b56e6a0d6492c.

Fixes #30213.

src/shared/utmp-wtmp.c

index eec3c3544735892763714782eac9e8a5ad9ba814..6c3238a9c6a8b20d347d1c978dab0f41f48295db 100644 (file)
@@ -221,7 +221,7 @@ int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) {
         utmpx = utxent_start();
 
         /* Copy the whole string if it fits, or just the suffix without the terminating NUL. */
-        copy_suffix(store.ut_id, sizeof(store.ut_id), id);
+        copy_suffix(lookup.ut_id, sizeof(lookup.ut_id), id);
 
         found = getutxid(&lookup);
         if (!found)