| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
just some refactoring to make things simpler.
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|\
| |
| | |
Erradicate strerror
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Like in the previous commit, the return code on error might be changed.
|
| | |
|
| |
| |
| |
| |
| | |
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.
|
|/ |
|
|\
| |
| | |
blockdev-util: introduce block_device_new_from_fd() and _path()
|
| |
| |
| |
| | |
No functional changes, just preparation for later commits.
|
|/
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Expose various GPT UUIDs as public contants and link them up in docs
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
The caveat is that the caller has to provide a source directory
to initialize the squashfs filesystem from.
|
|/
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
Let's put some time-limit on it.
Fixes: #22901
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
gcc will complain about all these with -Wformat-signedness.
|
|
|
|
|
| |
This doesn't really change anything, since we know the stat data used
here also contains S_IFBLK, but it's frickin' confusing.
|
|
|
|
| |
Fixes #24465.
|
| |
|
|
|
|
| |
Fixes #24117.
|
|
|
|
| |
Fixes #24114.
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
tree-wide: use html links for kernel docs
|
| |
| |
| |
| | |
Instead of using "*.txt" as reference name, use the actual destination title.
|
|\ \
| |/
|/| |
sd-id128: avoid an unnecessary function call in inline helper
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.)
|
|\ \
| | |
| | | |
Allow ASCII fallback for Unicode characters in logs
|
| | | |
|
| |/ |
|
|/
|
|
| |
grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
|
|
|
|
|
|
|
| |
Fixes: CID#1469711
CID 1469711 (#1 of 1): Uninitialized scalar variable (UNINIT)
14. uninit_use: Using uninitialized value we_detached.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* Some authenticators(like Yubikey) support credential algorithm other than ES256
* Introduce a new option so users can make use of it
|
|
|
|
| |
And port some parts over.
|