mirror of
https://github.com/systemd/systemd.git
synced 2024-10-29 21:55:36 +03:00
bootspec: don't follow symlinks when opening type1/type2 files
let's not follow symlinks when going from enumeraiton dir to enumerated file either.
This commit is contained in:
parent
2683ae2d73
commit
f2c513048c
@ -629,7 +629,7 @@ static int boot_entries_find_type1(
|
||||
if (!endswith_no_case(de->d_name, ".conf"))
|
||||
continue;
|
||||
|
||||
r = xfopenat(dir_fd, de->d_name, "re", 0, &f);
|
||||
r = xfopenat(dir_fd, de->d_name, "re", O_NOFOLLOW|O_NOCTTY, &f);
|
||||
if (r < 0) {
|
||||
log_warning_errno(r, "Failed to open %s/%s, ignoring: %m", full, de->d_name);
|
||||
continue;
|
||||
@ -888,7 +888,7 @@ static int boot_entries_find_unified(
|
||||
if (!GREEDY_REALLOC0(config->entries, config->n_entries + 1))
|
||||
return log_oom();
|
||||
|
||||
fd = openat(dirfd(d), de->d_name, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
|
||||
fd = openat(dirfd(d), de->d_name, O_RDONLY|O_CLOEXEC|O_NONBLOCK|O_NOFOLLOW|O_NOCTTY);
|
||||
if (fd < 0) {
|
||||
log_warning_errno(errno, "Failed to open %s/%s, ignoring: %m", full, de->d_name);
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user