Yu Watanabe
71da167373
sysusers: define main through macro
...
This also fixes possible memleak when uid/gid or user/group name
in database are conflicted.
2018-12-02 12:18:54 +01:00
Yu Watanabe
f030d36cd0
sysusers: use fgetgrent_sane()
2018-12-02 12:18:54 +01:00
Yu Watanabe
8276855e48
lldp: rename lldp_neighbor_id_hash_ops and set value destructor
2018-12-02 12:18:54 +01:00
Yu Watanabe
e924c60f69
udev: use hashmap_clear_free_key() and hashmap_free_free_key()
2018-12-02 12:18:54 +01:00
Yu Watanabe
67818055b7
portable: introduce portable_metadata_hash_ops and use it
2018-12-02 12:18:54 +01:00
Yu Watanabe
bb1a05d6f3
machine: introduce machine_hash_ops and use it
2018-12-02 12:18:54 +01:00
Yu Watanabe
b07ec5a173
machine-image: introduce image_hash_ops and use it
2018-12-02 12:18:54 +01:00
Yu Watanabe
87938c3bea
tmpfiles: define main through macro
2018-12-02 12:18:54 +01:00
Yu Watanabe
71a0be76cd
tmpfiles: make load_unix_sockets() return negative errno on failure
2018-12-02 12:18:54 +01:00
Yu Watanabe
a4a90e65c7
cryptsetup-generator: define main through macro
2018-12-02 12:18:54 +01:00
Yu Watanabe
f1bcdd0590
sd-bus: introduce track_item_hash_ops and use it
2018-12-02 12:18:49 +01:00
Yu Watanabe
6121fc3059
dhcp: introduce dhcp_lease_hash_ops and use it
2018-12-02 12:17:28 +01:00
Yu Watanabe
5f5b612203
cgtop: use SWAP_TWO() macro
2018-12-02 12:06:07 +01:00
Yu Watanabe
fb8d181e59
cgtop: introduce group_hash_ops and use it
2018-12-02 12:06:02 +01:00
Yu Watanabe
98233ee5e0
test: add tests for destructors of hashmap or set
2018-12-02 12:05:16 +01:00
Yu Watanabe
59a5cda7b9
hash-func: add destructors for key and value
...
If they are set, then they are called in hashmap_clear() or
hashmap_free().
2018-12-02 11:59:07 +01:00
Yu Watanabe
7a08d314f2
tree-wide: make hash_ops typesafe
2018-12-02 07:53:27 +01:00
Yu Watanabe
25073e5012
hash-funcs: make basic hash_ops typesafe
2018-12-02 07:48:29 +01:00
Yu Watanabe
d1005d1c00
hash-funcs: introduce macro to create typesafe hash_ops
2018-12-02 07:48:12 +01:00
Yu Watanabe
e30f9c972b
util: define free_func_t
2018-12-02 06:34:25 +01:00
Yu Watanabe
ee05335f43
hashmap: fix minor coding style issue
2018-12-02 06:34:25 +01:00
Yu Watanabe
302a796f5a
network: use typesafe netlink_call_async() macro where applicable
2018-12-02 06:29:32 +01:00
Yu Watanabe
10ff4eb621
network: rename ndisc_route_handler() to ndisc_netlink_message_handler()
...
As it is also called when configuring addresses.
2018-12-02 06:28:44 +01:00
Yu Watanabe
bd1175bc46
network: add assertions
...
As they do not have default callback functions.
2018-12-02 06:23:45 +01:00
Yu Watanabe
4645ad47ac
network: use route_remove_handler() as the default callback of route_remove()
2018-12-02 06:23:45 +01:00
Yu Watanabe
63ae056909
network: use address_remove_handler() as the default callback of address_remove()
2018-12-02 06:23:45 +01:00
Yu Watanabe
29889b4d24
network: set default callbacks for routing_policy_rule_configure() and routing_policy_rule_remove()
2018-12-02 06:23:45 +01:00
Yu Watanabe
cccf9517f1
network: move address_label_handler() to networkd-address-label.c
...
And use it as the default callback function of address_label_configure().
2018-12-02 06:23:45 +01:00
Yu Watanabe
a9eea6065c
network: simplify dhcp6_get_prefix_delegation()
2018-12-02 06:23:45 +01:00
Yu Watanabe
3365841384
netlink: add typesafe netlink functions
2018-12-02 06:23:40 +01:00
Yu Watanabe
1e26b1dfc7
macro: introduce DEFINE_TRIVIAL_DESTRUCTOR() macro
2018-12-02 06:21:11 +01:00
Yu Watanabe
deae09ccc5
libsystemd: introduce _sd_destroy_t
2018-12-02 06:21:11 +01:00
Yu Watanabe
d2b42d63c4
core,run: make SocketProtocol= accept protocol name in upper case an protocol number
2018-12-02 06:13:47 +01:00
Yu Watanabe
3a269dcf51
network: make IPProtocol= also accept IP protocol number
2018-12-02 06:13:47 +01:00
Yu Watanabe
97f9df9e30
network: rename Protocol= in [RoutingPolicyRule] to IPProtocol=
2018-12-02 06:13:47 +01:00
Yu Watanabe
dca2309108
test: add tests for ip_protocol_{from,to}_name()
2018-12-02 06:13:47 +01:00
Yu Watanabe
0667a0c497
util: introduce parse_ip_protocol()
...
Not only protocol name in lower case, but it optionally accepts
IP protocol name in upper case and IP protocol number.
2018-12-02 06:13:41 +01:00
Yu Watanabe
cedfe0b02b
util: cast smaller type to large type
2018-12-02 05:58:18 +01:00
Yu Watanabe
da96ad5ae2
util: rename socket_protocol_{from,to}_name() to ip_protocol_{from,to}_name()
2018-12-02 05:48:27 +01:00
Lennart Poettering
5dd9527883
tree-wide: remove various unused functions
...
All found with "cppcheck --enable=unusedFunction".
2018-12-02 13:35:34 +09:00
Evgeny Vereshchagin
c26ae3013d
Merge pull request #11013 from evverx/travis-clang
...
travis: also build systemd with clang
2018-12-02 03:54:21 +03:00
Susant Sahani
58a02e4c97
ip rule: fix clang warning.
...
```
[2/1209] Compiling C object 'src/network/src@network@@networkd-core@sta/networkd-routing-policy-rule.c.o'.
FAILED: src/network/src@network@@networkd-core@sta/networkd-routing-policy-rule.c.o
clang -Isrc/network/src@network@@networkd-core@sta -Isrc/network -I../src/network -Isrc/basic -I../src/basic -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -Isrc/libsystemd-network -I../src/libsystemd-network -I. -I../ -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=gnu99 -O0 -g -Wextra -Werror=undef -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Wdate-time -Wnested-externs -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-error=nonnull -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -fPIE -Wno-typedef-redefinition -Wno-gnu-variable-sized-type-not-at-end -Werror=shadow -include config.h -fPIC -MD -MQ 'src/network/src@network@@networkd-core@sta/networkd-routing-policy-rule.c.o' -MF 'src/network/src@network@@networkd-core@sta/networkd-routing-policy-rule.c.o.d' -o 'src/network/src@network@@networkd-core@sta/networkd-routing-policy-rule.c.o' -c ../src/network/networkd-routing-policy-rule.c
../src/network/networkd-routing-policy-rule.c:1071:33: error: format specifies type 'unsigned char' but the argument has type '__u16' (aka 'unsigned short') [-Werror,-Wformat]
rule->sport.start, rule->sport.end);
^~~~~~~~~~~~~~~~~
../src/network/networkd-routing-policy-rule.c:1071:52: error: format specifies type 'unsigned char' but the argument has type '__u16' (aka 'unsigned short') [-Werror,-Wformat]
rule->sport.start, rule->sport.end);
^~~~~~~~~~~~~~~
../src/network/networkd-routing-policy-rule.c:1078:33: error: format specifies type 'unsigned char' but the argument has type '__u16' (aka 'unsigned short') [-Werror,-Wformat]
rule->dport.start, rule->dport.end);
^~~~~~~~~~~~~~~~~
../src/network/networkd-routing-policy-rule.c:1078:52: error: format specifies type 'unsigned char' but the argument has type '__u16' (aka 'unsigned short') [-Werror,-Wformat]
rule->dport.start, rule->dport.end);
^~~~~~~~~~~~~~~
4 errors generated.
```
2018-12-01 15:45:12 +01:00
Lennart Poettering
67e2ea1542
cgroup: suffix unit file settings with "=" in log output
...
Let's follow our recommendations from CODING_STYLE and suffix unit file
settings with "=" everywhere.
2018-12-01 12:57:51 +01:00
Lennart Poettering
be2c032781
core: don't try to write CPU quota and memory limit cgroup attrs on root cgroup
...
In the kernel sources attempts to write to either are refused with
EINVAL. Not sure why these attributes are exported anyway on cgroupsv1,
but this means we really should ignore them altogether.
This simplifies our code as this means cgroupsv1 is more alike cgroupsv2
in this regard.
Fixes : #10969
2018-12-01 12:57:51 +01:00
Lennart Poettering
db3cea2219
update TODO
2018-12-01 12:53:26 +01:00
Lennart Poettering
109b0cbf24
systemctl: rework --wait logic
...
Let's not honour PropertiesChanged signals unless the Jobs properties is
empy. After all we shouldn't consider a service finished unless its
state is inactive/failed *and* no job is queued for it anymore.
2018-12-01 12:53:26 +01:00
Lennart Poettering
3c4832ada4
core: enqueue unit earlier when state changes
...
Previously, we'd enqueue a unit to the dbus queue whenever the state
changed, after we processed the state change fully. This commit to the
beginning of the state change. This has the benefit that when the state
change causes a job to complete the unit is already in the dbus queue,
and thus we get the guarantee that any unit change can be sent out to
clients before the job change.
2018-12-01 12:53:26 +01:00
Lennart Poettering
e6d05912cb
core: when we install a job, announce this via the bus
...
Whenever we enqueue a job, we should announce this on the bus, hence add
both the job and the unit to the dbus queues. (Why both? The former
should be obvious, the latter because we send out Job properties).
In most cases adding these to the queue is not necessary, as
other properties tend to change at the same time and result in a change
being sent out. However, let's clean this up and make it explicit.
2018-12-01 12:53:26 +01:00
Lennart Poettering
641e0d7a1b
core: clarify that the CollectMode bus property is constant
...
it's configured from unit files only, and hence is constant.
2018-12-01 12:53:26 +01:00
Lennart Poettering
af92c603bb
core: send out unit change events when a new invocation ID is acquired
...
It's free, as this generally coincides with unit_start(), but let's make
this clean and explicit.
2018-12-01 12:53:26 +01:00