platform/upstream/systemd.git
6 years agocore: limit service-watchdogs=no to actual "watchdog" commands
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 13:24:44 +0000 (15:24 +0200)]
core: limit service-watchdogs=no to actual "watchdog" commands

The setting is now only looked at when considering an action for a job timeout
or unit start limit. It is ignored for ctrl-alt-del, SuccessAction, SuccessFailure.

v2: turn the parameter into a flag field
v3: rename Options to Flags

6 years agocore: allow services with no commands but SuccessAction set
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 13:07:42 +0000 (15:07 +0200)]
core: allow services with no commands but SuccessAction set

6 years agocore: accept system mode emergency action specifiers with a warning
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 12:49:36 +0000 (14:49 +0200)]
core: accept system mode emergency action specifiers with a warning

Before we would only accept those "system" values, so there wasn't other
chocie. Let's provide backwards compatiblity in case somebody made use of
this functionality in user mode.

v2: use 'exit-force' not 'exit'
v3: use error value in log_syntax

6 years agocore: define "exit" and "exit-force" actions for user units and only accept that
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 11:28:39 +0000 (13:28 +0200)]
core: define "exit" and "exit-force" actions for user units and only accept that

We would accept e.g. FailureAction=reboot-force in user units and then do an
exit in the user manager. Let's be stricter, and define "exit"/"exit-force" as
the only supported actions in user units.

v2:
- rename 'exit' to 'exit-force' and add new 'exit'
- add test for the parsing function

6 years agoman: move description of *Action= modes to FailureAction=/SuccessAction=
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 13:56:35 +0000 (15:56 +0200)]
man: move description of *Action= modes to FailureAction=/SuccessAction=

FailureAction=/SuccessAction= were added later then StartLimitAction=, so it
was easiest to refer to the existing description. But those two settings are
somewhat simpler (they just execute the action unconditionally) while
StartLimitAction= has additional timing and burst parameters, and they are
about to take on a more prominent role, so let's move the description of
allowed values.

6 years agocore: consider service with no start command immediately started
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 20:45:34 +0000 (22:45 +0200)]
core: consider service with no start command immediately started

The service would always be in state == SERVICE_INACTIVE, but it needs to go
through state == SERVICE_START so that SuccessAction/FailureAction are executed.

6 years agocore: return true from cg_is_empty* on ENOENT
Zbigniew Jędrzejewski-Szmek [Wed, 17 Oct 2018 15:48:35 +0000 (17:48 +0200)]
core: return true from cg_is_empty* on ENOENT

6 years agosystemctl: fix typo
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 08:38:19 +0000 (10:38 +0200)]
systemctl: fix typo

6 years agologind: validate /run/user/1000 before we set it
Lennart Poettering [Tue, 9 Oct 2018 20:23:41 +0000 (22:23 +0200)]
logind: validate /run/user/1000 before we set it

Let's be safe than sorry, in particular as logind doesn't set it up
anymore, but user-runtime-dir@.service does, and logind doesn't really
track success of that.

6 years agocore: fix unfortunate typo in unit_is_unneeded()
Lennart Poettering [Tue, 9 Oct 2018 20:23:14 +0000 (22:23 +0200)]
core: fix unfortunate typo in unit_is_unneeded()

Follow-up for a3c1168ac293f16d9343d248795bb4c246aaff4a.

6 years agocore: make destructive transaction error a bit more useful
Lennart Poettering [Tue, 9 Oct 2018 20:22:52 +0000 (22:22 +0200)]
core: make destructive transaction error a bit more useful

6 years agoupdate TODO
Lennart Poettering [Tue, 7 Aug 2018 09:01:46 +0000 (11:01 +0200)]
update TODO

6 years agoman: also use "yes"/"no" rather than "true"/"false" in man pages
Lennart Poettering [Tue, 25 Sep 2018 10:40:35 +0000 (12:40 +0200)]
man: also use "yes"/"no" rather than "true"/"false" in man pages

We usually use yes/no in all our unit files, do the same in the man
pages.

Triggered by:

https://github.com/systemd/systemd/pull/9824#issuecomment-420729987

