summaryrefslogtreecommitdiffstats
path: root/src/home/homework.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* homework: Cleanup home_store_embedded_identityAdrian Vovk2024-01-181-1/+1
| | | | | This function took an extra argument that it never used. This commit cleans that up
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-191-2/+2
| | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* home: drop conflicted headersYu Watanabe2022-07-261-1/+2
| | | | Fixes #24117.
* homework: don't try to shift uidmap for already activated home areasLennart Poettering2021-11-241-2/+2
| | | | | | | | | | | | | | When we want to operate on an already activated home area we so far tried to reapply the uidmapping logic. We shouldn't do that, it's already applied after all. We only want to apply this for newly activated home areas. Hence check for the right HomeSetupFlags flag for it HOME_SETUP_ALREADY_ACTIVATED. The patch is actually in theory a two-liner. Except that so far we don#t pass the HomeSetupFlags flags down all necessary functions where the uidmap stuff will eventually run. Hence this larger than intended commit.
* homework: upload home password into kernel keyring if neededLennart Poettering2021-11-231-0/+7
| | | | | | | | | If we do automatic disk space rebalancing, we must be able to unlock the encrypted volume for that in the background, thus we need to decryption key around in userspace. Let's do this via the kernel keyring. This allows us to do this in a relatively secure way, so that it sticks around between homework invocations, but still is destroyed automatically when homed goes down.
* homework: make destroying of HomeSetup optional when resizingLennart Poettering2021-11-191-0/+1
| | | | | | This will be useful when we want to issue a resize operation right when activating, where the HomeSetup object should be destroyed only after both activation is done.
* homework: beef up luks resize logic to allow "minimizing" homesLennart Poettering2021-11-161-0/+3
|
* homework: make sync of identies when resizing homes optionalLennart Poettering2021-11-161-2/+5
| | | | This is preparation for resizing automatically at login and logout.
* homed: wait for luks devices to go awayLennart Poettering2021-11-161-2/+2
| | | | | Let's make sure LUKS volumes are really definitely gone before we retun in the deactivation logic.
* homework: split out password cache logic into its own .c/.h fileLennart Poettering2021-11-131-17/+1
| | | | Preparation for extending it further down the line.
* homework: move destruction of temporary image file into HomeSetupLennart Poettering2021-10-281-0/+2
| | | | | | Let's simplify things further a bit and move the destruction of the temporary image file we operate on when creating a LUKS home into HomeSetup, like all our other resources.
* homework: always pass HomeSetup param first, PasswordCache secondLennart Poettering2021-10-281-1/+1
| | | | | Some of our operations did it one way, most the other. Let's unify on the order that is more popular.
* homework: move all DM detachment/freeing into HomeSetupLennart Poettering2021-10-281-0/+1
| | | | | | We actually already detach/free the LUKS DM devices for most operations via HomeSetup, let's move the creation logic to also do this, in order to unify behaviour between operations.
* Merge pull request #21162 from poettering/homed-cifs-improvementsLennart Poettering2021-10-281-0/+5
|\ | | | | homed: various cifs backend improvements
| * homework: allow specifying a dir component in CIFS servicesLennart Poettering2021-10-271-0/+5
| | | | | | | | | | | | | | | | | | | | Allow specifying CIFS services in the format //host/service/subdir/… to allow multiple homedirs on the same share, and not in the main dir of the share. All other backends allow placing the data store at arbitrary places, let's allow this too for the CIFS backend. This is particularly useful for testing.
* | homework: add new helper home_setup_undo_mount()Lennart Poettering2021-10-271-0/+2
|/
* homework: support uidmapping in the "directory" backendLennart Poettering2021-10-271-0/+1
|
* homework: use bit fields where we deal with lots of separate boolean flagsLennart Poettering2021-10-221-6/+6
| | | | No actual code changes, just making a structure a bit shorter.
* homework: add macro for "/run/systemd/user-home-mount"Lennart Poettering2021-10-221-0/+2
| | | | | | | We use this work dir a various places, and it's easy to mistype, hence let the compiler detect this for us, and introduce a macro for it. No code changes, just some search/replace.
* homework: mae sure PasswordCache is really optionalLennart Poettering2021-10-181-1/+10
| | | | | | It was supposed to be optional (i.e. there's a reason why we never assert()ed on it), and in many codepaths it is, let's make sure it is everywhere.
* homed: replace "already_activated" boolean parameter by a flags valueLennart Poettering2021-10-171-1/+6
| | | | | | | This is mostly preparation for further defined flags to be added in later PRs/commits. No change in behaviour just the flagsification.
* homed: rename home_setup_undo() → home_setup_done()Lennart Poettering2021-10-161-1/+1
| | | | | | | | | | | | | This function is a destructor, hence it should be named like one. (We usually use xyz_free() for a destructor that frees the object passed itself. xyz_unref() we typically use for destructors that are similar, but ref counted. xyz_done() usually is used for destructors which free the members of an object, but not the object itself – to allow stack allocation of objects. We don't strictly follow this, but it's good to stick to rules wherever we can.) No actual code change, just renaming.
* homed: rename home_prepare*() → home_setup*()Lennart Poettering2021-10-161-1/+1
| | | | | | | | | These set of functions are constructors for an object called HomeSetup, which has a destructor home_setup_undo(), hence to be reasonably symmetric, let's call it home_setup*() too, instead of using a new verb "prepare" for its name. No actual code changes, just some renaming.
* homed: optionally, drop caches on logoutLennart Poettering2021-10-111-0/+1
| | | | Fixes: #20857
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* homed: mark LUKS loopback file as "dirty" via xattr when in useLennart Poettering2020-08-251-0/+1
| | | | | | | | | | | | | | | 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.
* homed: add support for authenticating with fido2 hmac-secret tokensLennart Poettering2020-07-011-4/+12
|
* homed: don't insist on authentication against host-copy user recordLennart Poettering2020-05-211-1/+1
| | | | | | | | | | | | | | | | | 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
* homework: run fitrim or fallocate on logout based on the new user record ↵Lennart Poettering2020-05-071-0/+4
| | | | property
* home: add new systemd-homed service that can manage LUKS homesLennart Poettering2020-01-281-0/+57
Fixes more or less: https://bugs.freedesktop.org/show_bug.cgi?id=67474