]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agoimport: use structured initializers 10909/head
Yu Watanabe [Fri, 23 Nov 2018 18:52:35 +0000 (03:52 +0900)] 
import: use structured initializers

5 years agoimport: use _cleanup_ attribute for CURL object
Yu Watanabe [Fri, 23 Nov 2018 18:14:32 +0000 (03:14 +0900)] 
import: use _cleanup_ attribute for CURL object

5 years agoFix typo in hacking guide: "no possible" -> "not possible" (#10905)
nikolas [Fri, 23 Nov 2018 18:01:50 +0000 (13:01 -0500)] 
Fix typo in hacking guide: "no possible" -> "not possible" (#10905)

5 years agoanalyze: Fix build without seccomp (#10899)
Michal Koutný [Fri, 23 Nov 2018 17:40:32 +0000 (18:40 +0100)] 
analyze: Fix build without seccomp (#10899)

5 years agotests: add a fuzzer for server_process_native_file
Evgeny Vereshchagin [Thu, 22 Nov 2018 23:27:19 +0000 (00:27 +0100)] 
tests: add a fuzzer for server_process_native_file

5 years agodhcp6-client: handle IAID with value zero
Thomas Haller [Fri, 23 Nov 2018 12:42:13 +0000 (13:42 +0100)] 
dhcp6-client: handle IAID with value zero

config_parse_iaid(), dhcp_identifier_set_iaid() and sd_dhcp6_client_set_iaid() all
allow for the IAID to be zero. Also, RFC 3315 makes no mention that zero
would be invalid.

However, client_ensure_iaid() would take an IAID of zero as a sign that
the values was unset. Fix that by keeping track whether IAID is
initialized.

5 years agoMerge pull request #10887 from poettering/run-love
Lennart Poettering [Fri, 23 Nov 2018 15:00:16 +0000 (16:00 +0100)] 
Merge pull request #10887 from poettering/run-love

systemd-run: modernizations, some new switches and let's set $INVOCATION_ID

5 years agoMerge pull request #10893 from keszybz/udev-cleanup-followup
Yu Watanabe [Fri, 23 Nov 2018 14:48:44 +0000 (23:48 +0900)] 
Merge pull request #10893 from keszybz/udev-cleanup-followup

Udev cleanup follow-ups

5 years agopid1,sd-device: use PATH_STARTSWITH_SET more 10893/head
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:24:26 +0000 (09:24 +0100)] 
pid1,sd-device: use PATH_STARTSWITH_SET more

5 years agobasic/path-util: add missing header
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:23:19 +0000 (09:23 +0100)] 
basic/path-util: add missing header

PATH_STARTSWITH_SET uses STRV_FOREACH...

5 years agorun: set $INVOCATION_ID for scope units 10887/head
Lennart Poettering [Thu, 22 Nov 2018 19:40:00 +0000 (20:40 +0100)] 
run: set $INVOCATION_ID for scope units

Services invoked by PID1 have $INVOCATION_ID initialized, hence let's do
that for scope units (where the payload process is invoked by us on the
client side) too, to minimize needless differences.

Fixes: #8082
5 years agorun: port to static destructors
Lennart Poettering [Thu, 22 Nov 2018 18:34:15 +0000 (19:34 +0100)] 
run: port to static destructors

5 years agorun: port to DEFINE_MAIN_FUNCTION()
Lennart Poettering [Thu, 22 Nov 2018 18:30:03 +0000 (19:30 +0100)] 
run: port to DEFINE_MAIN_FUNCTION()

5 years agorun: add new --shell switch for spawning a shell as service
Lennart Poettering [Thu, 22 Nov 2018 18:24:48 +0000 (19:24 +0100)] 
run: add new --shell switch for spawning a shell as service

I keep running "systemd-run -t /bin/bash" to quickly get a shell running
in service context. I suspect I am not the only one, hence let's add a
shortcut for it. While we are at it, let's make it smarter, and
automatically inherit the $SHELL of the invoking user as well as the
working directory, and let's imply --pty. --shell (or -S) is hence
equivalent to "-t -d $SHELL".

5 years agorun: add a switch for specifiying the working directory of a service
Lennart Poettering [Thu, 22 Nov 2018 11:07:25 +0000 (12:07 +0100)] 
run: add a switch for specifiying the working directory of a service

I find myself testing service management quite often with "systemd-run
-t /bin/bash". For that it is handy if the invoked shell would use the
working directory I am currently in. Hence introduce a shorthand for
that:

        $ systemd-run -dt /bin/bash

This will automatically insert a WorkingDirectory= property into the
transient service, pointing to the working directory of the caller.

5 years agolibudev: drop unnecessary check
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:16:11 +0000 (09:16 +0100)] 
libudev: drop unnecessary check

sd_device_get_subsystem returns -ENOENT if subsystem is not set.

5 years agoMerge pull request #10861 from yuwata/udev-list-cleanups
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:12:56 +0000 (09:12 +0100)] 
Merge pull request #10861 from yuwata/udev-list-cleanups