6 years agounits: use =yes rather than =true everywhere
Lennart Poettering [Wed, 12 Sep 2018 17:04:24 +0000 (19:04 +0200)]
units: use =yes rather than =true everywhere

So far we always used "yes" instead of "true" in all our unit files,
except for one outlier. Let's do this here too. No change in behaviour
whatsoever, except that it looks prettier ;-)

6 years agologind: automatically GC lingering users for who now user@.service (nor slice, not...
Lennart Poettering [Wed, 8 Aug 2018 14:04:40 +0000 (16:04 +0200)]
logind: automatically GC lingering users for who now user@.service (nor slice, not runtime dir service) is running anymore

This heavily borrows from @intelfx' PR #5546, but watches all three
units that are associated with a user now: the slice, the user@.service
and user-runtime-dir@.service.

The logic and reasoning behind it is the same though: there's no value
in keeping lingering users around if all their three services are gone.

Replaces: #5546
Fixes: #4162

6 years agologind: improve error propagation of user_check_linger_file()
Lennart Poettering [Wed, 8 Aug 2018 14:03:11 +0000 (16:03 +0200)]
logind: improve error propagation of user_check_linger_file()

Let's make this a bit prettier, and propagate unexpected access() errors
correctly.

(The callers of this function will suppress them, but it's nicer of they
do that, rather than us doing that twice in both the callers and the
callees)

6 years agologind: add a RequiresMountsFor= dependency from the session scope unit to the home...
Lennart Poettering [Wed, 8 Aug 2018 13:27:49 +0000 (15:27 +0200)]
logind: add a RequiresMountsFor= dependency from the session scope unit to the home directory of the user

This is useful so that during shutdown scope units are always terminated
before the mounts necessary for the home directory.

(Ideally we'd also add a similar dependency from the user@.service
instance to the home directory, but this isn't as easy as that service
is defined statically and not dynamically, and hence not easy to modify
dynamically, in particular when it comes to deps)

6 years agologind: change user-runtime-dir to query runtime dir size from logind via the bus
Lennart Poettering [Wed, 8 Aug 2018 12:50:57 +0000 (14:50 +0200)]
logind: change user-runtime-dir to query runtime dir size from logind via the bus

I think this is a slightly cleaner approach than parsing the
configuration file at multiple places, as this way there's only a single
reload cycle for logind.conf, and that's systemd-logind.service's
runtime.

This means that logind and dbus become a requirement of
user-runtime-dir, but given that XDG_RUNTIME_DIR is not set anyway
without logind and dbus around this isn't really any limitation.

This also simplifies linking a bit as this means user-runtime-dir
doesn't have to link against any code of logind itself.

6 years agologind: optionally watch utmp for login data
Lennart Poettering [Tue, 7 Aug 2018 11:49:34 +0000 (13:49 +0200)]
logind: optionally watch utmp for login data

This allows us to determine the TTY an ssh session is for, which is
useful to to proper idle detection for ssh sessions.

Fixes: #9622

6 years agologind: add hashtable for finding session by leader PID
Lennart Poettering [Tue, 7 Aug 2018 10:08:24 +0000 (12:08 +0200)]
logind: add hashtable for finding session by leader PID

This is useful later on, when we quickly want to find the session for a
leader PID.

6 years agologind: optionally, keep the user@.service instance for eached logged in user around...
Lennart Poettering [Tue, 7 Aug 2018 09:02:00 +0000 (11:02 +0200)]
logind: optionally, keep the user@.service instance for eached logged in user around for a while

This should speed up rapid logout/login cycles a bit.

By default this timeout is now set to 10s.

Fixes: #8410
Replaces: #4434

6 years agologind: minor session time handling tweaks
Lennart Poettering [Tue, 7 Aug 2018 08:40:50 +0000 (10:40 +0200)]
logind: minor session time handling tweaks

6 years agologind: rework how we manage the slice and user-runtime-dir@.service unit for each...
Lennart Poettering [Mon, 6 Aug 2018 19:44:45 +0000 (21:44 +0200)]
logind: rework how we manage the slice and user-runtime-dir@.service unit for each user

Instead of managing it explicitly, let's simplify things and rely on
regular Wants=/Requires= dependencies to pull in these units from
user@.service and the session scope, and StopWhenUneeded= to stop these
auxiliary units again. This way, they can be pulled in easily by
unrelated units too.

This simplifies things quite a bit: for each session we now only need to
manage the session scope, and for each user the user@.service, the other
units are not something we need to manage anymore.

This patch also makes sure that if user@.service of a user is masked we
will continue to work, and user-runtime-dir@.service will still be
correctly pulled in, as it is now a dependency of the scope unit.

Fixes: #9461
Replaces: #5546

6 years agologind: don't clobber bus error structure if we don't fail
Lennart Poettering [Mon, 6 Aug 2018 19:41:54 +0000 (21:41 +0200)]
logind: don't clobber bus error structure if we don't fail

6 years agologind: propagate session stop errors
Lennart Poettering [Mon, 6 Aug 2018 17:35:44 +0000 (19:35 +0200)]
logind: propagate session stop errors

Let's propagate errors from stopping sessions via seat_stop(). This is
similar to how we propagate such errors in user_stop() for all sessions
associated with a user.

Note that we propagate these errors, but we don't abort the function.

6 years agologind: introduce little helper that checks whether a session is ready
Lennart Poettering [Mon, 6 Aug 2018 17:34:39 +0000 (19:34 +0200)]
logind: introduce little helper that checks whether a session is ready

6 years agologind: use TAKE_PTR() where we can
Lennart Poettering [Mon, 6 Aug 2018 17:34:09 +0000 (19:34 +0200)]
logind: use TAKE_PTR() where we can

6 years agologind: prefer strjoin() over asprintf()
Lennart Poettering [Mon, 6 Aug 2018 17:05:57 +0000 (19:05 +0200)]
logind: prefer strjoin() over asprintf()

6 years agologind: don't rely on downgrade-to-bool
Lennart Poettering [Mon, 6 Aug 2018 17:05:26 +0000 (19:05 +0200)]
logind: don't rely on downgrade-to-bool

6 years agologind: voidify a few calls
Lennart Poettering [Mon, 6 Aug 2018 17:04:49 +0000 (19:04 +0200)]
logind: voidify a few calls

6 years agologind: make better use of logging functions
Lennart Poettering [Mon, 6 Aug 2018 17:03:27 +0000 (19:03 +0200)]
logind: make better use of logging functions

6 years agologind: never elect a session that is stopping as display
Lennart Poettering [Mon, 6 Aug 2018 17:02:29 +0000 (19:02 +0200)]
logind: never elect a session that is stopping as display

6 years agologind: make unit/job active checking more debuggable
Lennart Poettering [Mon, 6 Aug 2018 17:00:49 +0000 (19:00 +0200)]
logind: make unit/job active checking more debuggable

Let's log the error messages if we get any at debug level.

6 years agoman: add missing space
Lennart Poettering [Mon, 6 Aug 2018 16:54:51 +0000 (18:54 +0200)]
man: add missing space

6 years agosd-bus: add new API call sd_bus_error_move()
Lennart Poettering [Mon, 6 Aug 2018 16:54:03 +0000 (18:54 +0200)]
sd-bus: add new API call sd_bus_error_move()

This new call move an sd_bus_error into another one.

6 years agologind: fix bad error propagation
Lennart Poettering [Mon, 6 Aug 2018 16:21:37 +0000 (18:21 +0200)]
logind: fix bad error propagation

6 years agologind: correct bad clean-up path
Lennart Poettering [Mon, 6 Aug 2018 16:19:45 +0000 (18:19 +0200)]
logind: correct bad clean-up path

6 years agologind: save/restore User object's "stopping" field during restarts
Lennart Poettering [Mon, 6 Aug 2018 16:14:11 +0000 (18:14 +0200)]
logind: save/restore User object's "stopping" field during restarts

Whether we are stopping or not is highly relevant, hence don't forget it
across restarts.

6 years agologind: improve logging in manager_connect_console()
Lennart Poettering [Fri, 3 Aug 2018 18:21:27 +0000 (20:21 +0200)]
logind: improve logging in manager_connect_console()

let's make sure we log about every failure

Also, complain about systems where /dev/tty0 exists but
/sys/class/tty/tty0/active does not. Such systems (usually container
environments) are pretty broken as they mount something that is not a VC
to /dev/tty0 and they really shouldn't.

Systems should either have a VC or not, but not badly fake one by
mounting things wildly.

This just adds a warning message, as before we'll simply turn off VC
handling in this case.

6 years agologind: initialize Manager object with structure initialization too
Lennart Poettering [Fri, 3 Aug 2018 18:20:50 +0000 (20:20 +0200)]
logind: initialize Manager object with structure initialization too

6 years agounits: improve Description= string a bit
Lennart Poettering [Mon, 6 Aug 2018 16:15:07 +0000 (18:15 +0200)]
units: improve Description= string a bit

Let's not use the word "wrapper", as it's not clear what that is, and in
some way any unit file is a "wrapper"... let's simply say that it's
about the runtime directory.

6 years agounits: set StopWhenUnneeded= for the user slice units too
Lennart Poettering [Fri, 3 Aug 2018 18:19:38 +0000 (20:19 +0200)]
units: set StopWhenUnneeded= for the user slice units too

We'd like them to go away, just like the user-runtime-dir@.service when
they aren't needed anymore.

6 years agologind: turn of stdio locking when writing session files too
Lennart Poettering [Fri, 3 Aug 2018 18:18:55 +0000 (20:18 +0200)]
logind: turn of stdio locking when writing session files too

This just copies what we already do for user and seat files to session
files.

6 years agologind: fix serialization/deserialization of user's "display session"
Lennart Poettering [Fri, 3 Aug 2018 17:04:35 +0000 (19:04 +0200)]
logind: fix serialization/deserialization of user's "display session"

Previously this was serialized as part of the user object. This didn't
work however, as we load users first, and sessions seconds and hence
referencing a session from the user load logic cannot work.

Fix this by storing an IS_DISPLAY property along with each session, and
make the session with this set display session when it is loaded.

6 years agologind: rework Seat/Session/User object allocation and freeing a bit
Lennart Poettering [Fri, 3 Aug 2018 16:53:09 +0000 (18:53 +0200)]
logind: rework Seat/Session/User object allocation and freeing a bit

Let's update things a bit to follow current practices:

- User structure initialization rather than zero-initialized allocation

- Always propagate proper errors from allocation functions

- Use _cleanup_ for freeing objects when allocation fails half-way

- Make destructors return NULL

6 years agoRevert "alloc-util: return NULL if 0-sized allocation is requested"
Yu Watanabe [Sat, 13 Oct 2018 08:45:14 +0000 (17:45 +0900)]
Revert "alloc-util: return NULL if 0-sized allocation is requested"

This reverts commit c05107767b589e9aac9711eb385738887f86eb77.

6 years agoman: systemctl: clarify that --lines=0 is allowed (#10375)
Lucas Werkmeister [Sat, 13 Oct 2018 08:31:40 +0000 (10:31 +0200)]
man: systemctl: clarify that --lines=0 is allowed (#10375)

The term “positive” is often read to exclude 0 (though “strictly
positive” is sometimes used to clarify this), so let’s explicitly state
that --lines=0 is legal and completely disables journal output.

Motivated by an answer on StackExchange [1].

[1]: https://unix.stackexchange.com/a/475068/44049

6 years agoMerge pull request #10371 from poettering/sd-event-man-fix
Yu Watanabe [Sat, 13 Oct 2018 08:30:44 +0000 (17:30 +0900)]
Merge pull request #10371 from poettering/sd-event-man-fix

trivial sd-event man page fixes

6 years agonetworkd: fix attribute length for wireguard (#10380)
Jason A. Donenfeld [Sat, 13 Oct 2018 08:28:49 +0000 (10:28 +0200)]
networkd: fix attribute length for wireguard (#10380)

This is actually a u16, not a u32, so the kernel complains:

kernel: netlink: 'systemd-network': attribute type 5 has an invalid length

This is due to:

if (nla_attr_len[pt->type] && attrlen != nla_attr_len[pt->type]) {
        pr_warn_ratelimited("netlink: '%s': attribute type %d has an invalid length.\n",
                            current->comm, type);
}

Presumably this has been working fine in functionality on little-endian
systems, but nobody bothered to try on big-endian systems.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
6 years agoshared: add %g, %G specifiers for group / gid (#10368)
Davide Cavalca [Sat, 13 Oct 2018 08:26:48 +0000 (01:26 -0700)]
shared: add %g, %G specifiers for group / gid (#10368)

6 years agoMerge pull request #10366 from poettering/in-set-fixes
Yu Watanabe [Sat, 13 Oct 2018 08:25:36 +0000 (17:25 +0900)]
Merge pull request #10366 from poettering/in-set-fixes

IN_SET() compile time check fixes

6 years agoMerge pull request #10356 from dtardon/covscan
Lennart Poettering [Fri, 12 Oct 2018 16:43:04 +0000 (18:43 +0200)]
Merge pull request #10356 from dtardon/covscan

assorted coverity/clang fixes

6 years agoMerge pull request #10379 from jwrdegoede/hwdb-updates
Lennart Poettering [Fri, 12 Oct 2018 16:21:15 +0000 (18:21 +0200)]
Merge pull request #10379 from jwrdegoede/hwdb-updates

Hwdb updates

6 years agohwdb: Add mapping for unknown keycodes on Microsofy Reclusa keyboard
Hans de Goede [Fri, 12 Oct 2018 14:52:52 +0000 (16:52 +0200)]
hwdb: Add mapping for unknown keycodes on Microsofy Reclusa keyboard

Add mapping for unknown keycodes on Microsoft Reclusa keyboard.

6 years agohwdb: Add accelerometer orientation quirk for the Onda V80 Plus tablet
Hans de Goede [Fri, 12 Oct 2018 11:10:35 +0000 (13:10 +0200)]
hwdb: Add accelerometer orientation quirk for the Onda V80 Plus tablet

Add accelerometer orientation quirk for the Onda V80 Plus tablet.

6 years agohwdb: Add accelerometer orientation quirk for the Acer One 10 aka S1003
Hans de Goede [Fri, 12 Oct 2018 08:38:00 +0000 (10:38 +0200)]
hwdb: Add accelerometer orientation quirk for the Acer One 10 aka S1003

Add accelerometer orientation quirk for the Acer One 10 2-in-1 also known
as the Acer S1003.

6 years agoefivars: check path_len before using it as loop boundary
David Tardon [Wed, 10 Oct 2018 12:54:05 +0000 (14:54 +0200)]
efivars: check path_len before using it as loop boundary

6 years agojournal-file: avoid calling ftruncate with invalid fd
David Tardon [Wed, 10 Oct 2018 11:56:54 +0000 (13:56 +0200)]
journal-file: avoid calling ftruncate with invalid fd

This can happen if journal_file_close is called from the failure
handling code of journal_file_open before f->fd was established.

6 years agofirewall-util: add an assert that we're not overwriting a buffer
David Tardon [Wed, 10 Oct 2018 07:33:28 +0000 (09:33 +0200)]
firewall-util: add an assert that we're not overwriting a buffer

... like commit f28501279d2c28fdbb31d8273b723e9bf71d3b98 does for
out_interface.

6 years agologin: avoid leak of name returned by uid_to_name()
David Tardon [Tue, 9 Oct 2018 15:26:19 +0000 (17:26 +0200)]
login: avoid leak of name returned by uid_to_name()

6 years agoalloc-util: return NULL if 0-sized allocation is requested
David Tardon [Tue, 9 Oct 2018 14:53:43 +0000 (16:53 +0200)]
alloc-util: return NULL if 0-sized allocation is requested

That would almost certainly be an error (e.g., an overflow in computing
_need_), so it's better to fail.

6 years agodo not try to allocate 0 bytes
David Tardon [Fri, 12 Oct 2018 12:48:41 +0000 (14:48 +0200)]
do not try to allocate 0 bytes

6 years agoSet theme jekyll-theme-minimal
Lennart Poettering [Fri, 12 Oct 2018 12:10:25 +0000 (14:10 +0200)]
Set theme jekyll-theme-minimal

6 years agoSet theme jekyll-theme-dinky
Lennart Poettering [Fri, 12 Oct 2018 11:49:09 +0000 (13:49 +0200)]
Set theme jekyll-theme-dinky

6 years agoCreate CNAME
Lennart Poettering [Fri, 12 Oct 2018 11:48:34 +0000 (13:48 +0200)]
Create CNAME

6 years agoman: fix <manvolnum> of epoll_ctl(2)
Lucas Werkmeister [Fri, 12 Oct 2018 11:24:07 +0000 (13:24 +0200)]
man: fix <manvolnum> of epoll_ctl(2)

6 years agobe consistent about sun_path length
David Tardon [Tue, 9 Oct 2018 13:04:58 +0000 (15:04 +0200)]
be consistent about sun_path length

Most places use the whole buffer for name, without leaving extra space
for the trailing NUL.

6 years agodissect-image: use right comparison function
David Tardon [Tue, 9 Oct 2018 11:50:55 +0000 (13:50 +0200)]
dissect-image: use right comparison function

fstype can be NULL here.

6 years agoconsole: avoid promotion to signed int
David Tardon [Wed, 3 Oct 2018 10:48:58 +0000 (12:48 +0200)]
console: avoid promotion to signed int

coverity message:
sign_extension: Suspicious implicit sign extension: "keydata.Key.ScanCode" with type "UINT16" (16 bits, unsigned) is promoted in "keydata.Key.ScanCode << 16" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned).  If "keydata.Key.ScanCode << 16" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.

6 years agoMerge pull request #10176 from yuwata/udev-cleanup-7
Lennart Poettering [Fri, 12 Oct 2018 10:26:33 +0000 (12:26 +0200)]
Merge pull request #10176 from yuwata/udev-cleanup-7

udev: replace udev_device by sd_device

6 years agosd-event: slightly extend explanatory comment
Lennart Poettering [Fri, 12 Oct 2018 10:12:42 +0000 (12:12 +0200)]
sd-event: slightly extend explanatory comment

6 years agoman: add missing references to sd_event_add_inotify()
Lennart Poettering [Fri, 12 Oct 2018 10:09:29 +0000 (12:09 +0200)]
man: add missing references to sd_event_add_inotify()

These man pages list references to the various sd_event_add_xyz() calls
at the bottom, but sd_event_add_inotify() was never added there.

Moreover, some list references to sd_event_add_post() and
sd_event_add_exit() even though these have shared man pages with
sd_event_add_defer(), and given that the "SEE ALSO" section should
probably reference pages instead of functions let's drop this.

Then, let's always specify the sd_event_add_xyz() calls in the same
order.

Finally, in the sd_event_new(3) text explaining the basic logic,
actually mention sd_event_add_post() and sd_event_add_exit() as well, as
in that case we actually want to list functions, not man pages.

6 years agoupdate TODO
Lennart Poettering [Fri, 12 Oct 2018 10:07:45 +0000 (12:07 +0200)]
update TODO

6 years agoMerge pull request #10369 from yuwata/test-mempool
Lennart Poettering [Fri, 12 Oct 2018 10:21:44 +0000 (12:21 +0200)]
Merge pull request #10369 from yuwata/test-mempool

meson,test: mempool related fixes and add tests for 'thread safety'

6 years agoMerge pull request #10201 from yuwata/fix-10196
Lennart Poettering [Fri, 12 Oct 2018 09:36:08 +0000 (11:36 +0200)]
Merge pull request #10201 from yuwata/fix-10196

sd-netlink: add destroy_callback to sd_netlink_call_async() and fix memleaks in networkd

6 years agotest: sort included headers
Yu Watanabe [Fri, 12 Oct 2018 08:29:52 +0000 (17:29 +0900)]
test: sort included headers

6 years agomeson: fix '-Dstatic-libsystemd=true' or '-Dstatic-libudev=true'
Yu Watanabe [Fri, 12 Oct 2018 02:59:55 +0000 (11:59 +0900)]
meson: fix '-Dstatic-libsystemd=true' or '-Dstatic-libudev=true'

Follow-up for a5d8835c78112206bbf0812dd4cb471f803bfe88.

6 years agotest: add test for 'thread safety' of libudev
Yu Watanabe [Fri, 12 Oct 2018 02:56:45 +0000 (11:56 +0900)]
test: add test for 'thread safety' of libudev

This adds a test for 715a970548d03fed18dc66c411c8b42ff21029cf.

6 years agomeson: do not use mempool from libudev.so
Yu Watanabe [Fri, 12 Oct 2018 02:55:03 +0000 (11:55 +0900)]
meson: do not use mempool from libudev.so

Follow-up for a5d8835c78112206bbf0812dd4cb471f803bfe88.

6 years agotest: add test for 'thread safety' of sd-device
Yu Watanabe [Fri, 12 Oct 2018 02:45:20 +0000 (11:45 +0900)]
test: add test for 'thread safety' of sd-device

This adds a test for a5d8835c78112206bbf0812dd4cb471f803bfe88.

6 years agosd-device: drop unnecessary header
Yu Watanabe [Fri, 12 Oct 2018 02:43:49 +0000 (11:43 +0900)]
sd-device: drop unnecessary header

6 years agotest: add tests for $SYSTEMD_MEMPOOL=
Yu Watanabe [Fri, 12 Oct 2018 02:12:07 +0000 (11:12 +0900)]
test: add tests for $SYSTEMD_MEMPOOL=

This adds tests for b4f607433cac749b617e15b3d5d122322ed2bc71 and
205c085bc36c2c61a09dc40621d8561b135d9b57 (#9792).

6 years agoAdd LOGO to os-release
hellcp [Thu, 11 Oct 2018 20:36:40 +0000 (22:36 +0200)]
Add LOGO to os-release

6 years agotests: fix fallthrough condition for supplementary groups
Davide Cavalca [Thu, 11 Oct 2018 17:45:43 +0000 (10:45 -0700)]
tests: fix fallthrough condition for supplementary groups

6 years agocore: fix member access within null pointer
Yu Watanabe [Thu, 11 Oct 2018 19:24:27 +0000 (04:24 +0900)]
core: fix member access within null pointer

config_parse_tasks_max() is also used for parsing system.conf or
user.conf. In that case, userdata is NULL.

Fixes #10362.

6 years agomacro: rework IN_SET a bit
Lennart Poettering [Thu, 11 Oct 2018 20:07:14 +0000 (22:07 +0200)]
macro: rework IN_SET a bit

This makes use of assert_cc() to guard against missing CASE macros,
instead of a manual implementation that might result in a static
variable to be allocated.

More importantly though this changes the base type for the array used to
determine the number of arguments for the compile time check from "int"
to "long double". This is done in order to avoid warnings from "ubsan"
that possibly large constants are assigned to small types. "long double"
hopefully isn't vulnerable to that.

Fixes: #10332

6 years agomacro: drop -Wdeclaration-after-statement exclusion magic, we dropped that warning...
Lennart Poettering [Thu, 11 Oct 2018 20:05:55 +0000 (22:05 +0200)]
macro: drop -Wdeclaration-after-statement exclusion magic, we dropped that warning anyway from our build

6 years agojournalctl: port JSON output mode to new JSON API
Lennart Poettering [Mon, 23 Jul 2018 18:22:30 +0000 (20:22 +0200)]
journalctl: port JSON output mode to new JSON API

Also, while we are at it, beef it up, by adding json-seq support (i.e.
https://tools.ietf.org/html/rfc7464). This is particularly useful in
conjunction with jq's --seq switch.

6 years agoMerge pull request #10353 from keszybz/more-manager-reloading
Lennart Poettering [Thu, 11 Oct 2018 15:25:03 +0000 (17:25 +0200)]
Merge pull request #10353 from keszybz/more-manager-reloading

More manager reloading cleanups

6 years agoRevert "meson: use c_args in generator scripts (#10289)"
Zbigniew Jędrzejewski-Szmek [Thu, 11 Oct 2018 13:12:41 +0000 (15:12 +0200)]
Revert "meson: use c_args in generator scripts (#10289)"

This reverts commit 56f56d5ad856d9bd1070693490b210e0a0ccde92.

This broke the compilation for coverity under travis. Our build script does
something like this:

$ CFLAGS='-D_Float128=long\ double -D_Float64=double -D_Float64x=long\ double -D_Float32=float -D_Float32x=double' meson cov-build -Dman=false
$ ninja -C build
...
[pid 27096] execve("/usr/bin/cc", ["/usr/bin/cc", "-D_Float128=long", "double", "-D_Float64=double", "-D_Float64x=long", "double", "-D_Float32=float", "-D_Float32x=double", "-E", "-dM", "-include", "linux/capability.h", "-include", "config.h", "-include", "../src/basic/missing.h", "-"], 0x55ab75ea4e80 /* 91 vars */) = 0
cc: error: double: No such file or directory
cc: error: double: No such file or directory
[pid 27096] +++ exited with 1 +++

I'm sure this could be fixed somehow, but since the original motivation for
56f56d5ad856d9bd1070693490b210e0a0ccde92 wasn't very strong, let's just revert
it as this seems to be the simplest solution.

6 years agomanager: simplify error handling in manager_deserialize()
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 11:54:13 +0000 (13:54 +0200)]
manager: simplify error handling in manager_deserialize()

If a memory error occurred, we would still go through the path which sets the
error on ferror(). It is unlikely that ferror() returns true, but it's seems
cleaner to just propagate the error we already have.

The handling of fgets() returning NULL is also simplified: according to the man
page, it returns NULL only on EOF or error. So if feof() returns true, I don't
think we should call ferror() again.

While at it, let's set errno to 0 and check that it is set before returning it
as an error. The man pages for fgets() and feof() do not say anything about
setting errno.

6 years agomanager: also use the reloading "cleanup" function in manager_startup
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 11:41:44 +0000 (13:41 +0200)]
manager: also use the reloading "cleanup" function in manager_startup

Here the behaviour is nominally changed, because we will decrease the
counter on error. But the only caller quits the program if error occurs,
so this makes no practical difference.

6 years agomanager: use the _cleanup_ mechanism to do n_reloading counter handling
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 11:33:49 +0000 (13:33 +0200)]
manager: use the _cleanup_ mechanism to do n_reloading counter handling

No functional change.

6 years agomanager: replace fake block with a strjoina
Zbigniew Jędrzejewski-Szmek [Wed, 10 Oct 2018 11:27:28 +0000 (13:27 +0200)]
manager: replace fake block with a strjoina

The block was created to avoid declaring variables in the middle of the block.
We could now do that, but it's easier to just use strjoina here.

6 years agobusctl: add a --json= output mode
Lennart Poettering [Wed, 4 Jul 2018 13:28:09 +0000 (15:28 +0200)]
busctl: add a --json= output mode

A new switch "-j" or "--json=" is added which transforms dbus
marshalling into json. This is extremely useful in combination with
tools such as "jq" to process bus calls further.

6 years agoMerge pull request #10334 from keszybz/nomempool
Lennart Poettering [Thu, 11 Oct 2018 11:44:34 +0000 (13:44 +0200)]
Merge pull request #10334 from keszybz/nomempool

Use mempool only in progs linked to libsystemd-shared.so

6 years agoMerge pull request #10358 from yuwata/fix-10333
Lennart Poettering [Thu, 11 Oct 2018 11:32:15 +0000 (13:32 +0200)]
Merge pull request #10358 from yuwata/fix-10333

resolve: fix member access within null pointer

6 years agoresolve: fix member access within null pointer
Yu Watanabe [Thu, 11 Oct 2018 09:36:18 +0000 (18:36 +0900)]
resolve: fix member access within null pointer

Fixes #10333.

6 years agoresolve: use structured initializers
Yu Watanabe [Thu, 11 Oct 2018 09:35:04 +0000 (18:35 +0900)]
resolve: use structured initializers

6 years agomeson: use vars we already have defined in status
Zbigniew Jędrzejewski-Szmek [Thu, 11 Oct 2018 09:10:53 +0000 (11:10 +0200)]
meson: use vars we already have defined in status