| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
chase_symlinks() would return negative on error, and either a non-negative status
or a non-negative fd when CHASE_OPEN was given. This made the interface quite
complicated, because dependning on the flags used, we would get two different
"types" of return object. Coverity was always confused by this, and flagged
every use of chase_symlinks() without CHASE_OPEN as a resource leak (because it
would this that an fd is returned). This patch uses a saparate output parameter,
so there is no confusion.
(I think it is OK to have functions which return either an error or an fd. It's
only returning *either* an fd or a non-fd that is confusing.)
|
| |
|
|
|
| |
This doesn't cover all the binaries, but I don't know how to script
this, and I run out of steam ;)
|
| |
|
|
|
|
|
| |
For executables which take a verb, we should list the verbs first, and
then options which modify those verbs second. The general layout of
the man page is from general description to specific details, usually
Overview, Commands, Options, Return Value, Examples, References.
|
| |
|
|
|
| |
It's a special case of strjoin(), so no need to keep both. In particular
as typing strjoin() is even shoert than strappend().
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allocating a pty is done in a couple of places so let's introduce a new helper
which does the job.
Also the new function, as well as openpt_in_namespace(), returns both pty
master and slave so the callers don't need to know about the pty slave
allocation details.
For the same reasons machine_openpt() prototype has also been changed to return
both pty master and slave so callers don't need to allocate a pty slave which
might be in a different namespace.
Finally openpt_in_namespace() has been renamed into
openpt_allocate_in_namespace().
|
| | |
|
| |\
| |
| | |
run: when emitting the calendarspec warning, use red
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When emitting the calendarspec warning we want to see some color.
Follow-up for 04220fda5c.
Exceptions:
- systemctl, because it has a lot hand-crafted coloring
- tmpfiles, sysusers, stdio-bridge, etc, because they are also used in
services and I'm not sure if this wouldn't mess up something.
|
| |/ |
|
| |
|
|
|
|
|
|
| |
This is partially a refactoring, but also makes many more places use
unlocked operations implicitly, i.e. all users of fopen_temporary().
AFAICT, the uses are always for short-lived files which are not shared
externally, and are just used within the same context. Locking is not
necessary.
|
| |
|
|
|
| |
We have a function like this at two places already. Let's unify it in
one generic location and let's port a number of users over.
|
| |
|
|
|
| |
At quite a few places we check isempty() || streq(…, "-"), let's add a
helper to simplify that, and replace that by a single function call.
|
| |
|
|
|
| |
This means we need to include many more headers in various files that simply
included util.h before, but it seems cleaner to do it this way.
|
| | |
|
| |
|
|
|
| |
The code is complex enough to deserve its own .c file. Let's split this
out.
|
| |
|
|
|
|
|
| |
It's complex enough and quite a few functions. Let's hence split this
out.
No code change, just some rearranging of source files.
|
| | |
|
| |
|
|
| |
Just some minor reorganiztion.
|
| |
|
|
| |
Closes #11941.
|
| |
|
|
| |
Fixes #11628.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
final ref
This doesn't really change much, but feels more correct to do, as it
ensures that all messages currently queued in the bus connections are
definitely unreffed and thus destryoing of the connection object will
follow immediately.
Strictly speaking this change is entirely unnecessary, since nothing
else could have acquired a ref to the connection and queued a message
in, however, now that we have the new sd_bus_close_unref() helper it
makes a lot of sense to use it here, to ensure that whatever happens
nothing that might have been queued fucks with us.
|
| |
|
|
|
|
|
| |
Let's make sure everything is written out ebfore we exit, so that no
messages keep our bus connections referenced.
Fixes: #11462
|
| |
|
|
|
|
|
|
| |
In all three cases, sd_event_loop() will return the exit code anyway.
If sd_event_loop() returns negative, failure is logged and results in an
immediate return. Otherwise, we don't care if sd_event_loop() returns 0
or positive, because the return value feeds into DEFINE_MAIN_FUNCTION(), which
doesn't make the distinction.
|
| |
|
|
|
|
|
| |
read_line() is a lot more careful and optimized than read_nul_string()
but does mostly the same thing. let's replace the latter by the former,
just with a special flag that toggles between the slightly different EOL
rules if both.
|
| | |
|
| |
|
|
| |
This way, nss-mymachines should always serve authoritative data.
|
| |
|
|
|
|
| |
Let's make sure the first hashmap we destroy also frees all machines,
because otherwise when freeing the other hashmaps we'll try to
deregister the contained machines from the hashmaps already destroyed.
|
| |
|
|
|
|
|
| |
This has been irritating me for quite a while: let's prefix these enum
values with a common prefix, like we do for almost all other enums.
No change in behaviour, just some renaming.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
fdopen doesn't accept "e", it's ignored. Let's not mislead people into
believing that it actually sets O_CLOEXEC.
From `man 3 fdopen`:
> e (since glibc 2.7):
> Open the file with the O_CLOEXEC flag. See open(2) for more information. This flag is ignored for fdopen()
As mentioned by @jlebon in #11131.
|
| |\
| |
| |
| | |
Merged by hand to resolve a trivial conflict in TODO.
|
| | |
| |
| |
| |
| |
| | |
So far we followed to rule that child processes we fork off without
execve() are named "(sd-xyz)", but one child process didn't follow this.
Correct that.
|
| | | |
|
| | | |
|
| |\ \
| | |
| | | |
Tiny coding style fixes
|
| | | | |
|
| | | | |
|
| |/ / |
|
| |\ \
| | |
| | | |
hashmap: make hashmap_free() call destructors of key or value
|
| | | | |
|
| | |/ |
|
| | |
| |
| |
| |
| |
| | |
It's quite complex, let's split this out.
No code changes, just some file rearranging.
|
| |/
|
|
|
|
|
|
| |
This splits out a bunch of functions from fileio.c that have to do with
temporary files. Simply to make the header files a bit shorter, and to
group things more nicely.
No code changes, just some rearranging of source files.
|
| |\
| |
| | |
Add example to nss-mymachines(8)
|
| | |
| |
| |
| |
| |
| |
| | |
We'd print everything jumbled together:
$ machinectl --max-addresses=3
MACHINE CLASS SERVICE OS VERSION ADDRESSES
rawhide container systemd-nspawn fedora 30 169.254.40.164fe80::94aa:3aff:fe7b:d4b9
|
| | |
| |
| |
| |
| | |
It only serves to forward some arguments without modification and is only
used in one place anyway.
|
| |\ \
| |/
|/| |
machinectl import-fs command and other fixes
|
| | |
| |
| |
| |
| |
| |
| | |
Let's use our new path_extract_filename() for extracting the basename
from a path in a safe fashion.
Let's do this for all our three local import calls.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Let's simplify things and drop the logic that /var/lib/machines is setup
as auto-growing btrfs loopback file /var/lib/machines.raw.
THis was done in order to make quota available for machine management,
but quite frankly never really worked properly, as we couldn't grow the
file system in sync with its use properly. Moreover philosophically it's
problematic overriding the admin's choice of file system like this.
Let's hence drop this, and simplify things. Deleting code is a good
feeling.
Now that regular file systems provide project quota we could probably
add per-machine quota support based on that, hence the btrfs quota
argument is not that interesting anymore (though btrfs quota is a bit
more powerful as it allows recursive quota, i.e. that the machine pool
gets an overall quota in addition to per-machine quota).
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes: #2728
This is also supposed to be preparation for doing #10234 eventually,
where a very similar operation is requested: instead of importing a tree
to /var/lib/machines it would need to be imported into
/var/lib/portables/.
|