]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agoudevadm: improve error output when a device is not specified or specified wrong
Zbigniew Jędrzejewski-Szmek [Mon, 10 Dec 2018 10:06:27 +0000 (11:06 +0100)] 
udevadm: improve error output when a device is not specified or specified wrong

udevadm would dump help() output, instead of printing a message about what is
wrong. That's just bad UX. Let's use a different message if the argument is
missing, and a different one if it is invalid.

Also, rework the code to separate the business logic from argument parsing.
Let's not use "default:" in switch statements. This way, the compiler will warn
us if we miss one of the cases.

5 years agobasic/hostname-util: do truncation last when cleaning up 10897/head
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 11:27:29 +0000 (12:27 +0100)] 
basic/hostname-util: do truncation last when cleaning up

This allows more of the original name to be used if there are invalid
chars in the beginning.

5 years agoPartially unify hostname_is_valid() and dns_name_is_valid()
Zbigniew Jędrzejewski-Szmek [Wed, 5 Dec 2018 11:26:29 +0000 (12:26 +0100)] 
Partially unify hostname_is_valid() and dns_name_is_valid()

This makes hostname_is_valid() apply the ldh checks too, rejecting more
hostnames.

5 years agoresolve: reject host names with leading or trailing dashes in /etc/hosts
Zbigniew Jędrzejewski-Szmek [Wed, 21 Nov 2018 21:58:13 +0000 (22:58 +0100)] 
resolve: reject host names with leading or trailing dashes in /etc/hosts

https://tools.ietf.org/html/rfc1035#section-2.3.1 says (approximately)
that only letters, numbers, and non-leading non-trailing dashes are allowed
(for entries with A/AAAA records). We set no restrictions.

hosts(5) says:
> Host names may contain only alphanumeric characters, minus signs ("-"), and
> periods (".").  They must begin with an alphabetic character and end with an
> alphanumeric character.

nss-files follows those rules, and will ignore names in /etc/hosts that do not
follow this rule.

Let's follow the documented rules for /etc/hosts. In particular, this makes us
consitent with nss-files, reducing surprises for the user.

I'm pretty sure we should apply stricter filtering to names received over DNS
and LLMNR and MDNS, but it's a bigger project, because the rules differ
depepending on which level the label appears (rules for top-level names are
stricter), and this patch takes the minimalistic approach and only changes
behaviour for /etc/hosts.

Escape syntax is also disallowed in /etc/hosts, even if the resulting character
would be allowed. Other tools that parse /etc/hosts do not support this, and
there is no need to use it because no allowed characters benefit from escaping.

5 years agoresolved: rework parsing of /etc/hosts
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 14:52:38 +0000 (15:52 +0100)] 
resolved: rework parsing of /etc/hosts

Do not treat various errors (missing hostname, invalid address) as fatal,
just warn and continue. /etc/hosts is written by humans and we should not
reject the whole file just because a singly entry is not to our liking.

Handle comments as described in hosts(5):
everything from the comment character until the end of the line should be
ignored.

Fixes #10779.

Add tests.

5 years agotest-dns-domain: print function names
Zbigniew Jędrzejewski-Szmek [Wed, 21 Nov 2018 21:57:23 +0000 (22:57 +0100)] 
test-dns-domain: print function names

5 years agotest-resolved-etc-hosts: when parsing an external file, skip other tests
Zbigniew Jędrzejewski-Szmek [Wed, 21 Nov 2018 13:55:07 +0000 (14:55 +0100)] 
test-resolved-etc-hosts: when parsing an external file, skip other tests

This makes timing tests much more useful. So let's simplify things, and just do
the parsing of the external file when that is specified.

5 years agoMerge pull request #11025 from evverx/clang-asan
Evgeny Vereshchagin [Wed, 5 Dec 2018 06:19:46 +0000 (09:19 +0300)] 
Merge pull request #11025 from evverx/clang-asan

travis: also run the tests built with clang under ASan+UBsan