libudev: several cleanups for udev-list

5 years agoMerge pull request #10886 from yuwata/sd-device-monitor-fix-filter
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 07:53:33 +0000 (08:53 +0100)] 
Merge pull request #10886 from yuwata/sd-device-monitor-fix-filter

sd-device: fix subsystem filter

5 years agounit: minor optimization, use stack over heap, when we can
Lennart Poettering [Wed, 21 Nov 2018 15:43:40 +0000 (16:43 +0100)] 
unit: minor optimization, use stack over heap, when we can

5 years ago70-mouse.hwdb: Set DPI for MS Classic IntelliMouse
Daniel van Vugt [Thu, 22 Nov 2018 06:06:46 +0000 (14:06 +0800)] 
70-mouse.hwdb: Set DPI for MS Classic IntelliMouse

It defaults to 3200 DPI and 1000 Hz. Note the ?? is required to
match the multibyte UTF-8 character '®'.

5 years agoMerge pull request #10891 from yuwata/use-main-macro-2
Lennart Poettering [Thu, 22 Nov 2018 23:46:02 +0000 (00:46 +0100)] 
Merge pull request #10891 from yuwata/use-main-macro-2

tree-wide: use recently introduced macros

5 years agounit: drop an unused fields from Unit struct
Lennart Poettering [Wed, 21 Nov 2018 16:06:19 +0000 (17:06 +0100)] 
unit: drop an unused fields from Unit struct

5 years agotest: add more tests for subsystem filter 10886/head
Yu Watanabe [Thu, 22 Nov 2018 17:47:51 +0000 (02:47 +0900)] 
test: add more tests for subsystem filter

