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.
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.
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
Lennart Poettering [Mon, 3 Dec 2018 12:37:18 +0000 (13:37 +0100)]
test: add test for static destructor
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.
Lennart Poettering [Mon, 3 Dec 2018 12:17:28 +0000 (13:17 +0100)]
json: use new _align_() macro
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...
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
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.
Yu Watanabe [Mon, 3 Dec 2018 09:22:05 +0000 (10:22 +0100)]
network: drop unnecessary buffers
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
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.
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.
Susant Sahani [Sun, 2 Dec 2018 13:04:06 +0000 (18:34 +0530)]
vxlan: minor coding style fixes.
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
Lennart Poettering [Sun, 2 Dec 2018 12:22:14 +0000 (13:22 +0100)]
resolved: sort headers again
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.
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.
Lennart Poettering [Fri, 30 Nov 2018 20:12:50 +0000 (21:12 +0100)]
resolved: remove duplicate #include
Lennart Poettering [Fri, 30 Nov 2018 20:18:34 +0000 (21:18 +0100)]
test: remove duplicate #include
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.
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.
Lennart Poettering [Fri, 30 Nov 2018 20:17:20 +0000 (21:17 +0100)]
test: remove unnecessary include
Lennart Poettering [Fri, 30 Nov 2018 20:15:57 +0000 (21:15 +0100)]
test: (void)ify unlink() call
Lennart Poettering [Fri, 30 Nov 2018 20:06:16 +0000 (21:06 +0100)]
fileio: remove unnecessary initialization
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.
Yu Watanabe [Fri, 30 Nov 2018 03:57:03 +0000 (04:57 +0100)]
core,run: make SocketProtocol= accept protocol name in upper case an protocol number
Yu Watanabe [Thu, 29 Nov 2018 15:43:40 +0000 (16:43 +0100)]
network: make IPProtocol= also accept IP protocol number
Yu Watanabe [Thu, 29 Nov 2018 15:42:39 +0000 (16:42 +0100)]
network: rename Protocol= in [RoutingPolicyRule] to IPProtocol=
Yu Watanabe [Thu, 29 Nov 2018 15:28:33 +0000 (16:28 +0100)]
test: add tests for ip_protocol_{from,to}_name()
Yu Watanabe [Thu, 29 Nov 2018 15:09:30 +0000 (16:09 +0100)]
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.
Yu Watanabe [Sun, 2 Dec 2018 04:58:18 +0000 (05:58 +0100)]
util: cast smaller type to large type
Yu Watanabe [Thu, 29 Nov 2018 14:58:43 +0000 (15:58 +0100)]
util: rename socket_protocol_{from,to}_name() to ip_protocol_{from,to}_name()
Lennart Poettering [Fri, 30 Nov 2018 16:38:56 +0000 (17:38 +0100)]
tree-wide: remove various unused functions
All found with "cppcheck --enable=unusedFunction".
Evgeny Vereshchagin [Sun, 2 Dec 2018 00:54:21 +0000 (03:54 +0300)]
Merge pull request #11013 from evverx/travis-clang
travis: also build systemd with clang
Susant Sahani [Sat, 1 Dec 2018 09:44:35 +0000 (15:14 +0530)]
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.
```
Aleksei Timofeyev [Sat, 1 Dec 2018 09:10:08 +0000 (14:10 +0500)]
resolved: add missed io-util.h header to resolved-dnstls-openssl.c
Regression after commit
5cfa2c3dc09ffed1
Evgeny Vereshchagin [Fri, 30 Nov 2018 23:45:35 +0000 (00:45 +0100)]
travis: also build systemd with clang
Evgeny Vereshchagin [Sat, 1 Dec 2018 03:28:50 +0000 (04:28 +0100)]
travis: use latest instead of rawhide
Lennart Poettering [Fri, 30 Nov 2018 23:47:22 +0000 (00:47 +0100)]
Merge pull request #11006 from poettering/conf-file-fix
minor fixes for conf-files.c
Lennart Poettering [Fri, 30 Nov 2018 23:44:58 +0000 (00:44 +0100)]
Merge pull request #11002 from keszybz/path_join-merging
Path join merging
Lennart Poettering [Fri, 30 Nov 2018 23:01:11 +0000 (00:01 +0100)]
Merge pull request #11004 from keszybz/remove-fixme-comment
socket-util: drop obsolete FIXME comment and add test
Zbigniew Jędrzejewski-Szmek [Fri, 30 Nov 2018 10:06:24 +0000 (11:06 +0100)]
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.
Lennart Poettering [Fri, 30 Nov 2018 18:34:17 +0000 (19:34 +0100)]
networkd: refuse IPv6 RADV prefixes that lack Prefix= setting
Fixes: #9589
Zbigniew Jędrzejewski-Szmek [Fri, 30 Nov 2018 10:54:42 +0000 (11:54 +0100)]
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.
Zbigniew Jędrzejewski-Szmek [Fri, 30 Nov 2018 14:17:25 +0000 (15:17 +0100)]
shared/socket-util: do not print empty CID
That's just ugly.
Zbigniew Jędrzejewski-Szmek [Fri, 30 Nov 2018 14:13:32 +0000 (15:13 +0100)]
test-socket-util: add test for socket_address_print
Zbigniew Jędrzejewski-Szmek [Fri, 30 Nov 2018 13:23:19 +0000 (14:23 +0100)]
test-socket-util: the usual modernization
Lennart Poettering [Fri, 30 Nov 2018 18:41:59 +0000 (19:41 +0100)]
Merge pull request #10701 from poettering/analyze-security
systemd-analyze: add a new "security" verb for analyzing unit sandboxing options
Lennart Poettering [Fri, 30 Nov 2018 15:56:35 +0000 (16:56 +0100)]
conf-files: remove unused function
Lennart Poettering [Fri, 30 Nov 2018 15:55:57 +0000 (16:55 +0100)]
conf-files: remove misplaced log_oom()
The caller should log in this case (and all callers in fact already do),
hence let's remove the duplicate logging here.
Lennart Poettering [Fri, 30 Nov 2018 15:55:33 +0000 (16:55 +0100)]
conf-files: improve algorithm O(n²) → O(n)
Lennart Poettering [Wed, 7 Nov 2018 16:41:55 +0000 (17:41 +0100)]
update TODO
Lennart Poettering [Fri, 9 Nov 2018 11:19:30 +0000 (12:19 +0100)]
man: document systemd-analyze security
Lennart Poettering [Thu, 8 Nov 2018 08:32:17 +0000 (09:32 +0100)]
analyze: add new security verb
Lennart Poettering [Wed, 14 Nov 2018 17:39:37 +0000 (18:39 +0100)]
format-table: make sure we never call memcmp() with NULL parameters
Lennart Poettering [Fri, 9 Nov 2018 10:38:12 +0000 (11:38 +0100)]
format-table: add calls to query the data in a specific cell
Lennart Poettering [Thu, 8 Nov 2018 20:39:28 +0000 (21:39 +0100)]
format-table: always underline header line
Lennart Poettering [Thu, 8 Nov 2018 20:21:09 +0000 (21:21 +0100)]
format-table: add an API for getting the cell at a specific row/column
Lennart Poettering [Thu, 8 Nov 2018 20:17:47 +0000 (21:17 +0100)]
format-table: add table_update() to update existing entries
Lennart Poettering [Wed, 7 Nov 2018 16:41:32 +0000 (17:41 +0100)]
format-table: optionally allow reversing the sort order for a column
Lennart Poettering [Wed, 7 Nov 2018 14:25:51 +0000 (15:25 +0100)]
format-table: add option to store/format percent and uint64_t values in cells
Lennart Poettering [Tue, 6 Nov 2018 17:37:21 +0000 (18:37 +0100)]
format-table: before outputting a color, check if colors are available
This is in many cases redundant, as a similar check is done by various
callers already, but in other cases (where we read the color from a
static table for example), it's nice to let the color check be done by
the table code itself, and since it doesn't hurt in the other cases just
do it again.
Lennart Poettering [Tue, 6 Nov 2018 11:06:14 +0000 (12:06 +0100)]
format-table: optionally make specific cells clickable links
Lennart Poettering [Thu, 8 Nov 2018 20:16:23 +0000 (21:16 +0100)]
format-table: when duplicating a cell, also copy the color
Lennart Poettering [Wed, 7 Nov 2018 10:09:03 +0000 (11:09 +0100)]
terminal-util: split out file:// generation from terminal_urlify_path()
This way we can use it at other places, for example when preparing URLs
for format_table_set_url()
Lennart Poettering [Fri, 9 Nov 2018 10:37:21 +0000 (11:37 +0100)]
macro: update DIV_ROUND_UP() so that it can be called nested
Lennart Poettering [Tue, 6 Nov 2018 11:06:45 +0000 (12:06 +0100)]
parse-util: allow parse_boolean() to take a NULL argument
It's pretty useful to allow parse_boolean() to take a NULL argument and
return an error in that case, rather than abort. i.e. making this a
runtime rather than programming error allows us to shorten code
elsewhere.
Lennart Poettering [Tue, 6 Nov 2018 11:05:26 +0000 (12:05 +0100)]
analyze: use strv_skip() where appropriate
Lennart Poettering [Tue, 6 Nov 2018 11:04:23 +0000 (12:04 +0100)]
analyze: remove unnecessary negation of bus_error_message() error number parameter
Lennart Poettering [Tue, 6 Nov 2018 11:02:55 +0000 (12:02 +0100)]
analyze: fix include order
Lennart Poettering [Thu, 8 Nov 2018 19:13:54 +0000 (20:13 +0100)]
seccomp-util: drop process_vm_readv from @debug group
it's already part of @ipc, no need to have it in both. Given that @ipc
is much more popular (as it is part of @system-service for example),
let's not define it a second time.
Lennart Poettering [Tue, 6 Nov 2018 16:59:58 +0000 (17:59 +0100)]
locale-util: add logic to output smiley emojis at various happiness levels
Zbigniew Jędrzejewski-Szmek [Fri, 30 Nov 2018 09:43:57 +0000 (10:43 +0100)]
tree-wide: rename path_join_many() to path_join()
$ git grep -e path_join_many -l|xargs sed -r -i 's/path_join_many/path_join/g'
The two test functions are merged into one.
Zbigniew Jędrzejewski-Szmek [Fri, 30 Nov 2018 09:40:38 +0000 (10:40 +0100)]
tree-wide: replace path_join with path_join_many
Zbigniew Jędrzejewski-Szmek [Fri, 30 Nov 2018 09:09:00 +0000 (10:09 +0100)]
Merge pull request #10996 from poettering/oci-prep
Preparation for the nspawn-OCI work
Filipe Brandenburger [Fri, 30 Nov 2018 08:47:13 +0000 (00:47 -0800)]
docs: turn LGTM URL into a markdown link
Claudius Ellsel [Fri, 30 Nov 2018 08:14:30 +0000 (09:14 +0100)]
hwdb: Put Lenovo mouse under the correct category in 70-mouse.hwdb (#10995)
[zj: the entry for a Thinkpad mouse is moved to the end of Lenovo section, and a
Lenovo mouse is moved from Logitech section to Lenovo section.]
Fabrice Fontaine [Thu, 29 Nov 2018 12:22:08 +0000 (13:22 +0100)]
meson.build: fix detection of -Werror=shadow
Pass -Werror=shadow in args of cc.compiles otherwise test will always
succeed
This fix a build failure with gcc 4.7.3
Fixes:
- http://autobuild.buildroot.org/results/
ffd71c473d3b29618c18cd2e04705370266696f2
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Zbigniew Jędrzejewski-Szmek [Thu, 29 Nov 2018 20:38:37 +0000 (21:38 +0100)]
Merge pull request #10990 from keszybz/link-libmount-less
Link libmount less
Zbigniew Jędrzejewski-Szmek [Thu, 29 Nov 2018 09:29:34 +0000 (10:29 +0100)]
Move mount-util.c to shared/
libmount dep is moved from libbasic to libshared, potentially removing
libmount from some build products.
Zbigniew Jędrzejewski-Szmek [Thu, 29 Nov 2018 09:24:39 +0000 (10:24 +0100)]
Split out part of mount-util.c into mountpoint-util.c
The idea is that anything which is related to actually manipulating mounts is
in mount-util.c, but functions for mountpoint introspection are moved to the
new file. Anything which requires libmount must be in mount-util.c.
This was supposed to be a preparation for further changes, with no functional
difference, but it results in a significant change in linkage:
$ ldd build/libnss_*.so.2
(before)
build/libnss_myhostname.so.2:
linux-vdso.so.1 (0x00007fff77bf5000)
librt.so.1 => /lib64/librt.so.1 (0x00007f4bbb7b2000)
libmount.so.1 => /lib64/libmount.so.1 (0x00007f4bbb755000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4bbb734000)
libc.so.6 => /lib64/libc.so.6 (0x00007f4bbb56e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4bbb8c1000)
libblkid.so.1 => /lib64/libblkid.so.1 (0x00007f4bbb51b000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f4bbb512000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f4bbb4e3000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f4bbb45e000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f4bbb458000)
build/libnss_mymachines.so.2:
linux-vdso.so.1 (0x00007ffc19cc0000)
librt.so.1 => /lib64/librt.so.1 (0x00007fdecb74b000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007fdecb744000)
libmount.so.1 => /lib64/libmount.so.1 (0x00007fdecb6e7000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fdecb6c6000)
libc.so.6 => /lib64/libc.so.6 (0x00007fdecb500000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdecb8a9000)
libblkid.so.1 => /lib64/libblkid.so.1 (0x00007fdecb4ad000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fdecb4a2000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fdecb475000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007fdecb3f0000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fdecb3ea000)
build/libnss_resolve.so.2:
linux-vdso.so.1 (0x00007ffe8ef8e000)
librt.so.1 => /lib64/librt.so.1 (0x00007fcf314bd000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007fcf314b6000)
libmount.so.1 => /lib64/libmount.so.1 (0x00007fcf31459000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcf31438000)
libc.so.6 => /lib64/libc.so.6 (0x00007fcf31272000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcf31615000)
libblkid.so.1 => /lib64/libblkid.so.1 (0x00007fcf3121f000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fcf31214000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fcf311e7000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007fcf31162000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fcf3115c000)
build/libnss_systemd.so.2:
linux-vdso.so.1 (0x00007ffda6d17000)
librt.so.1 => /lib64/librt.so.1 (0x00007f610b83c000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007f610b835000)
libmount.so.1 => /lib64/libmount.so.1 (0x00007f610b7d8000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f610b7b7000)
libc.so.6 => /lib64/libc.so.6 (0x00007f610b5f1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f610b995000)
libblkid.so.1 => /lib64/libblkid.so.1 (0x00007f610b59e000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f610b593000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f610b566000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f610b4e1000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f610b4db000)
(after)
build/libnss_myhostname.so.2:
linux-vdso.so.1 (0x00007fff0b5e2000)
librt.so.1 => /lib64/librt.so.1 (0x00007fde0c328000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fde0c307000)
libc.so.6 => /lib64/libc.so.6 (0x00007fde0c141000)
/lib64/ld-linux-x86-64.so.2 (0x00007fde0c435000)
build/libnss_mymachines.so.2:
linux-vdso.so.1 (0x00007ffdc30a7000)
librt.so.1 => /lib64/librt.so.1 (0x00007f06ecabb000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007f06ecab4000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f06eca93000)
libc.so.6 => /lib64/libc.so.6 (0x00007f06ec8cd000)
/lib64/ld-linux-x86-64.so.2 (0x00007f06ecc15000)
build/libnss_resolve.so.2:
linux-vdso.so.1 (0x00007ffe95747000)
librt.so.1 => /lib64/librt.so.1 (0x00007fa56a80f000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007fa56a808000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa56a7e7000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa56a621000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa56a964000)
build/libnss_systemd.so.2:
linux-vdso.so.1 (0x00007ffe67b51000)
librt.so.1 => /lib64/librt.so.1 (0x00007ffb32113000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007ffb3210c000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffb320eb000)
libc.so.6 => /lib64/libc.so.6 (0x00007ffb31f25000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffb3226a000)
I don't quite understand what is going on here, but let's not be too picky.
Lennart Poettering [Mon, 2 Jul 2018 16:22:07 +0000 (18:22 +0200)]
update TODO
Lennart Poettering [Fri, 27 Jul 2018 16:04:11 +0000 (18:04 +0200)]
dev-setup: generalize logic we use to create "inaccessible" device nodes
Let's generalize this, so that we can use this in nspawn later on, which
is pretty useful as we need to be able to mask files from the inner
child of nspawn too, where the host's /run/systemd/inaccessible
directory is not visible anymore. Moreover, if nspawn can create these
nodes on its own before the payload this means the payload can run with
fewer privileges.
Lennart Poettering [Thu, 26 Jul 2018 15:24:51 +0000 (17:24 +0200)]
nspawn: let's also pre-mount /dev/mqueue
Lennart Poettering [Tue, 24 Jul 2018 15:15:33 +0000 (17:15 +0200)]
ptyfwd: optionally override terminal width/height
Lennart Poettering [Tue, 24 Jul 2018 15:12:27 +0000 (17:12 +0200)]
fs-util: beef up chmod_and_chown() a bit
Lennart Poettering [Tue, 24 Jul 2018 15:00:58 +0000 (17:00 +0200)]
capability: add new type for maintaining all five cap sets as one
Lennart Poettering [Mon, 2 Jul 2018 16:20:03 +0000 (18:20 +0200)]
cgroup: use device_path_parse_major_minor() also for block device paths
Not only when we populate the "devices" cgroup controller we need
major/minor numbers, but for the io/blkio one it's the same, hence let's
use the same logic for both.
Lennart Poettering [Fri, 29 Jun 2018 14:49:23 +0000 (16:49 +0200)]
tree-wide: port various parts of the code over to the new device_major_minor_path() calls
Lennart Poettering [Fri, 29 Jun 2018 13:57:49 +0000 (15:57 +0200)]
stat-util: add new APIs device_path_make_{major_minor|canonical}() and device_path_parse_major_minor()
device_path_make_{major_minor|canonical) generate device node paths
given a mode_t and a dev_t. We have similar code all over the place,
let's unify this in one place. The former will generate a "/dev/char/"
or "/dev/block" path, and never go to disk. The latter then goes to disk
and resolves that path to the actual path of the device node.
device_path_parse_major_minor() reverses device_path_make_major_minor(),
also withozut going to disk.
We have similar code doing something like this at various places, let's
unify this in a single set of functions. This also allows us to teach
them special tricks, for example handling of the
/run/systemd/inaccessible/{blk|chr} device nodes, which we use for
masking device nodes, and which do not exist in /dev/char/* and
/dev/block/*
Lennart Poettering [Fri, 29 Jun 2018 10:09:29 +0000 (12:09 +0200)]
cgroups: beef up DeviceAllow= syntax a bit
Previously we'd allow pattern expressions such as "char-input" to match
all input devices. Internally, this would look up the right major to
test in /proc/devices. With this commit the syntax is slightly extended:
- "char-*" can be used to match any kind of character device, and
similar "block-*. This expression would work previously already, but
instead of actually installing a wildcard match it would install many
individual matches for everything listed in /proc/devices.
- "char-<MAJOR>" with "<MAJOR>" being a numerical parameter works now
too. This allows clients to install whitelist items by specifying the
major directly.
The main reason to add these is to provide limited compat support for
clients that for some reason contain whitelists with major/minor numbers
(such as OCI containers).
Lennart Poettering [Fri, 29 Jun 2018 10:03:33 +0000 (12:03 +0200)]
core: add special handling for devices cgroup allow lists for /dev/block/* and /dev/char/* device nodes
This adds some code to hanlde /dev/block/* and /dev/char/* device node
paths specially: instead of actually stat()ing them we'll just parse the
major/minor name from the name. This is useful 'hack' to allow clients
to install whitelists for devices that don't actually have to exist.
Also, let's similarly handle /run/systemd/inaccessible/{blk|chr}. This
allows us to simplify our built-in default whitelist to not require a
"ignore_enoent" mode for these nodes.
In general we should be careful with hardcoding major/minor numbers, but
in this case this should safe.
Lennart Poettering [Fri, 29 Jun 2018 10:01:02 +0000 (12:01 +0200)]
tree-wide: port various parts of the code to use parse_dev()
Lennart Poettering [Mon, 30 Jul 2018 19:29:34 +0000 (21:29 +0200)]
path-util: port path_join() over to path_join_many()
We should probably drop path_join() entirely in the long run (and
then rename path_join_many() to it?), but for now let's make one a
wrapper for the other.
Lennart Poettering [Thu, 28 Jun 2018 20:28:40 +0000 (22:28 +0200)]
path-util: add new path_join_many() API
Lennart Poettering [Fri, 29 Jun 2018 09:58:24 +0000 (11:58 +0200)]
parse-util: rework parse_dev() based on safe_atou() and DEVICE_MAJOR_VALID()/DEVICE_MINOR_VALID()
Let's be a bit more careful when parsing major/minor pairs, and filter
out more corner cases. This also means using safe_atou() rather than
sscanf() to avoid weird negative unsigned handling and such.
Lennart Poettering [Fri, 29 Jun 2018 10:13:33 +0000 (12:13 +0200)]
logind: validate majors/minors we receieve via the bus
Lennart Poettering [Thu, 28 Jun 2018 18:57:15 +0000 (20:57 +0200)]
stat-util: add macros for checking whether major and minor values are in range
As it turns out glibc and the Linux kernel have different ideas about
the size of dev_t and how many bits exist for the major and the minor.
When validating major/minor numbers we should check against the kernel's
actual sizes, hence add macros for this.
Lennart Poettering [Thu, 29 Nov 2018 18:29:02 +0000 (19:29 +0100)]
Merge pull request #10987 from poettering/index-md-work-around
docs: work around GitHub pages weirdness