sd-journal: allow SYSTEM and CURRENT_USER flags with sd_j_open_directory[_fd]

There is no reason not to. This makes journalctl -D ... --system work,
useful for example when viewing files from a deactivated container.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-08-12 00:38:03 -04:00
parent 1aaa68f535
commit 10752e829b
2 changed files with 11 additions and 6 deletions
+4 -2
View File
@@ -1815,7 +1815,8 @@ fail:
}
#define OPEN_DIRECTORY_ALLOWED_FLAGS \
SD_JOURNAL_OS_ROOT
(SD_JOURNAL_OS_ROOT | \
SD_JOURNAL_SYSTEM | SD_JOURNAL_CURRENT_USER )
_public_ int sd_journal_open_directory(sd_journal **ret, const char *path, int flags) {
sd_journal *j;
@@ -1873,7 +1874,8 @@ fail:
}
#define OPEN_DIRECTORY_FD_ALLOWED_FLAGS \
SD_JOURNAL_OS_ROOT
(SD_JOURNAL_OS_ROOT | \
SD_JOURNAL_SYSTEM | SD_JOURNAL_CURRENT_USER )
_public_ int sd_journal_open_directory_fd(sd_journal **ret, int fd, int flags) {
sd_journal *j;