1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00

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.

(cherry picked from commit 661e4251a5)
This commit is contained in:
Daan De Meyer 2022-12-13 10:50:01 +00:00 committed by Zbigniew Jędrzejewski-Szmek
parent 4cfdb1c73b
commit d78dc885b0

View File

@ -2662,6 +2662,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);
@ -2888,7 +2889,7 @@ static int acquire_credentials(
lc->path,
lc->encrypted,
unit,
-1,
AT_FDCWD,
dfd,
uid,
ownership_ok,