1
0
mirror of https://github.com/systemd/systemd synced 2025-09-24 06:14:44 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Luca Boccassi
a0203ac14c test: ensure journal dir is writable by container in TEST-13-NSPAWN
The systemd-journal group is not mapped, so ensure the test directory
is owned by root:root so that the mapping works.

Follow-up for 88fce090263ba8944cf491346eae2e8022dfd88d
2025-09-14 13:23:17 +01:00
Luca Boccassi
e3f4aa4a75 shell-completion: add missing arguments for journalctl 2025-09-14 09:42:36 +01:00
Yu Watanabe
6c32948b25 dissect: include unistd.h
This is required by e.g. geteuid(), for the case when unistd.h is
indirectly included by other headers.

Continuation of 4f18ff2e29b8054f30b084abcabf5f689f4b340b.
2025-09-14 09:47:30 +02:00
3 changed files with 10 additions and 7 deletions

View File

@ -46,7 +46,8 @@ _journalctl() {
--version --list-catalog --update-catalog --list-boots
--show-cursor --dmesg -k --pager-end -e -r --reverse
--utc -x --catalog --no-full --force --dump-catalog
--flush --rotate --sync --no-hostname -N --fields
--flush --rotate --sync --relinquish-var
--smart-relinquish-var --no-hostname -N --fields
--list-namespaces --list-invocations -I -v --verbose'
[ARG]='-b --boot -D --directory -i --file -F --field -t --identifier
-T --exclude-identifier --facility -M --machine -o --output

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/file.h>
#include <unistd.h>
#include "sd-device.h"

View File

@ -1454,20 +1454,21 @@ testcase_link_journal_host() {
systemd-id128 new > "$root"/etc/machine-id
mkdir -p /var/log/journal
hoge="/var/log/journal/$(cat "$root"/etc/machine-id)/hoge"
hoge="/var/log/journal/$(cat "$root"/etc/machine-id)/"
mkdir -p "$hoge"
# The systemd-journal group is not mapped, so ensure the directory is owned by root:root
chown root:root "$hoge"
for i in no yes pick; do
systemd-nspawn \
--directory="$root" --private-users="$i" --link-journal=host \
bash -xec 'p="/var/log/journal/$(cat /etc/machine-id)"; mountpoint "$p"; [[ "$(stat "$p" --format=%u)" == 0 ]]; touch "$p/hoge"'
[[ "$(stat "$hoge" --format=%u)" == 0 ]]
rm "$hoge"
[[ "$(stat "${hoge}/hoge" --format=%u)" == 0 ]]
rm "${hoge}/hoge"
done
rm -fr "$root"
rm -fr "$root" "$hoge"
}
testcase_cap_net_bind_service() {