5 years agocore: add two minor comments (#10890)
Lennart Poettering [Thu, 22 Nov 2018 21:25:27 +0000 (22:25 +0100)] 
core: add two minor comments (#10890)

5 years agolocale: define main through macro 10891/head
Yu Watanabe [Thu, 22 Nov 2018 21:15:33 +0000 (06:15 +0900)] 
locale: define main through macro

5 years agolocale: store polkit_registry in Context
Yu Watanabe [Thu, 22 Nov 2018 21:12:55 +0000 (06:12 +0900)] 
locale: store polkit_registry in Context

5 years agolocale: rename context_free() to context_clear()
Yu Watanabe [Thu, 22 Nov 2018 21:12:45 +0000 (06:12 +0900)] 
locale: rename context_free() to context_clear()

5 years agoresolvectl: use static destructor and define main through macro
Yu Watanabe [Thu, 22 Nov 2018 21:00:02 +0000 (06:00 +0900)] 
resolvectl: use static destructor and define main through macro

5 years agorfkill: define main through macro
Yu Watanabe [Thu, 22 Nov 2018 20:55:10 +0000 (05:55 +0900)] 
rfkill: define main through macro

5 years agorfkill: store write queue and rfkill fd in struct Context
Yu Watanabe [Thu, 22 Nov 2018 20:54:44 +0000 (05:54 +0900)] 
rfkill: store write queue and rfkill fd in struct Context

5 years agosocket-proxy: define main through macro
Yu Watanabe [Thu, 22 Nov 2018 20:11:31 +0000 (05:11 +0900)] 
socket-proxy: define main through macro

5 years agosysusers: use ordered_hashmap_steal_first_key_and_value()
Yu Watanabe [Thu, 22 Nov 2018 20:04:32 +0000 (05:04 +0900)] 
sysusers: use ordered_hashmap_steal_first_key_and_value()

5 years agotime-wait: define main through macro
Yu Watanabe [Thu, 22 Nov 2018 19:55:17 +0000 (04:55 +0900)] 
time-wait: define main through macro

5 years agotimedate: define main through macro
Yu Watanabe [Thu, 22 Nov 2018 19:47:12 +0000 (04:47 +0900)] 
timedate: define main through macro

5 years agoupdate-done: quit earlier on failure
Yu Watanabe [Thu, 22 Nov 2018 19:40:22 +0000 (04:40 +0900)] 
update-done: quit earlier on failure

5 years agoupdate-utmp: use _cleanup_ attribute to finalize process
Yu Watanabe [Thu, 22 Nov 2018 19:38:06 +0000 (04:38 +0900)] 
update-utmp: use _cleanup_ attribute to finalize process

5 years agoveritysetup-generator: use static destructors and define main through macro
Yu Watanabe [Thu, 22 Nov 2018 19:27:09 +0000 (04:27 +0900)] 
veritysetup-generator: use static destructors and define main through macro

5 years agoveritysetup-generator: make arg_dest const
Yu Watanabe [Thu, 22 Nov 2018 19:23:27 +0000 (04:23 +0900)] 
veritysetup-generator: make arg_dest const

5 years agoveritysetup: use static destructors and define main through macro
Yu Watanabe [Thu, 22 Nov 2018 19:21:08 +0000 (04:21 +0900)] 
veritysetup: use static destructors and define main through macro

This also changes the return value when crypt_init_by_name() fails in 'detach'.

5 years agotests: add a fuzzer for catalog_import_file
Evgeny Vereshchagin [Thu, 22 Nov 2018 16:09:20 +0000 (17:09 +0100)] 
tests: add a fuzzer for catalog_import_file

5 years agoman: update description of Description=
Zbigniew Jędrzejewski-Szmek [Thu, 22 Nov 2018 16:05:33 +0000 (17:05 +0100)] 
man: update description of Description=

The way this is used drifted a bit from the original intent. Let's update
the description and add some examples to inspire people to texts that look
less bad during initial boot.

5 years agoMerge pull request #10884 from yuwata/udev-debug
Zbigniew Jędrzejewski-Szmek [Thu, 22 Nov 2018 19:47:33 +0000 (20:47 +0100)] 
Merge pull request #10884 from yuwata/udev-debug

meson: add more debug options

5 years agosd-device-monitor: fix subsystem filter
Yu Watanabe [Thu, 22 Nov 2018 16:24:34 +0000 (01:24 +0900)] 
sd-device-monitor: fix subsystem filter

This fixes a bug introduced by 759d9f3f8d07af2940bb3783acc3985ee47adfa5.

Fixes #10882.

5 years agoudev-rules: update log messages 10884/head
Yu Watanabe [Thu, 22 Nov 2018 16:02:10 +0000 (01:02 +0900)] 
udev-rules: update log messages

5 years agomeson: also add option for debugging siphash
Yu Watanabe [Thu, 22 Nov 2018 15:36:35 +0000 (00:36 +0900)] 
meson: also add option for debugging siphash

5 years agomeson: add option for debugging udev
Yu Watanabe [Thu, 22 Nov 2018 15:28:27 +0000 (00:28 +0900)] 
meson: add option for debugging udev

5 years agoudev-rules: trivial coding style cleanups
Yu Watanabe [Thu, 22 Nov 2018 15:22:09 +0000 (00:22 +0900)] 
udev-rules: trivial coding style cleanups

5 years agoudev: rename udev_rules_unref() to udev_rules_free()
Yu Watanabe [Thu, 22 Nov 2018 15:07:32 +0000 (00:07 +0900)] 
udev: rename udev_rules_unref() to udev_rules_free()

As udev_rules do not have a reference counter.

5 years agolibudev: do not ignore error in udev_list_entry_add() 10861/head
Yu Watanabe [Thu, 22 Nov 2018 14:46:43 +0000 (23:46 +0900)] 
libudev: do not ignore error in udev_list_entry_add()

5 years agolibudev: introduce return_with_errno() and use it where applicable
Yu Watanabe [Wed, 21 Nov 2018 05:06:41 +0000 (14:06 +0900)] 
libudev: introduce return_with_errno() and use it where applicable

5 years agotest: add tests for libudev-list
Yu Watanabe [Wed, 21 Nov 2018 04:43:55 +0000 (13:43 +0900)] 
test: add tests for libudev-list

5 years agolibudev-list: drop unused udev argument from udev_list_init()
Yu Watanabe [Wed, 21 Nov 2018 04:09:59 +0000 (13:09 +0900)] 
libudev-list: drop unused udev argument from udev_list_init()

5 years agolibudev-list: drop unused private functions
Yu Watanabe [Wed, 21 Nov 2018 04:06:17 +0000 (13:06 +0900)] 
libudev-list: drop unused private functions

5 years agoMerge pull request #10871 from keszybz/more-cleanup-2
Yu Watanabe [Thu, 22 Nov 2018 14:16:43 +0000 (23:16 +0900)] 
Merge pull request #10871 from keszybz/more-cleanup-2

Allow "synthetic" errno to be used in log calls

5 years agosysctl: when debug logging about sysctl changes, truncate trailing newline
Lennart Poettering [Tue, 20 Nov 2018 23:07:43 +0000 (00:07 +0100)] 
sysctl: when debug logging about sysctl changes, truncate trailing newline

5 years agobasic/log: add note about operator precendence 10871/head
Zbigniew Jędrzejewski-Szmek [Thu, 22 Nov 2018 09:56:43 +0000 (10:56 +0100)] 
basic/log: add note about operator precendence

5 years agoCODING_STYLE: describe log & return operations
Zbigniew Jędrzejewski-Szmek [Thu, 22 Nov 2018 09:39:31 +0000 (10:39 +0100)] 
CODING_STYLE: describe log & return operations

5 years agoAlso drop a few more unnecessary uses of synthethic errno
Zbigniew Jędrzejewski-Szmek [Wed, 21 Nov 2018 23:51:29 +0000 (00:51 +0100)] 
Also drop a few more unnecessary uses of synthethic errno

5 years agococcinelle: also mark previous synthetic errnos as such
Zbigniew Jędrzejewski-Szmek [Wed, 21 Nov 2018 07:23:20 +0000 (08:23 +0100)] 
coccinelle: also mark previous synthetic errnos as such

5 years agococcinelle: make use of SYNTHETIC_ERRNO
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 22:40:44 +0000 (23:40 +0100)] 
coccinelle: make use of SYNTHETIC_ERRNO

Ideally, coccinelle would strip unnecessary braces too. But I do not see any
option in coccinelle for this, so instead, I edited the patch text using
search&replace to remove the braces. Unfortunately this is not fully automatic,
in particular it didn't deal well with if-else-if-else blocks and ifdefs, so
there is an increased likelikehood be some bugs in such spots.

I also removed part of the patch that coccinelle generated for udev, where we
returns -1 for failure. This should be fixed independently.

5 years agobasic/log: add concept of "synthethic errnos"
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 22:03:40 +0000 (23:03 +0100)] 
basic/log: add concept of "synthethic errnos"