5 years agoMerge pull request #11051 from poettering/sock-addr-un-len
Evgeny Vereshchagin [Wed, 5 Dec 2018 06:05:02 +0000 (09:05 +0300)] 
Merge pull request #11051 from poettering/sock-addr-un-len

trick out ubsan

5 years agosocket-util: Let's trick out ubsan when it validate struct sockaddr_un.sun_path[] 11051/head
Lennart Poettering [Tue, 4 Dec 2018 17:21:25 +0000 (18:21 +0100)] 
socket-util: Let's trick out ubsan when it validate struct sockaddr_un.sun_path[]

Linux is stupid and sometimes returns a "struct sockaddr_un" that is
longer than its fields, as it NUL terminates .sun_path[] even if it has
full length. ubsan detects this, rightfully. Since this is a Linux
misdesign let's trick out ubsan a bit.

Fixes: #11024
5 years agosocket-util: break lines in sockaddr_pretty() signature
Lennart Poettering [Tue, 4 Dec 2018 17:20:48 +0000 (18:20 +0100)] 
socket-util: break lines in sockaddr_pretty() signature

It's soo long, let's make this more readable.

5 years agosocket-util: shorten code a bit
Lennart Poettering [Tue, 4 Dec 2018 17:20:12 +0000 (18:20 +0100)] 
socket-util: shorten code a bit

5 years agoman/daemon.xml: use AM_DISTCHECK_CONFIGURE_FLAGS
Oliver Smith [Tue, 4 Dec 2018 15:05:15 +0000 (16:05 +0100)] 
man/daemon.xml: use AM_DISTCHECK_CONFIGURE_FLAGS

Change the man page to recommend setting AM_DISTCHECK_CONFIGURE_FLAGS
instead of DISTCHECK_CONFIGURE_FLAGS. This is the recommended way from
the automake manual, as otherwise the flag can't be overridden by the
user with something like:
  DISTCHECK_CONFIGURE_FLAGS=--some-additional-flags make distcheck

References:
https://www.gnu.org/software/automake/manual/html_node/Checking-the-Distribution.html
https://osmocom.org/issues/3718

5 years agorules: watch metadata changes on DASD devices
Vojtech Trefny [Tue, 4 Dec 2018 15:47:36 +0000 (16:47 +0100)] 
rules: watch metadata changes on DASD devices

To make sure the change event is emitted and udev db is updated
after metadata changes.

5 years agoMerge pull request #11041 from yuwata/update-missing-v2
Lennart Poettering [Tue, 4 Dec 2018 15:19:02 +0000 (16:19 +0100)] 
Merge pull request #11041 from yuwata/update-missing-v2

missing: separate missing.h more

5 years agoMerge pull request #11042 from yuwata/tiny-coding-style-fixes
Lennart Poettering [Tue, 4 Dec 2018 15:15:09 +0000 (16:15 +0100)] 
Merge pull request #11042 from yuwata/tiny-coding-style-fixes

Tiny coding style fixes

5 years agocgroup: Use varname for cgroup_disable documentation
Chris Down [Tue, 4 Dec 2018 11:42:30 +0000 (11:42 +0000)] 
cgroup: Use varname for cgroup_disable documentation

The current use of literal + replaceable is pretty ugly as it usually
ends up with cgroup_disable= rendered in quotes, which looks really
weird, and this doesn't conform with others of a similar type (for
example, the earlier `DefaultDependencies=no` discussion in the same
file.

5 years agoMerge pull request #11037 from poettering/json-table
Zbigniew Jędrzejewski-Szmek [Tue, 4 Dec 2018 13:32:10 +0000 (14:32 +0100)] 
Merge pull request #11037 from poettering/json-table

optionally output tables as JSON

5 years agoMerge pull request #11009 from poettering/root-cgroup-again
Lennart Poettering [Tue, 4 Dec 2018 11:33:03 +0000 (12:33 +0100)] 
Merge pull request #11009 from poettering/root-cgroup-again

tweak root cgroup attribute fiddling for cgroupsv1 again

5 years agoutil: drop missing.h from util.h 11041/head
Yu Watanabe [Tue, 4 Dec 2018 07:26:09 +0000 (08:26 +0100)] 
util: drop missing.h from util.h

