From 74a4fed6f40dc0a1ff03d6947969084537e3af9c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 19 Mar 2026 08:19:51 +0200 Subject: fix: guard replay chown user lookups (task 472) --- ioriot/src/replay/rioop.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ioriot/src/replay/rioop.c b/ioriot/src/replay/rioop.c index 0ce19c5..b5c360e 100644 --- a/ioriot/src/replay/rioop.c +++ b/ioriot/src/replay/rioop.c @@ -402,6 +402,8 @@ void rioop_chown(rprocess_s *p, rthread_s *t, rtask_s *task) rworker_s *w = t->worker; options_s *opts = w->opts; struct passwd *pwd = getpwnam(opts->user); + if (pwd == NULL) + return; chown(path, pwd->pw_uid, -1); } @@ -412,6 +414,8 @@ void rioop_fchown(rprocess_s *p, rthread_s *t, rtask_s *task) rworker_s *w = t->worker; options_s *opts = w->opts; struct passwd *pwd = getpwnam(opts->user); + if (pwd == NULL) + return; fchown(vfd->fd, pwd->pw_uid, -1); } @@ -421,6 +425,7 @@ void rioop_lchown(rprocess_s *p, rthread_s *t, rtask_s *task) rworker_s *w = t->worker; options_s *opts = w->opts; struct passwd *pwd = getpwnam(opts->user); + if (pwd == NULL) + return; lchown(path, pwd->pw_uid, -1); } - -- cgit v1.2.3