From 661e4251a5b157d1aee1df98fbd2f0c95285ebba Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 13 Dec 2022 10:50:01 +0000 Subject: [PATCH] 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. --- src/core/execute.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/execute.c b/src/core/execute.c index 8e70ecab82..7963582ea2 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,