Lennart Poettering
0df54921bc
tree-wide: use new macro HAS_FEATURE_ADDRESS_SANITIZER everywhere
2018-12-03 17:38:50 +01:00
Lennart Poettering
02e062262f
sd-bus: use _variable_no_sanitize_address_ also for BUS_ERROR_MAP_ELF_REGISTER
2018-12-03 17:35:50 +01:00
Lennart Poettering
7fdf40d247
static-destruct: turn on new _variable_no_sanitize_address_ variable for STATIC_DESTRUCTOR_REGISTER
2018-12-03 17:35:50 +01:00
Lennart Poettering
026c2677fc
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.
2018-12-03 17:35:50 +01:00
Lennart Poettering
be5f77b26e
macro: define HAS_FEATURE_ADDRESS_SANITIZER also on gcc
...
Let's make differences between compilers more minimal.
2018-12-03 17:35:50 +01:00
Evgeny Vereshchagin
289acab951
util-lib: introduce HAS_FEATURE_ADDRESS_SANITIZER
...
https://clang.llvm.org/docs/AddressSanitizer.html#conditional-compilation-with-has-feature-address-sanitizer
2018-12-03 17:35:42 +01:00
Lennart Poettering
f36c39aae5
test: add test for static destructor
2018-12-03 17:34:23 +01:00
Lennart Poettering
a898603563
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.
2018-12-03 13:28:26 +01:00
Lennart Poettering
90b365cee0
json: use new _align_() macro
2018-12-03 13:28:26 +01:00
Lennart Poettering
2ee1c55d6c
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...
2018-12-03 13:28:26 +01:00
Lennart Poettering
d752090f3e
macro: add macros for a couple of more gcc attributes we use
2018-12-03 13:28:26 +01:00
Lennart Poettering
d34dae1817
tree-wide: use gcc attribute macros where appropriate
...
We have these macros already, hence use them.
2018-12-03 13:28:26 +01:00
Yu Watanabe
7934dede41
network: drop unnecessary buffers
2018-12-03 12:15:26 +01:00
Lennart Poettering
ad2bf5df89
Merge pull request #10992 from yuwata/follow-up-10948
...
network: make fib rule accept arbitrary ip protocol
2018-12-03 11:09:04 +01:00
Yu Watanabe
9714c020fc
missing: split network related entries
...
Also adds comments which kernel version added the entries.
Closes #10553 .
2018-12-03 10:31:05 +01:00
Harald Hoyer
4a3b569445
sd-boot: remove Stall() call ( #11029 )
...
This is left-over from debugging.
2018-12-03 10:27:26 +01:00
Susant Sahani
7b3b982217
vxlan: minor coding style fixes.
2018-12-03 02:05:12 +09:00
Yu Watanabe
c818721579
Merge pull request #11011 from poettering/tmpfile-util
...
split up fileio.c a bit
2018-12-03 02:04:31 +09:00
Lennart Poettering
29e719ced0
resolved: sort headers again
2018-12-02 13:22:29 +01:00
Lennart Poettering
686d13b9f2
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.
2018-12-02 13:22:29 +01:00
Lennart Poettering
0a2152f005
util-lib: move open_serialization_fd() to serialize.c
...
It definitely fits better there.
No code changes, just some rearranging.
2018-12-02 13:22:29 +01:00
Lennart Poettering
a12a00c857
resolved: remove duplicate #include
2018-12-02 13:22:29 +01:00
Lennart Poettering
2d9c643b1d
test: remove duplicate #include
2018-12-02 13:22:29 +01:00
Lennart Poettering
e4de72876e
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.
2018-12-02 13:22:29 +01:00
Lennart Poettering
ee228be10c
util-lib: don't include fileio.h from fileio-label.h
...
There's no reason for doing that, hence simply don't.
2018-12-02 13:22:29 +01:00
Lennart Poettering
928b3da0f1
test: remove unnecessary include
2018-12-02 13:22:29 +01:00
Lennart Poettering
f4f84a8a62
test: (void)ify unlink() call
2018-12-02 13:22:29 +01:00
Lennart Poettering
603772810c
fileio: remove unnecessary initialization
2018-12-02 13:22:28 +01:00
Lennart Poettering
8bdc9a90db
fileio: include ctype.h with <> rather than ""
...
It's a system header after all.
2018-12-02 13:22:28 +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
Aleksei Timofeyev
09e5c07fbd
resolved: add missed io-util.h header to resolved-dnstls-openssl.c
...
Regression after commit 5cfa2c3dc0
2018-12-01 12:49:01 +01:00
Evgeny Vereshchagin
37cbcd4642
travis: also build systemd with clang
2018-12-01 04:53:11 +01:00
Evgeny Vereshchagin
f5e75e08b0
travis: use latest instead of rawhide
2018-12-01 06:45:45 +03:00
Lennart Poettering
2c8f15aeca
Merge pull request #11006 from poettering/conf-file-fix
...
minor fixes for conf-files.c
2018-12-01 00:47:22 +01:00
Lennart Poettering
ac20048fc0
Merge pull request #11002 from keszybz/path_join-merging
...
Path join merging
2018-12-01 00:44:58 +01:00
Lennart Poettering
f8ee4eaa48
Merge pull request #11004 from keszybz/remove-fixme-comment
...
socket-util: drop obsolete FIXME comment and add test
2018-12-01 00:01:11 +01:00
Zbigniew Jędrzejewski-Szmek
652ef29887
path-util: allow NULLs in arguments to path_join()
...
This removes the need to remember to put strempty() in places, thus reducing
the likelihood of a stupid mistake.
2018-11-30 22:21:17 +01:00
Lennart Poettering
59ea6e57a5
networkd: refuse IPv6 RADV prefixes that lack Prefix= setting
...
Fixes : #9589
2018-11-30 22:19:28 +01:00
Zbigniew Jędrzejewski-Szmek
15dca3711d
basic/socket-util: use c-escaping to print unprintable socket paths
...
We are pretty careful to reject abstract sockets that are too long to fit in
the address structure as a NUL-terminated string. And since we parse sockets as
strings, it is not possible to embed a NUL in the the address either. But we
might receive an external socket (abstract or not), and we want to be able to
print its address in all cases. We would call socket_address_verify() and
refuse to print various sockets that the kernel considers legit.
Let's do the strict verification only in case of socket addresses we parse and
open ourselves, and do less strict verification when printing addresses of
existing sockets, and use c-escaping to print embedded NULs and such.
More tests are added.
This should make LGTM happier because on FIXME comment is removed.
2018-11-30 21:58:47 +01:00
Zbigniew Jędrzejewski-Szmek
3a48499153
shared/socket-util: do not print empty CID
...
That's just ugly.
2018-11-30 21:40:04 +01:00
Zbigniew Jędrzejewski-Szmek
39e73acb9b
test-socket-util: add test for socket_address_print
2018-11-30 21:40:02 +01:00