Synthetic errnos are processed like normal, and may be used in %m and become
the return value from log_*(), but they are not logged in the journal.

5 years agovconsole: Don't skip udev call for dummy device
Tim Ruffing [Wed, 21 Nov 2018 20:41:15 +0000 (21:41 +0100)] 
vconsole: Don't skip udev call for dummy device

Kernel 4.19 supports deferred console takeover [0], i.e., fbcon will
take over the console only when the first text is displayed on the
console. Before that event, only the dummy console is active. Our
currently udev rules call systemd-vconsole on every vtcon except for
dummy consoles. Thus the exception for dummy consoles prevents a call
to systemd-vconsole when no text is displayed on the console, and as a
consequence, the keymap will not be set in that case. This is wrong and
leads to issues when keyboard input is expected without text on the
console, e.g., when a graphical password prompt is used in the boot
process.

This reverts commit 6b169c13ecf645a0a341f49b9dc2afb312a74206,
which introduced the exception for dummy devices to save unnecessary
udev calls.

Fixes #10826.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83d83bebf40132e2d55ec58af666713cc76f9764

5 years agobasic/user-util: properly protect use of gshadow
Yann E. MORIN [Wed, 21 Nov 2018 17:09:04 +0000 (18:09 +0100)] 
basic/user-util: properly protect use of gshadow

Commit 100d5f6ee6 (user-util: add new wrappers for [...] database
files), ammended by commit 4f07ffa8f5 (Use #if instead of #ifdef for
ENABLE_GSHADOW) moved code from sysuser to basic/user-util.

