36 Replies
sys
systemd
pr
gaming
:true:
yeah so I'm not sure on the name of
write_string_file_label
as it's really assuming file creation, and it's specific to relabling on creation
so I think it should include the flags???but like thats the point
why dont we just use WRITE_STRING_FILE_LABEL instead of having a dedicated function?
it should set up everything by default
so just use the
write_string_file_full
function raw without an abraction in the header?check this patch out
this kinda looks what pottering wants
issue
the
heirachy
variable isn't used for SELinux lookup
but yeah that looks goodidk exactly what to do with it tho...
it's what they use to fix the SELinux label
are you able to join VC?
yup
git rebase main
Co-authored-by: NAME <[email protected]>
update for anyone wondering, code lives here now: https://github.com/systemd/systemd/compare/main...gerblesh:systemd:main-sysexts-selinux-labels
GitHub
Comparing systemd:main...gerblesh:main-sysexts-selinux-labels · sys...
The systemd System and Service Manager . Contribute to systemd/systemd development by creating an account on GitHub.
@tulip things are actually way easier to test
there's a sysext binary artifact from compiling systemd
we could just use that
no need to compile and install the entirety of systemd
https://systemd.io/HACKING/
this page is SUPER helpful
ok so the args work
idk why this is broke
this is the whole
label_ops_pre
function
well at least I think
@tulip looks like it works
the labels are preserved with our sysext as well
when using the normal sysext merge it bricks my PC lmao
thank god I masked the service
now time to look at the tests
basically idk if you installed the right stuff
because the SELinux context works
like sudo n all that
on a more positive note I learned a lot about systemdGitHub
Main sysexts selinux labels · gerblesh/systemd@7d2d2f9
The systemd System and Service Manager . Contribute to gerblesh/systemd development by creating an account on GitHub.
but like, we actually need the entire systemd stuff on runtime
reading that HACKING page i ended up figuring out that
mkosi -d fedora
makes the RPMs for me!
mkosi is kinda crazy god damnwe don't
the proper labels happen when mounting the sysext just using the binary in the build dir
oh!
nice
soooo what was it that wasnt working?
like
on the code that we modified
nothing, our changes work just the same as timothees
LOL
i wonder why it didnt work on the VM then?
when using the normal sysext merge
/usr
doesn't get the proper labelsmaybe i did something wrong
I think the sysext tool might not have been upgraded to ours? Idk
probably!
but like how did you compile just systemd-sysext?
I just did the meson build
all the binaries are in the
build/
diryeah! i just thought you could compile just sysext
yeyey all the binaries are there
may or may not have fixed the issue with the tests
GitHub
Main sysexts selinux labels · gerblesh/systemd@bc6568c
The systemd System and Service Manager . Contribute to gerblesh/systemd development by creating an account on GitHub.
🤞
@tulip TESTS PASS!!!!
GitHub
sysext: Set SELinux context for overlay hierarchies mountpoints by ...
See: coreos/fedora-coreos-tracker#1744
See: #31404
Fixes: #34387
With this change, I get the correct SELinux label for /usr with sysexts:
ls -alhZd /etc /usr /opt
drwxr-xr-x. 86 root root system...
looks like my PR is doesn't solve some previous issues with the SELinux labeling
this is still a huge improvement tho
you are doing a great job!
GitHub
sysext: Set SELinux context for hierarchies and workdir by gerblesh...
Based on: #34387
Fixes: #34387
This PR fixes issues with labeling the workdir and the files under /usr/.systemd-sysext.
❯ sudo ls -laFZ /usr/.systemd-sysext/
total 12
drwxr-xr-x. 2 root root system...
is anybody able to sanity check my SELinux changes for
fileio.c
?@tulip I'm confused because Poettering reviewed my PR but it looks like he looked at an older commit? https://github.com/systemd/systemd/pull/35132
GitHub
sysext: Set SELinux context for hierarchies and workdir by gerblesh...
Based on: #34387
Fixes: #34387
This PR fixes issues with labeling the workdir and the files under /usr/.systemd-sysext.
❯ sudo ls -laFZ /usr/.systemd-sysext/
total 12
drwxr-xr-x. 2 root root system...