summaryrefslogtreecommitdiffstats
path: root/src/home (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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-291-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-021-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-285-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.
* Simplify random number selectionJason A. Donenfeld2022-05-313-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have a convoluted and complex selection of which random numbers to use. We can simplify this down to two functions that cover all of our use cases: 1) Randomness for crypto: this one needs to wait until the RNG is initialized. So it uses getrandom(0). If that's not available, it polls on /dev/random, and then reads from /dev/urandom. This function returns whether or not it was successful, as before. 2) Randomness for other things: this one uses getrandom(GRND_INSECURE). If it's not available it uses getrandom(GRND_NONBLOCK). And if that would block, then it falls back to /dev/urandom. And if /dev/urandom isn't available, it uses the fallback code. It never fails and doesn't return a value. These two cases match all the uses of randomness inside of systemd. I would prefer to make both of these return void, and get rid of the fallback code, and simply assert in the incredibly unlikely case that /dev/urandom doesn't exist. But Luca disagrees, so this commit attempts to instead keep case (1) returning a return value, which all the callers already check, and fix the fallback code in (2) to be less bad than before. For the less bad fallback code for (2), we now use auxval and some timestamps, together with various counters representing the invocation, hash it all together and provide the output. Provided that AT_RANDOM is secure, this construction is probably okay too, though notably it doesn't have any forward secrecy. Fortunately, it's only used by random_bytes() and not by crypto_random_bytes().
* stat-util: fix dir_is_empty() with hidden/backup filesLennart Poettering2022-05-042-2/+2
| | | | | | | | | | | | | | | | | | | | This is a follow-up for f470cb6d13558fc06131dc677d54a089a0b07359 which in turn is a follow-up for a068aceafbffcba85398cce636c25d659265087a. The latter started to honour hidden files when deciding whether a directory is empty. The former reverted to the old behaviour to fix issue #23220. It introduced a bug though: when a directory contains a larger number of hidden entries the getdents64() buffer will not suffice to read them, since we just allocate three entries for it (which is definitely enough if we just ignore the . + .. entries, but not ig we ignore more). I think it's a bit confusing that dir_is_empty() can return true even if rmdir() on the dir would return ENOTEMPTY. Hence, let's rework the function to make it optional whether hidden files are ignored or not. After all, I looking at the users of this function I am pretty sure in more cases we want to honour hidden files.
* cryptenroll,homectl: Introduce --fido2-credential-algorithm optionMkfsSion2022-04-223-4/+19
| | | | | * Some authenticators(like Yubikey) support credential algorithm other than ES256 * Introduce a new option so users can make use of it
* devnum-util: define helper macros for formatting devnum major/minor pairsLennart Poettering2022-04-131-3/+3
| | | | And port some parts over.