Commit Graph

46349 Commits

Author SHA1 Message Date
Lennart Poettering fabece9ccb update TODO 2020-08-25 19:46:39 +02:00
Lennart Poettering 30dd9f7391 test: add test suite for new credentials logic 2020-08-25 19:46:36 +02:00
Lennart Poettering b0d29bfdfd man: document credentials passing in the container interface 2020-08-25 19:46:32 +02:00
Lennart Poettering 60cc90b959 man: document nspawn's new credential switches 2020-08-25 19:46:14 +02:00
Lennart Poettering 3220cf394c man: document pid1's new credentials logic 2020-08-25 19:45:57 +02:00
Lennart Poettering 3652872add nspawn: add --set-credential= and --load-credential=
Let's allow passing in creds to containers, so that PID 1 inside the
container can pick them up.
2020-08-25 19:45:47 +02:00
Lennart Poettering bbb4e7f39f core: hide /run/credentials whenever namespacing is requested
Ideally we would like to hide all other service's credentials for all
services. That would imply for us to enable mount namespacing for all
services, which is something we cannot do, both due to compatibility
with the status quo ante, and because a number of services legitimately
should be able to install mounts in the host hierarchy.

Hence we do the second best thing, we hide the credentials automatically
for all services that opt into mount namespacing otherwise. This is
quite different from other mount sandboxing options: usually you have to
explicitly opt into each. However, given that the credentials logic is a
brand new concept we invented right here and now, and particularly
security sensitive it's OK to reverse this, and by default hide
credentials whenever we can (i.e. whenever mount namespacing is
otherwise opt-ed in to).