5 years agotree-wide: add whitespace between type and variable name 11042/head
Yu Watanabe [Tue, 4 Dec 2018 08:29:54 +0000 (09:29 +0100)] 
tree-wide: add whitespace between type and variable name

5 years agol10n: update Czech Translation
AsciiWolf [Mon, 3 Dec 2018 14:52:24 +0000 (15:52 +0100)] 
l10n: update Czech Translation

5 years agoip-protocol-list: sort headers
Yu Watanabe [Tue, 4 Dec 2018 08:18:21 +0000 (09:18 +0100)] 
ip-protocol-list: sort headers

5 years agomissing: move char{16,32}_t definitions to missing_type.h
Yu Watanabe [Tue, 4 Dec 2018 07:08:15 +0000 (08:08 +0100)] 
missing: move char{16,32}_t definitions to missing_type.h

5 years agomissing: move capabilities to missing_capability.h
Yu Watanabe [Tue, 4 Dec 2018 06:58:26 +0000 (07:58 +0100)] 
missing: move capabilities to missing_capability.h

5 years agomissing: move prctl related entries to missing_prctl.h
Yu Watanabe [Tue, 4 Dec 2018 06:57:41 +0000 (07:57 +0100)] 
missing: move prctl related entries to missing_prctl.h

5 years agomissing: move statx related definitions to missing_stat.h
Yu Watanabe [Tue, 4 Dec 2018 06:56:19 +0000 (07:56 +0100)] 
missing: move statx related definitions to missing_stat.h

5 years agomissing: move entries defined in magic.h to missing_magic.h
Yu Watanabe [Tue, 4 Dec 2018 06:54:09 +0000 (07:54 +0100)] 
missing: move entries defined in magic.h to missing_magic.h

5 years agomissing: move input related entries to missing_input.h
Yu Watanabe [Tue, 4 Dec 2018 06:51:52 +0000 (07:51 +0100)] 
missing: move input related entries to missing_input.h

5 years agomissing: rename securebits.h to missing_securebits.h
Yu Watanabe [Tue, 4 Dec 2018 06:49:11 +0000 (07:49 +0100)] 
missing: rename securebits.h to missing_securebits.h

5 years agomissing: move btrfs related entries to missing_btrfs.h and missing_btrfs_tree.h
Yu Watanabe [Tue, 4 Dec 2018 06:46:59 +0000 (07:46 +0100)] 
missing: move btrfs related entries to missing_btrfs.h and missing_btrfs_tree.h

5 years agomissing: move missing entries in keyctl.h to missing_keyctl.h
Yu Watanabe [Tue, 4 Dec 2018 06:41:15 +0000 (07:41 +0100)] 
missing: move missing entries in keyctl.h to missing_keyctl.h

5 years agomeson: add missing missing_*.h
Yu Watanabe [Tue, 4 Dec 2018 06:34:47 +0000 (07:34 +0100)] 
meson: add missing missing_*.h

5 years agoanalyze: Fix if not HAVE_SECCOMP
William A. Kennington III [Tue, 4 Dec 2018 01:40:41 +0000 (17:40 -0800)] 
analyze: Fix if not HAVE_SECCOMP

The new systemd analyze code dependend on routines provided by
libseccomp even if HAVE_SECCOMP is false. This expands the code disabled
in analyze-security to make sure we don't depend on seccomp.

5 years agoMerge pull request #11039 from yuwata/fix-11036
Yu Watanabe [Tue, 4 Dec 2018 04:48:47 +0000 (13:48 +0900)] 
Merge pull request #11039 from yuwata/fix-11036

missing: re-add mistakenly dropped entries

5 years agotravis: install llvm to get llvm-symbolizer 11025/head
Evgeny Vereshchagin [Sun, 2 Dec 2018 06:56:03 +0000 (07:56 +0100)] 
travis: install llvm to get llvm-symbolizer

See https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports

