From: Daan De Meyer Date: Tue, 13 Dec 2022 10:50:01 +0000 (+0000) Subject: execute: Pass AT_FDCWD instead of -1 X-Git-Tag: v253-rc1~307 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=661e4251a5b157d1aee1df98fbd2f0c95285ebba;p=thirdparty%2Fsystemd.git execute: Pass AT_FDCWD instead of -1 Let's enforce that callers pass AT_FDCWD as read_dfd to load_credential() to avoid an assert() in read_full_file_full() if read_dfd is -1. --- diff --git a/src/core/execute.c b/src/core/execute.c index 8e70ecab821..7963582ea2f 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -2663,6 +2663,7 @@ static int load_credential( assert(id); assert(path); assert(unit); + assert(read_dfd >= 0 || read_dfd == AT_FDCWD); assert(write_dfd >= 0); assert(left); @@ -2889,7 +2890,7 @@ static int acquire_credentials( lc->path, lc->encrypted, unit, - -1, + AT_FDCWD, dfd, uid, ownership_ok,