In doing so, the combination of both commits properly propagated the
ENABLE_GSHADOW conditions around the function manipulating gshadow, but
they forgot to protect the inclusion of the gshadow.h header.

Fix that to be able to build on C libraries that do not provide gshadow
(e.g. uClibc-ng, where it does not exist.)

5 years agoMerge pull request #9961 from fbuihuu/logind-fix-vt-reinit-race
Lennart Poettering [Wed, 21 Nov 2018 16:28:23 +0000 (17:28 +0100)] 
Merge pull request #9961 from fbuihuu/logind-fix-vt-reinit-race

Logind fix vt reinit race

5 years agoRevert 5fdf2d51c244288ac41443d1bd81365fab7b7b81
Zbigniew Jędrzejewski-Szmek [Wed, 21 Nov 2018 09:21:28 +0000 (10:21 +0100)] 
Revert 5fdf2d51c244288ac41443d1bd81365fab7b7b81

This reverts 5fdf2d51c244288ac41443d1bd81365fab7b7b81, except for one improved
log message.

Fixes #10613.

Checking if resume= is configured is a good idea, but it turns out we cannot do
it reliably:
- the code only supported boot options with sd-boot, and it's not very widely
  used. This means that for most systemd we could only check the current
  commandline, not the next one.
- Various systems resume without, e.g. Debian has
  /etc/initramfs-tools/conf.d/resume in the initramfs.

Making those checks better would be possible with enough effort, but there'll
be always new systems that boot in a slightly different way and we would need
to keep adding new cases. Longer term, we want to rely on autodetecting the
resume partition, and then checks like this will not be necessary at all. It is
quite clear from the number of bug reports that the number of poeple impacted
by this is quite high now, so let's just drop this.

5 years agologind: stop managing VT switches if no sessions are registered on that VT 9961/head
Franck Bui [Mon, 27 Aug 2018 21:16:10 +0000 (23:16 +0200)] 
logind: stop managing VT switches if no sessions are registered on that VT

When no sessions are registered on a given VT (anymore), we should always let
the kernel processes VT switching (instead of simply emitting a warning)
otherwise the requests sent by the kernel are simply ignored making the VT
switch requested by users simply impossible.

Even if it shouldn't happen, this case was encountered in issue #9754, so
better to be safe than sorry.

5 years agoterminal-util: introduce vt_release() helper
Franck Bui [Mon, 27 Aug 2018 20:42:00 +0000 (22:42 +0200)] 
terminal-util: introduce vt_release() helper

5 years agologind: become the controlling terminal process before restoring VT
Franck Bui [Mon, 27 Aug 2018 20:13:21 +0000 (22:13 +0200)] 
logind: become the controlling terminal process before restoring VT

Basically when a session ends, logind notices and restores VT_AUTO so the
kernel takes back VT-switching over.

logind achieves that by watching the process that took control of the session
(via the "TakeControl" D-Bus method), aka "the watched process", which can
be different from the one that initially opened the VT aka "the terminal
controlling process".

In this case the terminal controlling process can exit after the watched one
did and while logind is restoring the VT.

Even if logind took care to re-open the VT in case the VT was already in HUP
state, it wasn't enough because the terminal controlling process could have
exited right after, leaving the VT in HUP state and in VT_PROCESS mode making
further VT-switching impossible.

This patch fixes this situation by forcing logind to become the terminal
controlling process.

Fixes: #9754.
5 years agoterminal-util: introduce vt_restore() helper
Franck Bui [Mon, 27 Aug 2018 20:33:44 +0000 (22:33 +0200)] 
terminal-util: introduce vt_restore() helper

5 years agologind: make session_restore_vt() static
Franck Bui [Thu, 23 Aug 2018 16:03:04 +0000 (18:03 +0200)] 
logind: make session_restore_vt() static

It's only used in logind-session.c.

5 years agogenerators: drop umask calls
Zbigniew Jędrzejewski-Szmek [Wed, 21 Nov 2018 09:12:00 +0000 (10:12 +0100)] 
generators: drop umask calls

systemd already sets the umask (see e3b8d0637dd755b3426f3363b2cdad63f738116c). When
running under systemd, we don't need to set it. And when *not* running under
systemd, for example during development, there is no reason to override the user
config. Let's just drop those calls.

$ git grep -e 'umask\(' -l 'src/*generator*' |xargs perl -i -0pe 's|^[^\n]*umask\([^\n]+\n\n||gms'

