| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let's tweak what we do if we detect a flood of requests to start more
workers: if none of the workers ever sticks (i.e. the worker count is
zero) then let's just give up, as before.
Otherwise, let's just not start more workers for a while, and do so
again after a while. Thus spawning ofr workers will "cool off" for a
while.
Fixes: #27028
|
| |
|
|
|
|
|
|
|
|
|
| |
processes
These requests might come in during lookup floods very quickly, since
multiple worker processes might detect that things should be scaled up
at the same time. Hence, let's substantially raise the limit so that it
doesn't get hit in real-life scenarios and acts more like a safety net.
|
|
|
|
|
|
|
| |
This is a rework of #24764 by Cristian Rodríguez
<crodriguez@owncloud.com>, which stalled.
Instead of assigning -1 we'll use a macro defined to INT_MAX however.
|
|
|
|
| |
Instead of _cleanup_(set_freep) or so.
|
|
|
|
|
|
|
|
|
|
| |
Otherwise, if getopt() and friends are used before parse_argv(), then
the GNU extensions may be ignored.
This should not change any behavior at least now, as we usually use
getopt_long() only once per invocation. But in the next commit,
getopt_long() will be used for other arrays, hence this change will
become necessary.
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise it's quite difficult to capture the entire output:
$ userdbctl ssh-authorized-keys dropinuser --chain /bin/echo hello
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA//dxI2xLg4MgxIKKZv1nqwTEIlE/fdakii2Fb75pG+ foo@bar.tld
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMlaqG2rTMje5CQnfjXJKmoSpEVJ2gWtx4jBvsQbmee2XbU/Qdq5+SRisssR9zVuxgg5NA5fv08MgjwJQMm+csc= hello@world.tld
hello
$ userdbctl ssh-authorized-keys dropinuser --chain /bin/echo hello | tee
hello
|
| |
|
| |
|
|
|
|
|
|
|
| |
Let's modernize userdbd furzer, and use the common child handling we
nowadays have in sd-event, instead of rolling our own.
This also means we'll start using pidfds where we can.
|
| |
|
|
|
|
|
|
|
|
|
| |
Let's make use of SD_EVENT_SIGNAL_PROCMASK so that we don't have to mask
the signals manually. Let's use sd_event_set_exit_signal() instead of
rolling our own SIGTERM/SIGINT handling. Let's use "floating" event
sources instead of keeping references on our own.
Let's also debug log if we can't enable watchdog handling.
|
| |
|
| |
|
|
|
|
|
|
| |
Meson+ninja+compiler do this for us and are better at it.
https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-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.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
(s) is just ugly with a vibe of DOS. In most cases just using the normal plural
form is more natural and gramatically correct.
There are some log_debug() statements left, and texts in foreign licenses or
headers. Those are not touched on purpose.
|
|
|
|
|
|
|
|
|
|
|
|
| |
All users were setting this to some static string (usually "-"), so let's
simplify things by not doing strdup, but instead limiting callers to a fixed
set of values. In preparation for the next commit, the function is renamed from
"empty" to "replacement", because it'll be used for more than empty fields. I
didn't do the whole string-table setup, because it's all used internally in one
file and this way we can immediately assert if an invalid value is passed in.
Some callers were (void)ing the error, others were ignoring it, and others
propagating. It's nicer to remove the boilerplate.
|
|
|
|
|
|
| |
This renames UidRange -> UidRangeEntry, and reintroduces UidRange which
contains the array of UidRangeEntry and its size.
No fucntional changes, just refactoring.
|
| |
|
| |
|
| |
|
|
|
|
| |
ESRCH is literally "No such process".
|
|
|
|
|
| |
Sometimes we want to suppress strerror() message because the are providing
something better. But in those cases, it seems it was just forgotten.
|
|
|
|
| |
Let's make use of our new helper, and thus allow longer paths.
|
| |
|
|
|
|
|
|
|
| |
uid_range_load_userns() dereferences the n parameter.
Passing unitialized memory may lead to crashes, for example with version
251rc2-1 on ArchLinux.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Containers generally have a smaller UID range assigned than host
systems. Let's visualize this in the user/group tables. We insert
markers for unavailable regions. This way display is identical to status
quo ante on host systems, but in containers unavailable ranges will be
shown as that.
And while we are at it, also hide well-known UID ranges when they are
outside of userns uid_map range. This is mostly about the "container"
range. It's pointless showing the cotnainer range (i.e. a range UID >
65535) if that range isn#t available in the container anyway.
|
|
|
|
| |
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
|
|
|
|
|
|
|
|
| |
literal allocated timespec struct
This way we can convert usec_t to timespec on-the-fly, without a buffer.
No actual behaviour change just some shortening of code.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The approach to use '''…'''.split() instead of a list of strings was initially
used when converting from automake because it allowed identical blocks of lines
to be used for both, making the conversion easier.
But over the years we have been using normal lists more and more, especially
when there were just a few filenames listed. This converts the rest.
No functional change.
|
| |
|
| |
|
|
|
|
| |
As in the previous commit, 'de' is used as the iterator variable name.
|
| |
|
| |
|
|
|
|
|
|
| |
correctly
Fixes: #21215 #21222
|
|
|
|
|
| |
We do this in many (most?) other tools, do so here too. It's quite
useful info to count users/groups/…
|
|
|
|
|
|
| |
lookups
This is incredibly useful for debugging.
|
|
|
|
|
| |
Let's add --json= with the same parser as in the other tools, and honour
it.
|
|
|
|
|
|
|
| |
Similar in style to previous commit, let's handle these two errors
properly, i.e. as equivalent to no entries found. Let's debug log about
them, to make things either to deal with when debugging (after all
userdbctl to a large degree are debugging tools).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lower-level userdb code will return ENOLINK if varlink lookups are
disabled explicitly and we couldn#t find an answer any other way. Let's
not propagate this to clients, since they don't have control over this
feature anyway: we decide internally when to disable varlink lookups
(e.g. if DropIn lookups are requested we disable them) and to the client
side that should not be visible: if we can't find a record with the
flags we pick then we should report then we can't find any, and that's
it.
Fixes: #21223
|
| |
|
|
|
|
| |
Fixes https://github.com/systemd/systemd/pull/20613#issuecomment-944621275.
|
|
|
|
| |
Fixes: #20809. Bug introduced in 8fbb1941f1a8c3d9eda920891b2b51a67f2a2375
|