Commit Graph

21 Commits

Author SHA1 Message Date
Lennart Poettering f2ba663ea5 homed: show actual file system in messages about file systems 2020-09-21 18:02:35 +02:00
Frantisek Sumsal 69e3234db7 tree-wide: fix typos found by codespell
Reported by Fossies.org
2020-09-14 15:32:37 +02:00
Lennart Poettering 565ac8b1c8 homed: mark LUKS loopback file as "dirty" via xattr when in use
Let's track the "dirty" state of a home directory backed by a LUKS
volume by setting a new xattr "home.home-dirty" on the backing file
whenever it is in use.

This allows us to later user this information to show a home directory
as "dirty". This is useful because we trim/allocate on log-out, and
if we don't do that a home directory will be larger than necessary. This
fact is something we should communicate to the admin.

The idea is that when an admin sees a user with a "dirty" home directory
they can ask them to log in, to clean up the dirty state, and thus trim
everything again.
2020-08-25 18:18:46 +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 64dc138d1e homework: downgrade chattr failure log message
NOCOW is a btrfs-only thing hence don't log louder than necessary if we
don't have it.
2020-08-18 12:41:31 +02:00
Lennart Poettering df14bda2b5 homework: explicitly close cryptsetup context, to not keep loopback device busy
The cryptsetup context pins the loop device even after deactivation.
Let's explicitly release the context to make sure the subsequent
loopback device detaching works cleanly.
2020-08-18 12:41:26 +02:00
Lennart Poettering 6d7b47eb3e homework: correct error passed into log message 2020-08-18 12:41:22 +02:00
Lennart Poettering a2a8a509cd homework: sync everything to disk before we rename LUKS loopback file into place
This how this works on Linux: when atomically creating a file we need to
fully populate it under a temporary name and then when we are fully
done, sync it and the directory it is contained in, before renaming it
to the final name.
2020-08-18 12:41:18 +02:00
Luca Boccassi efc3b12fdb tree-wide: enable/disable libcrypsetup debug output depending on our level
Avoid always setting to debug, as it will incur in many more callbacks from
libcrypsetup that then get discarded, wasting resources.
2020-08-14 15:26:04 +01:00
Lennart Poettering 11579a956d home: use ID128_UUID_STRING_MAX where appropriate 2020-08-04 12:40:34 +02:00
Luca Boccassi 536879480a dm-util: use CRYPT_DEACTIVATE_DEFERRED instead of ioctl 2020-07-21 23:26:41 +01:00
Lennart Poettering 7b78db28e5 homed: add support for authenticating with fido2 hmac-secret tokens 2020-07-01 11:17:28 +02:00
Zbigniew Jędrzejewski-Szmek 201632e314 tree-wide: s/time-out/timeout/g
See 3f9a0a522f for justification.
2020-05-26 10:28:59 +02:00
Tudor Roman 6a220cdb0b home: respect user record mount flags 2020-05-24 22:48:50 +02:00
Lennart Poettering c8f145adbb homed: don't insist on authentication against host-copy user record
homed maintains two or three copies of the user's identity record per
home directory: one on the host, one inside the LUKS header, and one
embedded in the home directory.

Previously we'd insist that if a user logs in they have to authenticate
against all three, as a safety feature. This broke logging into
unfixated records however, since in that case the host version is
synthetic and thus does not carry any authentication data.

Let's hence losen the strictness here: accept authentication against
host records that carry no auth data. This should be safe as we know
after all that the second/third record will catch invalid accesses.

Fixes: #15178
2020-05-21 23:39:30 +02:00
Lennart Poettering c07bf7a4ed homed: move supported_fstype() to home-util.c
That way we can use it from other modules too. Just some shifting
around, no change in behaviour.
2020-05-07 23:33:04 +02:00
Lennart Poettering 28a7f10620 homework: run fitrim or fallocate on logout based on the new user record property 2020-05-07 16:13:07 +02:00
Lennart Poettering 0be94a199e homed: when creating home directory as btrfs inside luks volume, place subvol inside it
When managing a home directory as LUKS image we currently place a
directory at the top that contains the actual home directory (so that
the home directory of the user won't be cluttered by lost-found and
suchlike). On btrfs let's make that a subvol though. This is a good idea
so that possibly later on we can make use of this for automatic history
management.

Fixes: #15121
2020-04-09 12:13:11 +02:00
Lennart Poettering e46f877c5c homed: fall back to ftruncate() if fallocate() is not supported on backing fs
This means "discard" mode is enabled implicitly on such simpler backing
fs.

Fixes: #15059
2020-04-01 18:19:07 +02:00
Vito Caputo 80ace4f25e home: fix several typos 2020-03-31 15:16:36 +02:00
Lennart Poettering 70a5db5822 home: add new systemd-homed service that can manage LUKS homes
Fixes more or less: https://bugs.freedesktop.org/show_bug.cgi?id=67474
2020-01-28 22:36:07 +01:00