5 years agocore: Detect initial timer state from serialized data
Michal Koutný [Fri, 2 Nov 2018 19:56:08 +0000 (20:56 +0100)] 
core: Detect initial timer state from serialized data

We keep a mark whether a single-shot timer was triggered in the caller's
variable initial. When such a timer elapses while we are
serializing/deserializing the inner state, we consider the timer
incorrectly as elapsed and don't trigger it later.

This patch exploits last_trigger timestamp that we already serialize,
hence we can eliminate the argument initial completely.

A reproducer for OnBootSec= timers:
        cat >repro.c <<EOD
        /*
         * Compile: gcc repro.c -o repro
         * Run: ./repro
         */
        #include <errno.h>
        #include <fcntl.h>
        #include <stdio.h>
        #include <stdlib.h>
        #include <sys/stat.h>
        #include <sys/types.h>
        #include <time.h>
        #include <unistd.h>

        int main(int argc, char *argv[]) {
         char command[1024];
         int pause;

         struct timespec now;

         while (1) {
         usleep(rand() % 200000); // prevent periodic repeats
                clock_gettime(CLOCK_MONOTONIC, &now);
         printf("%i\n", now.tv_sec);

         system("rm -f $PWD/mark");
         snprintf(command, 1024, "systemd-run --user --on-boot=%i --timer-property=AccuracySec=100ms "
         "touch $PWD/mark", now.tv_sec + 1);
         system(command);
         system("systemctl --user list-timers");
         pause = (1000000000 - now.tv_nsec)/1000 - 70000; // fiddle to hit the middle of reloading
         usleep(pause > 0 ? pause : 0);
         system("systemctl --user daemon-reload");
         sync();
         sleep(2);
         if (open("./mark", 0) < 0)
         if (errno == ENOENT) {
         printf("mark file does not exist\n");
         break;
         }
         }

         return 0;
        }
        EOD

5 years agoMerge pull request #10866 from yuwata/libudev-util-cleanups
Lennart Poettering [Wed, 21 Nov 2018 10:15:35 +0000 (11:15 +0100)] 
Merge pull request #10866 from yuwata/libudev-util-cleanups

libudev-util: several cleanups and tests

5 years agoMerge pull request #10860 from keszybz/more-cleanup-2
Lennart Poettering [Wed, 21 Nov 2018 10:07:31 +0000 (11:07 +0100)] 
Merge pull request #10860 from keszybz/more-cleanup-2

Do more stuff from main macros

5 years agotest: add tests for util_resolve_subsys_kernel() 10866/head
Yu Watanabe [Wed, 21 Nov 2018 08:29:34 +0000 (17:29 +0900)] 
test: add tests for util_resolve_subsys_kernel()

5 years agolibudev: make util_resolve_subsys_kernel() return negative errno
Yu Watanabe [Wed, 21 Nov 2018 08:27:38 +0000 (17:27 +0900)] 
libudev: make util_resolve_subsys_kernel() return negative errno

This also replaces udev_device by sd_device in the function.

5 years agoudev/scsi_id: fix buffer length
Yu Watanabe [Wed, 21 Nov 2018 07:42:37 +0000 (16:42 +0900)] 
udev/scsi_id: fix buffer length

5 years agotest: add tests for util_replace_whitespace()
Yu Watanabe [Wed, 21 Nov 2018 07:17:29 +0000 (16:17 +0900)] 
test: add tests for util_replace_whitespace()

5 years agolibudev-util: make util_replace_whitespace() not count leading white spaces
Yu Watanabe [Wed, 21 Nov 2018 07:17:36 +0000 (16:17 +0900)] 
libudev-util: make util_replace_whitespace() not count leading white spaces

5 years agoudevd: define main through macro 10860/head
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 15:43:19 +0000 (16:43 +0100)] 
udevd: define main through macro

This removes the call to log_close(), and refactors how fork() is done. Now
the parent also goes through normal cleanup. This isn't necessary to use the
macro, but it feels cleaner this way.

5 years agoudevadm: define main through macro
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 15:41:38 +0000 (16:41 +0100)] 
udevadm: define main through macro

This removes a call to log_close(). I don't think this should matter.
The call to mac_selinux_init() is moved after parse_argv(). We probably
don't need selinux when printing help().