Long story short: if you want to hide other service's credentials, the
most basic options is to just turn on PrivateMounts= and there you go,
they should all be gone.
2020-08-25 19:45:38 +02:00
Lennart Poettering bb0c0d6f29 core: add credentials logic
Fixes: #15778 #16060
2020-08-25 19:45:35 +02:00
Lennart Poettering 9db59d9283 acl-util: beef up add_acls_for_user()
Let's add support for controlling r/w/x bits separetely. This is useful
for using it to control access to directories, where r + x shall be
enabled.
2020-08-25 18:39:45 +02:00
Lennart Poettering 71281a7655 acl-util: make sure acl_find_uid() initializes return parameters on success
Let's follow our usual coding style and initialize return parameters on
success in all cases.
2020-08-25 18:39:45 +02:00
Lennart Poettering 2899fb024f rm-rf: add new flag REMOVE_CHMOD
When removing a directory tree as unprivileged user we might encounter
files owned by us but not deletable since the containing directory might
have the "r" bit missing in its access mode. Let's try to deal with
this: optionally if we get EACCES try to set the bit and see if it works
then.
2020-08-25 18:39:45 +02:00
Lennart Poettering 45374f6503
Merge pull request #15662 from Werkov/fix-cgroup-disable
Fix unsetting cgroup restrictions
2020-08-25 17:36:07 +02:00
Andrew Hangsleben b2c185bae9 Added sensor configuration for One-netbook OneMix 3 Pro 2020-08-25 14:11:15 +02:00
Lennart Poettering 47d0644e1a
Merge pull request #16833 from JackFangXN/master
analyze-verify: drop pointless zero initialization
2020-08-25 13:20:11 +02:00
Zbigniew Jędrzejewski-Szmek 3b9d671754
Merge pull request #16676 from poettering/repart-mkfs
repart: add new settings Format=, CopyFiles=, Encrypt= and teach --size= a new value "auto"
2020-08-25 12:19:46 +02:00
Alec Moskvin dd47b25220 rules: don't install 80-drivers.rules when kmod is disabled 2020-08-25 09:35:49 +02:00
Zbigniew Jędrzejewski-Szmek c3bbc90b4a
Merge pull request #16777 from DaanDeMeyer/kernel-install-followup
kernel-install: "Linux" => "Default" and reuse $BOOT/Default if it already exists
2020-08-25 09:30:44 +02:00
Ronan Pigott 45b156c155 zsh: correct journalctl command completion parsing 2020-08-25 09:29:13 +02:00
Zbigniew Jędrzejewski-Szmek 2c7d33d9e3
Merge pull request #16767 from keszybz/missing-syscall-cleanup
missing_syscall: verify our fallback numbers when possible
2020-08-25 09:21:32 +02:00
Zbigniew Jędrzejewski-Szmek b20f00599d
Merge pull request #16816 from keszybz/install-templated-presets
Fix preset operation for non-service templates
2020-08-25 09:20:07 +02:00
Zbigniew Jędrzejewski-Szmek 9f56c88aeb
Merge pull request #16819 from keszybz/seccomp-enosys
Return ENOSYS in nspawn for "unknown" syscalls
2020-08-25 09:18:46 +02:00
fangxiuning 05f7a0689e analyze: drop pointless zero initialization 2020-08-25 15:17:52 +08:00
Zbigniew Jędrzejewski-Szmek d521e6993d
Merge pull request #16824 from keszybz/no-such-unit-error
Add sd_bus_error_has_names() and use it to catch BUS_ERROR_NO_SUCH_UNIT
2020-08-25 09:16:25 +02:00
fangxiuning 6f32f8e037 analyze-verify: drop pointless zero initialization 2020-08-25 15:10:15 +08:00
Lennart Poettering f053c9477b core: drop redundant comment
Since 625a164069 we don't need to update
analyze-condition.c separately anymore, hence drop the comment
suggesting otherwise.
2020-08-25 07:47:50 +02:00
Lennart Poettering 6944adbbe0
Merge pull request #16681 from poettering/hidepid
core: introduce ProtectProc= unit file setting for exposing procfs' hidepid= mount option
2020-08-25 07:47:05 +02:00
Lennart Poettering bb2551bdcb loop-util: LOOP_CONFIGURE ignores lo_sizelimit
It appears LOOP_CONFIGURE in 5.8 is even more broken than initially
thought: it doesn't properly propgate lo_sizelimit to the block device
layer. :-(

Let's hence check the block device size immediately after issuing
LOOP_CONFIGURE, and if it doesn't match what we just set let's fallback
to the old ioctls.

This means LOOP_CONFIGURE currently works correctly only for the most
simply case: no partition table logic and no size limit. Sad!

(Kernel people should really be told about the concepts of tests and
even CI, one day!)
2020-08-24 22:01:13 +02:00
Lennart Poettering c2f418d595 update TODO 2020-08-24 22:01:09 +02:00
Lennart Poettering dfb4d0ae0d man: document new repart features 2020-08-24 22:00:52 +02:00
Lennart Poettering f7011e17f1 test: add test for new repart features 2020-08-24 22:00:49 +02:00
Lennart Poettering 170c982345 repart: if --size= is specified as "auto" determine minimal size for disk image
When assembling a disk image locally, using --size=auto can be used to
generate the minimal image based on the provided definitions. THis is
useful to prepare images that are grown on first boot.
2020-08-24 22:00:45 +02:00
Lennart Poettering b9df353689 repart: add support for optionally encrypting partitions we create 2020-08-24 22:00:42 +02:00
Lennart Poettering 8a794850e7 repart: add new CopyFiles= setting, for copying files into freshly made file systems
This makes the tool a lot more useful for streaming OS images onto
disks.
2020-08-24 22:00:38 +02:00
Lennart Poettering 1f0f82f131 dissect: create directories we want to mount on
This matches how we handle things everywhere else, i.e. in .mount units,
and similar: when a mount point dir is missing, we create it, let's do
so too when dealing with disk images.

This makes things a lot simpler, more robust, and systematic.
2020-08-24 22:00:35 +02:00
Lennart Poettering f0cb1b951c repart: wipe partition first, then discard
Wiping means writing zero sectors to disk. Hence it's better to do this
before we discard, so that the zeroes we use to overwrite are properly
discarded. If we'd do it the other way round we'd discard the data and
then reallocte it just to write zeroes.
2020-08-24 22:00:31 +02:00
Lennart Poettering 5b5109e225 repart: talk about future partitions
We initialize the partition contents before the partitions actually
exist, hence to reduce confusion let's talk about "future partitions" up
to the point where they are actually realized.
2020-08-24 22:00:28 +02:00
Lennart Poettering 81873a6b6c repart: let's wipe the partition table ourselves
Let's issue the wiping ourselves, so that we know it's done before we
write partition data onto the disk, and before the disk label
is written. Before this commit the writing of the disk label would imply
the wiping step, potentially overriding again what we just wrote into
the disk data section.

(Normally this shouldn't matter, since the partition table metadata
that the wiping process deletes is at the start and end of the disk
while we write our data to the middle, but you never know what kind of
weird signatures might exist that depart from that.)

(And effectively this ends up using the same wiping code, since that's
implemented in libblkkid, and libfdisk just acts as frontend to that
anyway. We now simply call it directly.)
2020-08-24 22:00:24 +02:00
Lennart Poettering f28d4f42f4 repart: split out code that mangles part table entries into function of its own
Just some refactoring, no actual code change.
2020-08-24 22:00:21 +02:00
Lennart Poettering 0f2b2c483f mkfs-util: add support for making vfat partitions
fat is a bit more limited in volume name length and UUID support. Let's
add some special support for it.

This is particularly useful to generate EFI system partitions.
2020-08-24 22:00:17 +02:00
Lennart Poettering 53171c0453 repart: add support for formatting newly created partitions 2020-08-24 22:00:14 +02:00
Lennart Poettering aa2a74ad9d repart: make error code when operating on non-existing file a bit more useful 2020-08-24 22:00:10 +02:00
Lennart Poettering da49710ef2 makefs: port to generic make_filesystem() call 2020-08-24 22:00:07 +02:00
Lennart Poettering c95f9a2351 shared: introduce mkfs-util.c/.h
Let's move the "mkfs" code from homed there, plus other related code.

This way we can easily reuse it from other places.
2020-08-24 21:59:49 +02:00
Lennart Poettering 8dbc208cc1 loop-util: define API for syncing loopback device 2020-08-24 21:59:35 +02:00
Lennart Poettering 0de3c4f4b7 mkdir: add new mkdir_p_root() helper 2020-08-24 21:59:21 +02:00
Lennart Poettering 15d43e3065 repart: don't unload data we configured explicitly, and fully free all data we match to disk
The context_unload_partition_table() call is supposed to remove all
data from the loaded partitions about how we mapped it to existing
partitions on disk, but it should leave everything we parsed from the
definition files in place.

We mostly got this right, except for two cases:

1. new_uuid is parsed from the definition files and should stay

2. current_label is read from the existing partition table and should be
   freed
2020-08-24 21:58:53 +02:00
Daan De Meyer 2c46d523ac kernel-install: Reuse $BOOT/Default if it already exists
Avoids duplicate installation problems when the machine ID is
initialized after a kernel is already installed under $BOOT/Default.
2020-08-24 19:24:19 +01:00
Daan De Meyer 6426c98ac5 kernel-install: Use "Default" as fallback instead of "Linux"
"Linux" conflicts /efi/Linux when /efi is the install location.
/efi/Linux is already reserved for unified kernel images so we can't use
it for type #1 images. Instead, we use "Default".
2020-08-24 19:22:11 +01:00
Lennart Poettering a54342b371 man: document ProtectProc= and ProcSubset= 2020-08-24 20:11:24 +02:00
Lennart Poettering 24da96a1bd units: turn on ProtectProc= wherever suitable 2020-08-24 20:11:14 +02:00