mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
sd-journal: refuse invocation of journal_file_open() with O_RDONLY|O_CREAT
This commit is contained in:
parent
ca8503f168
commit
d120d897ec
@ -3336,6 +3336,9 @@ int journal_file_open(
|
||||
if (!IN_SET((flags & O_ACCMODE), O_RDONLY, O_RDWR))
|
||||
return -EINVAL;
|
||||
|
||||
if ((flags & O_ACCMODE) == O_RDONLY && FLAGS_SET(flags, O_CREAT))
|
||||
return -EINVAL;
|
||||
|
||||
if (fname && (flags & O_CREAT) && !endswith(fname, ".journal"))
|
||||
return -EINVAL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user