5 years agoCall mac_selinux_close() from main func macros, convert user-sessions and test-udev
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 15:40:49 +0000 (16:40 +0100)] 
Call mac_selinux_close() from main func macros, convert user-sessions and test-udev

5 years agosystemctl: define main through macro and call ask_password_agent_close() from the...
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 09:22:26 +0000 (10:22 +0100)] 
systemctl: define main through macro and call ask_password_agent_close() from the macro

This doesn't save us anything, but I like consistency.

5 years agolibudev-util: make util_replace_*() return size_t
Yu Watanabe [Wed, 21 Nov 2018 07:35:20 +0000 (16:35 +0900)] 
libudev-util: make util_replace_*() return size_t

5 years agolibudev-util: add assertions
Yu Watanabe [Wed, 21 Nov 2018 07:32:54 +0000 (16:32 +0900)] 
libudev-util: add assertions

5 years agocore: run env generators with non-zero umask
Lennart Poettering [Tue, 20 Nov 2018 18:14:24 +0000 (19:14 +0100)] 
core: run env generators with non-zero umask

For PID 1 we adjust the umask to 0, but generators should not run that
way, given that they might be implemented as shell scripts and such.
Let's hence explicitly adjust the umask for them.

We already do this for unit generators. Let's do this for env
generators, too.

5 years agotests: skip test_exec_ambientcapabilities on Travis CI under ASan
Evgeny Vereshchagin [Tue, 20 Nov 2018 14:47:11 +0000 (15:47 +0100)] 
tests: skip test_exec_ambientcapabilities on Travis CI under ASan

Let's not bother contributors with spurious failures nobody can't
seem to reproduce. There is an issue about that where we're trying
to figure out what's going on: https://github.com/systemd/systemd/issues/10696.

5 years agoMerge pull request #10853 from poettering/thaw-containers
Lennart Poettering [Tue, 20 Nov 2018 18:35:30 +0000 (19:35 +0100)] 
Merge pull request #10853 from poettering/thaw-containers

main: don't freeze PID 1 in containers, exit with non-zero instead

5 years agoMerge pull request #10858 from poettering/tmpfiles-fixlets
Lennart Poettering [Tue, 20 Nov 2018 18:09:37 +0000 (19:09 +0100)] 
Merge pull request #10858 from poettering/tmpfiles-fixlets

more tmpfiles fixlets

5 years agoportablectl: make "arg_host" const
Yu Watanabe [Tue, 20 Nov 2018 09:36:19 +0000 (18:36 +0900)] 
portablectl: make "arg_host" const

5 years agomount-tool: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 09:30:13 +0000 (18:30 +0900)] 
mount-tool: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agomodules-load: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 09:24:47 +0000 (18:24 +0900)] 
modules-load: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agomachinectl: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 09:21:01 +0000 (18:21 +0900)] 
machinectl: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agoshared/main-func: also close the polkit agent automatically
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 14:52:40 +0000 (15:52 +0100)] 
shared/main-func: also close the polkit agent automatically

The agent is closed after the static destuctors but before the pager.
No users of DEFINE_MAIN_FUNCTION* were using a polkit agent, so this makes no
functional difference.

5 years agoSplit out pretty-print.c and move pager.c and main-func.h to shared/
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 14:42:57 +0000 (15:42 +0100)] 
Split out pretty-print.c and move pager.c and main-func.h to shared/

This is high-level functionality, and fits better in shared/ (which is for
our executables), than in basic/ (which is also for libraries).

5 years agomachine-id: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 09:17:53 +0000 (18:17 +0900)] 
machine-id: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agologinctl: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 09:15:33 +0000 (18:15 +0900)] 
loginctl: use static destructor and DEFINE_MAIN_FUNCTION() macro

5 years agolocale: make "arg_host" const
Yu Watanabe [Tue, 20 Nov 2018 09:08:33 +0000 (18:08 +0900)] 
locale: make "arg_host" const

5 years agohostnamed: use DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 09:03:50 +0000 (18:03 +0900)] 
hostnamed: use DEFINE_MAIN_FUNCTION() macro

This also renames context_free() to context_clear().

5 years agohibernate-resume-generator: use static destructor and DEFINE_MAIN_FUNCTION() macro
Yu Watanabe [Tue, 20 Nov 2018 09:00:13 +0000 (18:00 +0900)] 
hibernate-resume-generator: use static destructor and DEFINE_MAIN_FUNCTION() macro