Age | Commit message (Collapse) | Author |
|
Make sure all variable-length inputs are properly terminated or that
their length is encoded in some way. This avoids ambiguity of
adjacent inputs.
E.g., in case of a hash function taking two strings, compressing "ab"
followed by "c" is now distinct from "a" followed by "bc".
|
|
All our hash functions are based on siphash24(), factor out
siphash_init() and siphash24_finalize() and pass the siphash
state to the hash functions rather than the hash key.
This simplifies the hash functions, and in particular makes
composition simpler as calling siphash24_compress() repeatedly
on separate chunks of input has the same effect as first
concatenating the input and then calling siphash23_compress()
on the result.
|
|
|
|
This allows the input to siphash24_compress to be decomposed into
smaller chunks and the function to be called on each individual
chunk.
|
|
finalization step
The last compression is special as it deals with the length byte, and padding. Move
it to the finalization step in preparation for making compression decomposable.
|
|
|
|
|
|
Encapsulate the four state variables in a struct so we can more easily pass
them around.
|
|
The internal speaker is usually not available on modern latops that
support suspend, and even if it is available in the hardware, most
distributions turned support for it off in the kernel. And even if it is
enabled, it's probably still a bad idea to make use of it for the
suspend-failures. If anything a proper sound should be played.
Long story short, let's remove support of this anachronism.
|
|
logging fixes and more
|
|
Shell completion tweaks
|
|
Let's clean up our tree a bit, and reduce invocations of the
thread-unsafe strerror() by replacing it with printf()'s %m specifier.
|
|
|
|
extract_first() already skips trailing whitespace, hence no reason to
explicitly check for it.
|
|
It's pretty untypical for our parsing functions to log on their own.
Clarify in the name that this one does.
|
|
Also, make sure it follows the same scheme as log_syntax() does in its
behaviour.
|
|
- Rely everywhere that we use abs() on the error code passed in anyway,
thus don't need to explicitly negate what we pass in
- Never attach synthetic error number information to log messages. Only
log about errors we *receive* with the error number we got there,
don't log any synthetic error, that don#t even propagate, but just eat
up.
- Be more careful with attaching exactly the error we get, instead of
errno or unrelated errors randomly.
- Fix one occasion where the error number and line number got swapped.
- Make sure we never tape over OOM issues, or inability to resolve
specifiers
|
|
[v2] bootchart: don't fail if "model name" is missing from cpuinfo
|
|
If we just return the value we got from log_level_from_string() on
failure we'll return -1, which is not a proper error code.
log_set_target_from_string() did get this right already, hence let's fix
this here too.
|
|
All users of get_status_field() expect the field pattern to occur in
the beginning of a line, and the delimiter is ':'.
Hardcode this into the function, and also skip any whitespace before ':'
to support fields in files like /proc/cpuinfo. Add support for returning
the full field value (currently stops on first whitespace).
Rename the function so it's easier to ensure all callers switch to new
semantics.
|
|
Systemctl and more
|
|
Make it generic, call it strv_skip() and move it to strv.[ch]
|
|
This introduces a new systemd.crash_reboot=1 kernel command line option
that triggers a reboot after crashing.
This also cleans up crash VT handling. Specifically, it cleans up the
configuration setting, to be between 1..63 or a boolean. This is to
replace the previous logic where "-1" meant disabled. We continue to
accept that setting, but only document the boolean syntax instead.
This also brings the documentation of the default settings in sync with
what actually happens.
The CrashChVT= configuration file setting is renamed to CrashChangeVT=,
following our usual logic of not abbreviating unnecessarily. The old
setting stays support for compat reasons.
Fixes #1300
|
|
|
|
prioq: drop stability guarantee
|
|
This also allows us to drop build.h from a ton of files, hence do so.
Since we touched the #includes of those files, let's order them properly
according to CODING_STYLE.
|
|
This is highly complex code after all, we really should make sure to
only keep one implementation of this extremely difficult function
around.
|
|
Let's teach it a new trick, and make it return NULL.
|
|
Also, make it slightly more powerful, by accepting a flags argument, and
make it safe for handling if more than one cmsg attribute happens to be
attached.
|
|
Skip shuffling identical entries in shuffle_up(), just like we already do
in shuffle_down().
|
|
Add comment to prioq.c explaining what it does. And more importantly,
mention that we implement a Heap. It's more than annoying having to
figure out what the code actually does, without ever mentioning the word
'heap'.
|
|
|
|
Preparation to allow systemctl to query the list of unit states.
|
|
Use the new code in config_parse_cpu_affinity2.
Tested by modifying CPUAffinity=... setting in /etc/systemd/system.conf
and reloading the daemon, then checking ^Cpus_allowed in /proc/1/status
to confirm the correct CPU mask is in place.
|
|
Introduce personality support for Linux on z Systems to run
particular services with a 64-bit or 31-bit personality.
|
|
Add fallback for kcmp() in case __NR_kcmp is undefined
|
|
IA64 is missing this syscall as of linux-4.2.
This works around it until the necessary kernel patch gets merged.
|
|
|
|
A variety of mostly unrelated fixes
|
|
No need to keep both functions, settle on uid_is_valid() for everything.
|
|
Of course, because Linux is broken we cannot actually really order it,
and must keep linux/fs.h after sys/mount.h... Yay for Linux!
|
|
Never log when we fail due to OOM when translating enums, let the caller
do that. Translating basic types like enums should be something where
the caller logs, not the translatior functions.
Return -1 when NULL is passed to all enum parser functions.
The non-fallback versions of the enum translator calls already handle
NULL as failure, instead of hitting an assert, and we should do this
here, too.
|
|
When 0 bytes are to be written, make sure to go into read() at least
once, in order to validate the parameters, such as the passed fd.
Return error on huge values, add a couple of asserts and casts where
appropriate.
|
|
Let's underline the header line of the table shown by cgtop, how it is
customary for tables. In order to do this, let's introduce new ANSI
underline macros, and clean up the existing ones as side effect.
|
|
|
|
|
|
|
|
Introduce two new helpers that send/receive a single fd via a unix
transport. Also make nspawn use them instead of hard-coding it.
Based on a patch by Krzesimir Nowak.
|
|
cgroup: add support for net_cls controllers
|
|
It's nicer if the assertion failure message from a bad use of xsprintf
actually mentions xsprintf instead of the expression the macro is
implemented as.
The assert_message_se macro was added in the previous commit as an
internal helper, but it can also be used for customizing assertion
failure messages like in this case.
Example:
char buf[10];
xsprintf(buf, "This is a %s message.\n", "long");
Before:
Assertion '(size_t) snprintf(buf, ELEMENTSOF(buf), "This is a %s
message.\n", "long") < ELEMENTSOF(buf)' failed at foo.c:6, function
main(). Aborting.
After:
Assertion 'xsprintf: buf[] must be big enough' failed at foo.c:6,
function main(). Aborting.
|