summaryrefslogtreecommitdiff
path: root/src/home
Commit message (Collapse)AuthorAgeFilesLines
* homed: move away from basename()Lennart Poettering2022-12-231-8/+8
|
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-1912-36/+36
| | | | | | | | | | | | | | | | -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.
* Implement SYSTEMD_HOME_MKFS_OPTIONS_* envvars to configure mkfs options for ↵Aidan Dang2022-12-151-1/+24
| | | | homed LUKS directories
* treewide: drop "RUN_" from "RUN_WITH_UMASK"Zbigniew Jędrzejewski-Szmek2022-12-131-1/+1
| | | | | | RUN_WITH_UMASK was initially conceived for spawning externals progs with the umask set. But nowadays we use it various syscalls and stuff that doesn't "run" anything, so the "RUN_" prefix has outlived its usefulness.
* Implement --luks-pbkdf-force-iterations for homedAidan Dang2022-12-062-1/+9
|
* tree-wide: fix typoYu Watanabe2022-12-021-1/+1
|
* blkid-util: define enum for blkid_do_safeprobe() return valuesLennart Poettering2022-12-011-6/+10
| | | | | | libblkid really should define an enum for this on its own, but it currently doesn't and returns literal numeric values. Lets make this more readable by adding our own symbolic names via an enum.
* tree-wide: use errno_or_else() more, instead of homegrown checksLennart Poettering2022-12-011-5/+5
|
* blkid: add helpers that get gpt partition uuid as sd_id128_tLennart Poettering2022-11-291-10/+6
| | | | just some refactoring to make things simpler.
* fdisk: introduce common fdisk_new_context_fd() helperLennart Poettering2022-11-261-27/+5
| | | | | We do the same thing over and over again and it's a bit ugly, hence let's unify the code for it at one common place.
* homed: handle EINTR gracefully when waiting for device nodeLennart Poettering2022-11-221-2/+5
|
* tmpfile-util: Introduce fopen_temporary_child()Daan De Meyer2022-11-171-1/+1
| | | | | | | Instead of having fopen_temporary() create the file either next to an existing file or in tmp/, let's split this up clearly into two different functions, one for creating temporary files next to existing files, and one for creating a temporary file in a directory.
* nulstr-util: Declare NULSTR_FOREACH() iterator inlineDaan De Meyer2022-11-111-2/+0
|
* copy: Support passing a deny list of files/directories to not copyDaan De Meyer2022-11-101-1/+1
|
* Rename def.h to constants.hZbigniew Jędrzejewski-Szmek2022-11-081-1/+1
| | | | | | The name "def.h" originates from before the rule of "no needless abbreviations" was established. Let's rename the file to clarify that it contains a collection of various semi-related constants.
* basic: move version() to build.h+cZbigniew Jędrzejewski-Szmek2022-11-081-0/+1
|
* homed: properly initialize all return paramsLennart Poettering2022-10-241-0/+1
|
* Merge pull request #24933 from keszybz/erradicate-strerrorLuca Boccassi2022-10-111-219/+141
|\ | | | | Erradicate strerror
| * pam_systemd_home: use pam_syslog_pam_error()Zbigniew Jędrzejewski-Szmek2022-10-111-151/+104
| | | | | | | | | | | | | | The message in acquire_home() was looking at the wrong variable ('r' instead of 'acquired_fd'). Apart from that, no change in behaviour is intended.
| * pam_systemd_home: use pam_syslog_errno()Zbigniew Jędrzejewski-Szmek2022-10-111-65/+36
| | | | | | | | Like in the previous commit, the return code on error might be changed.
| * pam_systemd_home: inline loop variable declarationZbigniew Jędrzejewski-Szmek2022-10-071-3/+1
| |
* | tree-wide: add ERRNO_IS_XATTR_ABSENT() helperLennart Poettering2022-10-102-2/+2
| | | | | | | | | | We check the same list of error codes on various xattr operations, and we should on some more. Add a common helper for this purpose.
* | Implement --luks-sector-size for homedAidan Dang2022-10-072-3/+49
|/
* Merge pull request #24829 from yuwata/blockdev-new-from-fdLuca Boccassi2022-09-301-1/+1
|\ | | | | blockdev-util: introduce block_device_new_from_fd() and _path()
| * loop-util: rename loop_device_open() -> loop_device_open_from_path()Yu Watanabe2022-09-281-1/+1
| | | | | | | | No functional changes, just preparation for later commits.
* | generator: skip fsck if fsck command is missingJonas Kümmerlin2022-09-301-1/+1
|/ | | | | | | | | | | This is useful for systems which don't have any fsck. We already skip emitting the fsck dependency when the fsck.$fstype helper is missing, but fstab-generator doesn't necessarily know the fstype when handling the root= parameter. Previously, systemd-fsck was started for these mounts and then exited immediately because it couldn't find the fsck.$fstype helper.
* Merge pull request #24709 from keszybz/partition-table-constantsLennart Poettering2022-09-212-3/+3
|\ | | | | Expose various GPT UUIDs as public contants and link them up in docs
| * headers: export partition uuids and flags in new sd-gpt.h fileZbigniew Jędrzejewski-Szmek2022-09-202-3/+3
| | | | | | | | | | | | I think those constants are generally useful. It's quite easy to make a mistake when copying things from the docs, so let's make them easy and convenient to access.
* | shared: Add squashfs support to make_filesystem()Daan De Meyer2022-09-211-1/+1
| | | | | | | | | | The caveat is that the caller has to provide a source directory to initialize the squashfs filesystem from.
* | fd-util: rename CLOSE_AND_REPLACE() -> close_and_replace()Yu Watanabe2022-09-171-2/+1
|/ | | | | | | | We have free_and_replace() and friends, they are all named with lower letters, even they are macros, not functions. For consistency, let's rename CLOSE_AND_REPLACE() with lower letters. This also mekes the macro used more places.
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-138-104/+48
|
* homed: don't wait indefinitely for workers on exitLennart Poettering2022-09-051-1/+9
| | | | | | Let's put some time-limit on it. Fixes: #22901
* loop-util: rework how we lock loopback block devicesLennart Poettering2022-09-011-7/+3
| | | | | | | | | | | | | | | | | | | | Let's rework how we lock loopback block devices in two ways: 1. Lock a separate fd, instead of the main block device fd. We already did that for our internal locking when allocating loopback block devices, but do so for the exposed locking (i.e. loop_device_flock()), too, so that the lock is independent of the main fd we actually use of IO. 2. Instead of locking the device during allocation of the loopback device, then unlocking it (which will make udev run), and then re-locking things if we need, let's instead just keep the lock the whole time, to make things a bit safer and faster, and not have to wait for udev at all. This is done by adding a "lock_op" parameter to loop device allocation functions that declares the initial state of the lock, and is one of LOCK_UN/LOCK_SH/LOCK_EX. This change also shortens a lot of code, since we allocate + immediately lock loopback devices pretty much everywhere.
* tree-wide: Use correct format specifiersJan Janssen2022-08-301-2/+2
| | | | gcc will complain about all these with -Wformat-signedness.
* homed: don't use stat() data from an unrelated inodeLennart Poettering2022-08-301-1/+1
| | | | | This doesn't really change anything, since we know the stat data used here also contains S_IFBLK, but it's frickin' confusing.
* tree-wide: use devpath_from_devnum() and device_open_from_devnum()Yu Watanabe2022-08-281-8/+3
| | | | Fixes #24465.
* tree-wide: port things dirname_malloc() → path_extract_directory()Lennart Poettering2022-08-232-8/+12
|
* home: drop conflicted headersYu Watanabe2022-07-264-2/+9
| | | | Fixes #24117.
* homed: fix dbus node enumeratorYu Watanabe2022-07-261-0/+2
| | | | Fixes #24114.
* tree-wide: link to docs.kernel.org for kernel documentationnl67202022-07-041-1/+1
| | | | | | | https://www.kernel.org/ links to https://docs.kernel.org/ for the documentation. See https://git.kernel.org/pub/scm/docs/kernel/website.git/commit/?id=ebc1c372850f249dd143c6d942e66c88ec610520 These URLs are shorter and nicer looking.
* Merge pull request #23886 from keszybz/https-links-kernelYu Watanabe2022-07-031-3/+3
|\ | | | | tree-wide: use html links for kernel docs
| * tree-wide: use html links for kernel docsZbigniew Jędrzejewski-Szmek2022-07-021-3/+3
| | | | | | | | Instead of using "*.txt" as reference name, use the actual destination title.
* | Merge pull request #23865 from keszybz/drop-memcpy-callZbigniew Jędrzejewski-Szmek2022-07-021-2/+2
|\ \ | |/ |/| sd-id128: avoid an unnecessary function call in inline helper
| * homework: silence gcc warningZbigniew Jędrzejewski-Szmek2022-07-021-2/+2
| | | | | | | | | | | | gcc was warning that found_fs_uuid was used unitialized. The issue stemmed from the call to open(), where gcc seemingly didn't know that errno must be negative. When that is set, we can drop some unnecessary initializations without warnings.
* | sd-id128: rename and export sd_id128_string_equal()Zbigniew Jędrzejewski-Szmek2022-06-302-3/+5
| | | | | | | | | | | | | | | | We find this function useful in our code, so no reason not to export it. I changed the order of last two words in the name to match the arguments. (With "equal_string" I expected sd_id128_t first, string second, but in actual use, the second argument is usually a long constant so it's nice to keep this order of arguments.)
* | Merge pull request #23821 from dtardon/ascii-loggingYu Watanabe2022-06-295-9/+24
|\ \ | | | | | | Allow ASCII fallback for Unicode characters in logs
| * | tree-wide: allow ASCII fallback for … in logsDavid Tardon2022-06-281-4/+8
| | |
| * | tree-wide: allow ASCII fallback for → in logsDavid Tardon2022-06-284-5/+16
| |/
* | Use https for freedesktop.orgMichael Biebl2022-06-282-2/+2
|/ | | | grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
* homework: initialize we_detachedShreenidhi Shedi2022-06-141-7/+4
| | | | | | | Fixes: CID#1469711 CID 1469711 (#1 of 1): Uninitialized scalar variable (UNINIT) 14. uninit_use: Using uninitialized value we_detached.