5 years agomissing: rearrange missing_if_link.h to support centos 11039/head
Yu Watanabe [Tue, 4 Dec 2018 01:32:32 +0000 (02:32 +0100)] 
missing: rearrange missing_if_link.h to support centos

5 years agomissing: re-add mistakenly dropped entries
Yu Watanabe [Tue, 4 Dec 2018 00:28:23 +0000 (01:28 +0100)] 
missing: re-add mistakenly dropped entries

These entries are mistakenly dropped by 9714c020fc4cda1823c2a77e3fd08aefa7d78b25.

Fixes #11036.

5 years agotravis: also run the tests built with clang under ASan+UBsan
Evgeny Vereshchagin [Sun, 2 Dec 2018 06:39:18 +0000 (07:39 +0100)] 
travis: also run the tests built with clang under ASan+UBsan

5 years agoformat-table: never try to reuse cells that have color/url/uppercase set 11037/head
Lennart Poettering [Mon, 3 Dec 2018 20:39:39 +0000 (21:39 +0100)] 
format-table: never try to reuse cells that have color/url/uppercase set

The table cell reusing code is supposed to be an internal memory
optimization, and not more. This means behaviour should be the same as
if we wouldn't reuse cells.

5 years agotree-wide: specify all table headers in lower-case
Lennart Poettering [Mon, 3 Dec 2018 20:39:12 +0000 (21:39 +0100)] 
tree-wide: specify all table headers in lower-case

5 years agoformat-table: add option to uppercase cells on display
Lennart Poettering [Mon, 3 Dec 2018 20:36:26 +0000 (21:36 +0100)] 
format-table: add option to uppercase cells on display

This adds a per-cell option for uppercasing displayed strings.
Implicitly turn this on for the header row. The fact that we format the
table header in uppercase is a formatting thing after all, hence should
be applied by the formatter, i.e. the table display code.

Moreover, this provides us with the benefit that we can more nicely
reuse the specified table headers as JSON field names, like we already
do: json field names are usually not uppercase.

5 years agomachinectl: optionally output table in JSON
Lennart Poettering [Mon, 3 Dec 2018 19:58:32 +0000 (20:58 +0100)] 
machinectl: optionally output table in JSON

5 years agologinctl: optionally output table in json
Lennart Poettering [Mon, 3 Dec 2018 19:46:33 +0000 (20:46 +0100)] 
loginctl: optionally output table in json

This works now:

  $ loginctl list-session --output=json-pretty

5 years agoformat-table: optionally covert/output table to JSON
Lennart Poettering [Mon, 3 Dec 2018 15:25:34 +0000 (16:25 +0100)] 
format-table: optionally covert/output table to JSON

5 years agoformat-table: use right field for display
Lennart Poettering [Mon, 3 Dec 2018 19:28:15 +0000 (20:28 +0100)] 
format-table: use right field for display

Since .timespan and .timestamp are unionized on top of each other this
doesn't actually matter, but it is still more correct to address it
under it's correct name.

5 years agooutput-mode: add new helper OUTPUT_MODE_IS_JSON()
Lennart Poettering [Mon, 3 Dec 2018 19:43:07 +0000 (20:43 +0100)] 
output-mode: add new helper OUTPUT_MODE_IS_JSON()

Just a pretty way to determine whether the selected output mode is a
JSON output mode.

5 years agooutput-mode: add generic helper to pick right JsonFormatFlags for given OutputMode
Lennart Poettering [Mon, 3 Dec 2018 19:40:02 +0000 (20:40 +0100)] 
output-mode: add generic helper to pick right JsonFormatFlags for given OutputMode

5 years agojson: add new display flag JSON_FORMAT_COLOR_AUTO
Lennart Poettering [Mon, 3 Dec 2018 19:33:02 +0000 (20:33 +0100)] 
json: add new display flag JSON_FORMAT_COLOR_AUTO

Typically we want to enable color when colors_enabled() says so, hence
let's automatize this.

5 years agojson: introduce explicit type for json formatting flags
Lennart Poettering [Mon, 3 Dec 2018 19:27:55 +0000 (20:27 +0100)] 
json: introduce explicit type for json formatting flags

