| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
This object takes a number of bpf_insn members and wraps them together with
the in-kernel reference id. Will be needed by the firewall code.
|
|
|
|
|
|
| |
This is much like in_addr_prefix_from_string(), but automatically
determines whether IPv4 or IPv6 addresses are specified. Also adds a
test for it.
|
|
|
|
|
| |
Less deviation between test runs and normal runs is always a good idea,
hence enable more stuff that is safe in test runs
|
|
|
|
|
|
|
| |
This doesn't really matter, as we never invalidate cpuacct explicitly,
and there's no real reason to care for it explicitly, however it's
prettier if we always treat cpu and cpuacct as belonging together, the
same way we conisder "io" and "blkio" to belong together.
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixup for f4b51a2d09. Suggested by Evgeny Vereshchagin.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Let's use read_line() to solve our long line limitation.
Fixes #3302.
|
|
|
|
|
|
|
| |
This function is pretty important, but we weren't calling it directly
even once in tests.
v2: add a few tests for escaping and line continuations
|
|
|
|
|
| |
if there was something in the read buffer already errno might not be set
on error, let's detect that case.
|
|
|
|
|
|
|
|
| |
Let's read one byte more than the file size we read from stat() on the
first fread() invocation. That way, the first read() will already be
short and indicate eof to fread().
This is a minor optimization, and replaces #3908.
|
|
|
|
|
|
| |
That way, write_string_stream_ts() becomes more powerful, and we can
remove duplicate code from write_string_file_atomic() and
write_string_file_ts().
|
|
|
|
|
|
| |
Let's make write_string_stream() and write_string_file() more alike, and
pass the same flag set so that we can remove a number of boolean
parameters.
|
|
|
|
|
| |
Let's make sure "ts" is taken into account when writing atomic files,
too.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
LONG_LINE_MAX is much like LINE_MAX, but longer.
As it turns out LINE_MAX at 4096 is too short for many usecases. Since
the general concept of having a common maximum line length limit makes
sense let's add our own, and make it larger (1MB for now).
|
|
|
|
|
|
|
| |
read_line() is much like getline(), and returns a line read from a
FILE*, of arbitrary sizes. In contrast to gets() it will grow the buffer
dynamically, and in contrast to getline() it will place a user-specified
boundary on the line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On cgroupsv2 we should also chown()/chmod() the subtree_control file,
so that children can use controllers the way they like.
On cgroupsv1 we should also chown()/chmod() cgroups.clone_children, as
not setting this for new cgroups makes little sense, and hence delegated
clients should be able to write to it.
Note that error handling for both cases is different. subtree_control
matters so we check for errors, but the clone_children/tasks stuff
doesn't really, as it's legacy stuff. Hence we only log errors and
proceed.
Fixes: #6216
|
|
|
|
|
|
|
| |
These errors don't really matter, that's why we log and proceed in the
current code. However, we currently log at LOG_WARNING, but we really
shouldn't given that this is library code. Hence downgrade this to
LOG_DEBUG.
|
|
|
|
|
| |
after that wm_day etc. seems to be changed. Moving the check infront of
the mktime_or_timegm fixes that.
|
|
|
|
|
|
|
|
|
|
| |
The timezone was cut off the string once the timezone was not UTC.
If it is not UTC but a other timezone that matches tzname[0] or
tzname[1], then we can leave it to the impl function to parse that
correctly. If not we can just fallback to whatever is the current
timezone is in the given t_timezone.
This should fix the testuite and tests.
|
|
|
|
|
|
| |
Reported by Marcos Mello.
Fixes #6882.
|
|
|
|
|
| |
timezone was shadowing timezone from time.h which leads to a buildbreak
since elogind is built with -Werror
|
|
|
|
|
|
|
|
|
|
| |
Now generators are only run in elogind --test mode, where this makes
most sense (how are you going to test what would happen otherwise?).
Fixes #6842.
v2:
- rename test_run to test_run_flags
|
|
|
|
|
|
| |
This makes it possible to run more dbus tests in a build
environment/chroot where no system bus is available.
To run the dbus test one then can use dbus-run-session.
|
|
|
|
|
|
| |
A test for #6831. Fails without the previous commit.
Suggested by Evgeny Vereshchagin.
|
|
|
|
| |
Fixes #6831.
|
|
|
|
|
|
|
|
|
| |
It's confusing to use a single void* to store data with two different
types, i.e. a userdata value which is safe to pass to ->find(), and a
userdata value which identifies the found object.
Name the latter `found_u`. This naming treats (!c->find) as a degenerate
case. (I.e. at that point, we know the object has already been found :).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this commit, if you run `loginctl user-status` from
debug-shell.service (and you have no login sessions for root), you always
see this output:
0
Linger: no
because Properties.GetAll is returning success but without any properties,
when the only find() callback had returned 0 to mean "no object found".
After:
Could not get properties: Unknown object:
'/org/freedesktop/login1/user/self'
BTW I have a fix for more user-friendly messages from logind in this case.
It is pending in my local branch for #6829 "fix `loginctl enable-linger`".
|
|
|
|
|
|
|
|
|
| |
The problem was with the tm.tm_isdst that is set to the current environment
value: either DST or not. While the current state is not relevant to the state
in the desired date.
Hence — it should be reset so that the mktime_or_timegm could normalise it
later.
|
|
|
|
| |
Just to reduce the indentation a bit.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Usually, it's a good thing that we isolate the kernel session keyring
for the various services and disconnect them from the user keyring.
However, in case of the cryptsetup key caching we actually want that
multiple instances of the cryptsetup service can share the keys in the
root user's user keyring, hence we need to be able to disable this logic
for them.
This adds KeyringMode=inherit|private|shared:
inherit: don't do any keyring magic (this is the default in elogind --user)
private: a private keyring as before (default in elogind --system)
shared: the new setting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Routing Policy rule manipulates rules in the routing policy database control the
route selection algorithm.
This work supports to configure Rule
```
[RoutingPolicyRule]
TypeOfService=0x08
Table=7
From= 192.168.100.18
```
```
ip rule show
0: from all lookup local
0: from 192.168.100.18 tos 0x08 lookup 7
```
V2 changes:
1. Added logic to handle duplicate rules.
2. If rules are changed or deleted and networkd restarted
then those are deleted when networkd restarts next time
V3:
1. Add parse_fwmark_fwmask
|
|
|
|
|
| |
Let's support assigning the empty string to reset things in one more
place.
|
|
|
|
|
|
|
|
|
| |
config_parse_strv()
This was added to make
https://bugs.freedesktop.org/show_bug.cgi?id=62558 work, which has long
been removed, hence let's revert to the original behaviour and fully
flush out the list when an empty string is assigned.
|
|
|
|
| |
Follow up for fe102d6ab15731a199a7ea9f38c4f68d8959f86c.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As it turns out the authentication phase times out too often than is
good, mostly due to PRNG pools not being populated during boot. Hence,
let's increase the authentication timeout from 25s to 90s, to cover for
that.
(Note that we leave the D-Bus method call timeout at 25s, matching the
reference implementation's value. And if the auth phase managed to
complete then the pools should be populated enough and mehtod calls
shouldn't take needlessly long anymore).
Fixes: #6418
|
| |
|
| |
|
|
|
|
| |
Fixes: #6787
|
|
|
|
|
|
|
|
| |
We make copies (without O_CLOEXEC) of the fds anyway before using them,
hence let's be safe and create them with O_CLOEXEC first, so that we
don't run into issues should pager_open() be called in a threaded
environment where another thread fork()s at the wrong time and ends up
with fds not marked O_CLOEXEC.
|
|
|
|
|
|
|
| |
The linux console apparently can't do underlining, hence let's not do it
on the console.
Also see: #6601
|
|
|
|
|
|
|
|
|
| |
glibc appears to propagate different errors in different ways, let's fix
this up, so that our own code doesn't get confused by this.
See #6752 + #6737 for details.
Fixes: #6755
|