5 years agoMerge pull request #11031 from poettering/gcc-attr-cleanup
Lennart Poettering [Mon, 3 Dec 2018 20:59:00 +0000 (21:59 +0100)] 
Merge pull request #11031 from poettering/gcc-attr-cleanup

various gcc attribute clean-ups

5 years agoanalyze: tweak wording of description for ProtectSystem= (#11035)
David Malcolm [Mon, 3 Dec 2018 20:57:10 +0000 (15:57 -0500)] 
analyze: tweak wording of description for ProtectSystem= (#11035)

5 years agoMerge pull request #10567 from cdown/disable_controller
Lennart Poettering [Mon, 3 Dec 2018 17:58:29 +0000 (18:58 +0100)] 
Merge pull request #10567 from cdown/disable_controller

cgroup: Add DisableControllers= directive to disable controller in subtree

5 years agoMerge pull request #10920 from yuwata/hashmap-destructor
Lennart Poettering [Mon, 3 Dec 2018 16:59:44 +0000 (17:59 +0100)] 
Merge pull request #10920 from yuwata/hashmap-destructor

hashmap: make hashmap_free() call destructors of key or value

5 years agoMerge pull request #10976 from yuwata/typesafe-netlink-call
Lennart Poettering [Mon, 3 Dec 2018 16:55:00 +0000 (17:55 +0100)] 
Merge pull request #10976 from yuwata/typesafe-netlink-call

netlink: introduce typesafe netlink functions

5 years agotree-wide: use new macro HAS_FEATURE_ADDRESS_SANITIZER everywhere 11031/head
Lennart Poettering [Mon, 3 Dec 2018 16:38:50 +0000 (17:38 +0100)] 
tree-wide: use new macro HAS_FEATURE_ADDRESS_SANITIZER everywhere

5 years agosd-bus: use _variable_no_sanitize_address_ also for BUS_ERROR_MAP_ELF_REGISTER
Lennart Poettering [Mon, 3 Dec 2018 16:33:42 +0000 (17:33 +0100)] 
sd-bus: use _variable_no_sanitize_address_ also for BUS_ERROR_MAP_ELF_REGISTER

5 years agostatic-destruct: turn on new _variable_no_sanitize_address_ variable for STATIC_DESTR...
Lennart Poettering [Mon, 3 Dec 2018 16:33:28 +0000 (17:33 +0100)] 
static-destruct: turn on new _variable_no_sanitize_address_ variable for STATIC_DESTRUCTOR_REGISTER

5 years agomacro: add macro for llvm no_sanitize_address attribute
Lennart Poettering [Mon, 3 Dec 2018 16:30:43 +0000 (17:30 +0100)] 
macro: add macro for llvm no_sanitize_address attribute

We want it for global variables, which LLVM supports and GCC currently
does not (GCC does support it for functions, but we care about global
variables here).

Why is this relevant? When asan is used global variables are padded with
hotzones before and after. But we can't have that for the registration
variables we place in special ELF sections: we want them tightly packed
so that we can iterate through them.

Note that for gcc this isn't an issue, as it will pack stuff in
non-standard sections anyway, even if asan is used.

5 years agomacro: define HAS_FEATURE_ADDRESS_SANITIZER also on gcc
Lennart Poettering [Mon, 3 Dec 2018 16:30:19 +0000 (17:30 +0100)] 
macro: define HAS_FEATURE_ADDRESS_SANITIZER also on gcc

Let's make differences between compilers more minimal.

5 years agoutil-lib: introduce HAS_FEATURE_ADDRESS_SANITIZER
Evgeny Vereshchagin [Sun, 2 Dec 2018 07:28:24 +0000 (08:28 +0100)] 
util-lib: introduce HAS_FEATURE_ADDRESS_SANITIZER

https://clang.llvm.org/docs/AddressSanitizer.html#conditional-compilation-with-has-feature-address-sanitizer

5 years agotest: add test for static destructor
Lennart Poettering [Mon, 3 Dec 2018 12:37:18 +0000 (13:37 +0100)] 
test: add test for static destructor

5 years agocgroup: Add DisableControllers= directive to disable controller in subtree 10567/head
Chris Down [Mon, 3 Dec 2018 14:38:06 +0000 (14:38 +0000)] 
cgroup: Add DisableControllers= directive to disable controller in subtree

Some controllers (like the CPU controller) have a performance cost that
is non-trivial on certain workloads. While this can be mitigated and
improved to an extent, there will for some controllers always be some
overheads associated with the benefits gained from the controller.
Inside Facebook, the fix applied has been to disable the CPU controller
forcibly with `cgroup_disable=cpu` on the kernel command line.

This presents a problem: to disable or reenable the controller, a reboot
is required, but this is quite cumbersome and slow to do for many
thousands of machines, especially machines where disabling/enabling a
stateful service on a machine is a matter of several minutes.

Currently systemd provides some configuration knobs for these in the
form of `[Default]CPUAccounting`, `[Default]MemoryAccounting`, and the
like. The limitation of these is that Default*Accounting is overrideable
by individual services, of which any one could decide to reenable a
controller within the hierarchy at any point just by using a controller
feature implicitly (eg. `CPUWeight`), even if the use of that CPU
feature could just be opportunistic. Since many services are provided by
the distribution, or by upstream teams at a particular organisation,
it's not a sustainable solution to simply try to find and remove
offending directives from these units.

This commit presents a more direct solution -- a DisableControllers=
directive that forcibly disallows a controller from being enabled within
a subtree.

5 years agocgroup: Traverse leaves to realised cgroup to release controllers
Chris Down [Tue, 27 Nov 2018 15:49:41 +0000 (15:49 +0000)] 
cgroup: Traverse leaves to realised cgroup to release controllers

This adds a depth-first version of unit_realize_cgroup_now which can
only do depth-first disabling of controllers, in preparation for the
DisableController= directive.

5 years agocgroup: Rework unit_realize_cgroup_now to explicitly be breadth-first
Chris Down [Mon, 26 Nov 2018 13:45:26 +0000 (13:45 +0000)] 
cgroup: Rework unit_realize_cgroup_now to explicitly be breadth-first

systemd currently doesn't really expend much effort in disabling
controllers. unit_realize_cgroup_now *may* be able to disable a
controller in the basic case when using cgroup v2, but generally won't
manage as downstream dependents may still use it.

This code doesn't add any logic to fix that, but it starts the process
of moving to have a breadth-first version of unit_realize_cgroup_now for
enabling, and a depth-first version of unit_realize_cgroup_now for
disabling.

5 years agocgroup: Move attribute application into unit_create_cgroup
Chris Down [Tue, 27 Nov 2018 15:16:35 +0000 (15:16 +0000)] 
cgroup: Move attribute application into unit_create_cgroup

We always end up doing these together, so just colocate them and require
manager state for unit_create_cgroup.

5 years agosd-bus,static-destruct: clean up how we do our ELF section magic
Lennart Poettering [Mon, 3 Dec 2018 12:22:15 +0000 (13:22 +0100)] 
sd-bus,static-destruct: clean up how we do our ELF section magic

This cleans up a bit how we set up things for the ELF section magic:

1. Let's always use our gcc macros, instead of __attribute__ directly

2. Align our structures to sizeof(void*), i.e. the pointer size, rather
   than a fixed 8 or __BIGGEST_ALIGNMENT__. The former is unnecessarily
   high for 32bit systems, the latter too high for 64bit systems. gcc
   seems to use ptr alignment for static variables itself, hence this
   should be good enough for us too. Moreover, the Linux kernel also
   uses pointer alginment for all its ELF section registration magic,
   hence this should be good enough for us too.

3. Let's always prefix the sections we create ourself with SYSTEMD_,
   just to make clear where they come from.

4. Always align the pointer we start from when iterating through these
   lists. This should be unnecessary, but makes things nicely
   systematic, as we'll align all pointers we use to access these
   sections properly.

5 years agojson: use new _align_() macro
Lennart Poettering [Mon, 3 Dec 2018 12:17:28 +0000 (13:17 +0100)] 
json: use new _align_() macro

5 years agotree-wide: drop redundant space between __attribute__ and ((
Lennart Poettering [Mon, 3 Dec 2018 12:15:09 +0000 (13:15 +0100)] 
tree-wide: drop redundant space between __attribute__ and ((

We follow no general rule, but in most cases we do not place a space
outside of macro.h. Hence let's stick to that, and adapt macro.h too,
and follow the rule systematically that there shall not be a space
between __attribute__ and ((...

Yes, this does not matter at all, and is purely OCD cosmetics. But then
again, the uses of __attribute__ are very local only, hence the changes
cleaning this up are small and are unlikely to have to be repeated too
often...

5 years agomacro: add macros for a couple of more gcc attributes we use
Lennart Poettering [Mon, 3 Dec 2018 12:10:09 +0000 (13:10 +0100)] 
macro: add macros for a couple of more gcc attributes we use

5 years agotree-wide: use gcc attribute macros where appropriate
Lennart Poettering [Mon, 3 Dec 2018 12:08:33 +0000 (13:08 +0100)] 
tree-wide: use gcc attribute macros where appropriate

We have these macros already, hence use them.

5 years agonetwork: drop unnecessary buffers
Yu Watanabe [Mon, 3 Dec 2018 09:22:05 +0000 (10:22 +0100)] 
network: drop unnecessary buffers

5 years agoMerge pull request #10992 from yuwata/follow-up-10948
Lennart Poettering [Mon, 3 Dec 2018 10:09:04 +0000 (11:09 +0100)] 
Merge pull request #10992 from yuwata/follow-up-10948

network: make fib rule accept arbitrary ip protocol

5 years agomissing: split network related entries
Yu Watanabe [Sun, 2 Dec 2018 15:27:02 +0000 (16:27 +0100)] 
missing: split network related entries

Also adds comments which kernel version added the entries.

Closes #10553.

5 years agosd-boot: remove Stall() call (#11029)
Harald Hoyer [Mon, 3 Dec 2018 09:27:26 +0000 (10:27 +0100)] 
sd-boot: remove Stall() call (#11029)

This is left-over from debugging.

5 years agovxlan: minor coding style fixes.
Susant Sahani [Sun, 2 Dec 2018 13:04:06 +0000 (18:34 +0530)] 
vxlan: minor coding style fixes.

5 years agoMerge pull request #11011 from poettering/tmpfile-util
Yu Watanabe [Sun, 2 Dec 2018 17:04:31 +0000 (02:04 +0900)] 
Merge pull request #11011 from poettering/tmpfile-util

split up fileio.c a bit

5 years agoresolved: sort headers again 11011/head
Lennart Poettering [Sun, 2 Dec 2018 12:22:14 +0000 (13:22 +0100)] 
resolved: sort headers again

5 years agoutil-lib: split out env file parsing code into env-file.c
Lennart Poettering [Fri, 30 Nov 2018 21:08:41 +0000 (22:08 +0100)] 
util-lib: split out env file parsing code into env-file.c

It's quite complex, let's split this out.

No code changes, just some file rearranging.

5 years agoutil-lib: move open_serialization_fd() to serialize.c
Lennart Poettering [Fri, 30 Nov 2018 20:39:12 +0000 (21:39 +0100)] 
util-lib: move open_serialization_fd() to serialize.c

It definitely fits better there.

No code changes, just some rearranging.

5 years agoresolved: remove duplicate #include
Lennart Poettering [Fri, 30 Nov 2018 20:12:50 +0000 (21:12 +0100)] 
resolved: remove duplicate #include

5 years agotest: remove duplicate #include
Lennart Poettering [Fri, 30 Nov 2018 20:18:34 +0000 (21:18 +0100)] 
test: remove duplicate #include

5 years agoutil-lib: split out all temporary file related calls into tmpfiles-util.c
Lennart Poettering [Fri, 30 Nov 2018 20:05:27 +0000 (21:05 +0100)] 
util-lib: split out all temporary file related calls into tmpfiles-util.c

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.

5 years agoutil-lib: don't include fileio.h from fileio-label.h
Lennart Poettering [Fri, 30 Nov 2018 20:07:21 +0000 (21:07 +0100)] 
util-lib: don't include fileio.h from fileio-label.h

There's no reason for doing that, hence simply don't.

5 years agotest: remove unnecessary include
Lennart Poettering [Fri, 30 Nov 2018 20:17:20 +0000 (21:17 +0100)] 
test: remove unnecessary include

5 years agotest: (void)ify unlink() call
Lennart Poettering [Fri, 30 Nov 2018 20:15:57 +0000 (21:15 +0100)] 
test: (void)ify unlink() call

5 years agofileio: remove unnecessary initialization
Lennart Poettering [Fri, 30 Nov 2018 20:06:16 +0000 (21:06 +0100)] 
fileio: remove unnecessary initialization

5 years agofileio: include ctype.h with <> rather than ""
Lennart Poettering [Fri, 30 Nov 2018 20:05:49 +0000 (21:05 +0100)] 
fileio: include ctype.h with <> rather than ""

It's a system header after all.

5 years agosysusers: define main through macro 10920/head
Yu Watanabe [Sun, 25 Nov 2018 19:42:36 +0000 (04:42 +0900)] 
sysusers: define main through macro

This also fixes possible memleak when uid/gid or user/group name
in database are conflicted.

5 years agosysusers: use fgetgrent_sane()
Yu Watanabe [Sun, 25 Nov 2018 19:41:53 +0000 (04:41 +0900)] 
sysusers: use fgetgrent_sane()

5 years agolldp: rename lldp_neighbor_id_hash_ops and set value destructor
Yu Watanabe [Sun, 25 Nov 2018 18:38:48 +0000 (03:38 +0900)] 
lldp: rename lldp_neighbor_id_hash_ops and set value destructor

5 years agoudev: use hashmap_clear_free_key() and hashmap_free_free_key()
Yu Watanabe [Sun, 25 Nov 2018 18:32:20 +0000 (03:32 +0900)] 
udev: use hashmap_clear_free_key() and hashmap_free_free_key()

5 years agoportable: introduce portable_metadata_hash_ops and use it
Yu Watanabe [Wed, 28 Nov 2018 13:55:40 +0000 (22:55 +0900)] 
portable: introduce portable_metadata_hash_ops and use it

5 years agomachine: introduce machine_hash_ops and use it
Yu Watanabe [Wed, 28 Nov 2018 13:55:13 +0000 (22:55 +0900)] 
machine: introduce machine_hash_ops and use it

5 years agomachine-image: introduce image_hash_ops and use it
Yu Watanabe [Wed, 28 Nov 2018 13:54:44 +0000 (22:54 +0900)] 
machine-image: introduce image_hash_ops and use it

5 years agotmpfiles: define main through macro
Yu Watanabe [Sun, 25 Nov 2018 16:00:54 +0000 (01:00 +0900)] 
tmpfiles: define main through macro

5 years agotmpfiles: make load_unix_sockets() return negative errno on failure
Yu Watanabe [Sun, 25 Nov 2018 15:48:15 +0000 (00:48 +0900)] 
tmpfiles: make load_unix_sockets() return negative errno on failure

5 years agocryptsetup-generator: define main through macro
Yu Watanabe [Sun, 25 Nov 2018 15:19:08 +0000 (00:19 +0900)] 
cryptsetup-generator: define main through macro

5 years agosd-bus: introduce track_item_hash_ops and use it
Yu Watanabe [Sun, 25 Nov 2018 15:04:46 +0000 (00:04 +0900)] 
sd-bus: introduce track_item_hash_ops and use it

5 years agodhcp: introduce dhcp_lease_hash_ops and use it
Yu Watanabe [Sun, 25 Nov 2018 14:58:49 +0000 (23:58 +0900)] 
dhcp: introduce dhcp_lease_hash_ops and use it