Commit Graph

46937 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek a7ddeea15d
Merge pull request #17067 from keszybz/rc-local-path
Expose the path to rc.local in the man page
2020-09-16 22:59:53 +02:00
Lennart Poettering 5332d7c6ff repart: don't mark image files generated with --empty=create executable 2020-09-16 18:48:36 +02:00
Lennart Poettering eb5e26112e
Merge pull request #17076 from poettering/dissect-cleanup
minor cleanups to the dissector code
2020-09-16 18:42:12 +02:00
Topi Miettinen f593965161 test-execute: kill Waldo and Quux
Retire /var/lib{,/private}/{quux,waldo} after they have served their purpose.
2020-09-17 00:06:02 +09:00
Yu Watanabe cc0276cc3e test-network: add test for [BridgeMDB] section 2020-09-17 00:04:59 +09:00
Yu Watanabe 8e412d64ce network: add debug message for configuring MDB entries 2020-09-17 00:04:22 +09:00
Yu Watanabe 1f24158971 network: configure bridge MDB entries after bridge has carrier 2020-09-17 00:04:22 +09:00
Yu Watanabe 46205ffcdf network: drop [BridgeMDB] entries if Bridge= is not set 2020-09-17 00:04:22 +09:00
Yu Watanabe 03ae449015 network: check MulticastGroupAddress= is neither a local multicast address nor all nodes address 2020-09-17 00:04:22 +09:00
Yu Watanabe ccea244865 in-addr-util: introduce in4_addr_is_local_multicast() 2020-09-17 00:04:22 +09:00
Yu Watanabe 5643cfc0d9 in-addr-util: introduce in6_addr_is_link_local_all_nodes() 2020-09-17 00:04:22 +09:00
Yu Watanabe 5fb16c7c77 network: drop unnecessary headers 2020-09-17 00:04:22 +09:00
Yu Watanabe 6c9ebb7a90 network: move functions in networkd-mdb.c 2020-09-17 00:04:22 +09:00
Yu Watanabe 6234712ec6
Merge pull request #17066 from keszybz/allow-loopback-addresses
Allow loopback addresses
2020-09-17 00:02:08 +09:00
Lennart Poettering c796b91d2b
Merge pull request #16675 from topimiettinen/exec-syscall-error-action
SystemCallFilter, SystemCallErrorAction error actions kill and log
2020-09-16 17:01:44 +02:00
Zbigniew Jędrzejewski-Szmek c882b71457 man: reorder autogenerated dbus api lists
3e5f04bf64 was trying to do the right thing, but
the resulting list does not match the autogenerated order (which is the same as
the order in vtable definition). I assume the addition was done manually. Fix
the order so that dbus-docs-fresh test is not unhappy.
2020-09-17 00:01:20 +09:00
Lennart Poettering aa088f62d1 gpt: move GPT_LINUX_GENERIC definition next to the user GPT partition types
No code changes, just some reordering.
2020-09-16 16:31:16 +02:00
Lennart Poettering 569a0e42ec dissect: introduce PartitionDesignator as real type 2020-09-16 16:14:01 +02:00
Lennart Poettering f5215bc8d3 dissect: rename mount_options_from_part() → mount_options_from_designator()
After all, it actually takes a designator argument, not a partition
index or so.
2020-09-15 22:23:22 +02:00
Zbigniew Jędrzejewski-Szmek c2ee27a5e7 man: substitute path to rc.local in the man page
Different systems use different paths for it and users are confused when the
man page has a path different than the one on the local system.

https://bugzilla.redhat.com/show_bug.cgi?id=1876905
2020-09-15 17:57:28 +02:00
Lennart Poettering 80dd1125c8 test: remove test-dissect-image
It does pretty much exactly what systemd-dissect does and is a manual
test, hence let's remove it as redundant code.
2020-09-15 17:53:32 +02:00
Zbigniew Jędrzejewski-Szmek 452d2dfd52 meson: RC_LOCAL_SCRIPT_PATH_START to RC_LOCAL_PATH
RC_LOCAL_SCRIPT_PATH_START and RC_LOCAL_SCRIPT_PATH_STOP were was originally
added in the conversion to meson based on the autotools name. In
4450894653 RC_LOCAL_SCRIPT_PATH_STOP was dropped.
We don't need to use such a long name.
2020-09-15 17:44:26 +02:00
Zbigniew Jędrzejewski-Szmek 7e5f1d4b3f socket-proxy: allow localhost addresses
With this change, only manager_connect() in timesync.d uses AI_ADDRCONFIG. There
we are connecting to a remove server, so the flag is appropriate.
2020-09-15 16:45:39 +02:00
Zbigniew Jędrzejewski-Szmek d0e5db44d9 sd-bus: allow localhost addresses
By settings AI_ADDRCONFIG in hints we cannot for example resolve "localhost"
when the local machine only has a loopback interface. This seems like an
unnecessary restriction, drop it.

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1839007.
2020-09-15 16:45:03 +02:00
Franck Bui e66d2eeeeb fstab-generator: add 'nofail' when NFS 'bg' option is used
Otherwise a 'Before=remote-fs.target' dependency is added to the mount unit
which defeats the purpose of 'bg' option.
2020-09-15 16:24:01 +02:00
Lennart Poettering b7b7ace4ea tests: try to allocate a delegated scope unit for our cgroup tests
Prompted-by: #16632
2020-09-15 13:32:15 +02:00
Topi Miettinen 9df2cdd8ec exec: SystemCallLog= directive
With new directive SystemCallLog= it's possible to list system calls to be
logged. This can be used for auditing or temporarily when constructing system
call filters.

---
v5: drop intermediary, update HASHMAP_FOREACH_KEY() use
v4: skip useless debug messages, actually parse directive
v3: don't declare unused variables with old libseccomp
v2: fix build without seccomp or old libseccomp
2020-09-15 12:54:17 +03:00
Topi Miettinen 005bfaf118 exec: Add kill action to system call filters
Define explicit action "kill" for SystemCallErrorNumber=.

In addition to errno code, allow specifying "kill" as action for
SystemCallFilter=.

---
v7: seccomp_parse_errno_or_action() returns -EINVAL if !HAVE_SECCOMP
v6: use streq_ptr(), let errno_to_name() handle bad values, kill processes,
 init syscall_errno
v5: actually use seccomp_errno_or_action_to_string(), don't fail bus unit
parsing without seccomp
v4: fix build without seccomp
v3: drop log action
v2: action -> number
2020-09-15 12:54:17 +03:00
Zbigniew Jędrzejewski-Szmek 5d3fe6f78d test-libcrypt-util: before doing anything check what methods are available
On centos7 ci:

--- test-libcrypt-util begin ---
Found container virtualization none.
/* test_hash_password */
ew3bU1.hoKk4o: yes
$1$gc5rWpTB$wK1aul1PyBn9AX1z93stk1: no
$2b$12$BlqcGkB/7BFvNMXKGxDea.5/8D6FTny.cbNcHW/tqcrcyo6ZJd8u2: no
$5$lGhDrcrao9zb5oIK$05KlOVG3ocknx/ThreqXE/gk.XzFFBMTksc4t2CPDUD: no
$6$c7wB/3GiRk0VHf7e$zXJ7hN0aLZapE.iO4mn/oHu6.prsXTUG/5k1AxpgR85ELolyAcaIGRgzfwJs3isTChMDBjnthZyaMCfCNxo9I.: no
$y$j9T$$9cKOWsAm4m97WiYk61lPPibZpy3oaGPIbsL4koRe/XD: no
2020-09-15 11:52:30 +02:00
Zbigniew Jędrzejewski-Szmek bd99297bd3 test-libcrypt-util: skip test on ppc64 with no xcrypt
I'm tired of trying to figure this out.
2020-09-15 11:52:30 +02:00
Zbigniew Jędrzejewski-Szmek 35e22827a9 shared/libcrypt-util: do not refuse passwords if some other hash is unsupported 2020-09-15 11:52:30 +02:00
Zbigniew Jędrzejewski-Szmek 9de324c3c9 shared/libcrypt-util: add fallback for crypt_ra()
Following the style in missing_syscall.h, we use a non-conflicting name
for the function and use a macro to map to the real name to the replacement.
2020-09-15 11:52:30 +02:00
Zbigniew Jędrzejewski-Szmek 2b49f0ca83 Check for crypt_gensalt_ra() instead of relying on libxcrypt presence
Since the loop to check various xcrypt functions is already in place,
adding one more is cheap. And it is nicer to check for the function
directly. People like to backport things, so we might get lucky even
without having libxcrypt.
2020-09-15 11:52:30 +02:00
Zbigniew Jędrzejewski-Szmek e8644a414a meson: test if we have libcrypt_ra
We always seem to have either libcrypt_r and not the other two, or all
three. So the fallback for libcrypt_ra needs to be based on libcrypt_r.
2020-09-15 11:52:30 +02:00
Zbigniew Jędrzejewski-Szmek 83764f8d00 shared/libcrypt-util: include fewer headers
Now that we wrap crypt_r/ra uses, we can include the header only in libcrypt-util.c.
2020-09-15 11:52:30 +02:00
Zbigniew Jędrzejewski-Szmek 999b49c818 Make test_password_{one,many} also use crypt_ra() 2020-09-15 11:52:30 +02:00
Zbigniew Jędrzejewski-Szmek 6016b4b0ba Add reciprocal test for password hashing and checking 2020-09-15 11:52:30 +02:00
Zbigniew Jędrzejewski-Szmek 2ae297fe0d Move test_password_{one,many} to libcrypt-util.c
They are only used under src/home/, but I want to add tests in test-libcrypt-util.c.
And the functions are almost trivial, so I think it is OK to move them to shared.
2020-09-15 11:52:30 +02:00
Juergen Hoetzel 150c430fd4 busctl: add missing shortopt -l 2020-09-15 09:38:10 +02:00
Yu Watanabe 8cc53fae36 core: use strv_free_and_replace() at one more place 2020-09-15 09:36:34 +02:00
Zbigniew Jędrzejewski-Szmek a937ce2d85 shared/libcrypt-util: use libcrypt_ra()
This lets the libc/xcrypt allocate as much storage area as it needs.
Should fix #16965:

testsuite-46.sh[74]: ==74==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f3e972e1080 at pc 0x7f3e9be8deed bp 0x7ffce4f28530 sp 0x7ffce4f27ce0
testsuite-46.sh[74]: WRITE of size 131232 at 0x7f3e972e1080 thread T0
testsuite-46.sh[74]:     #0 0x7f3e9be8deec  (/usr/lib/clang/10.0.1/lib/linux/libclang_rt.asan-x86_64.so+0x9feec)
testsuite-46.sh[74]:     #1 0x559cd05a6412 in user_record_make_hashed_password /systemd-meson-build/../build/src/home/user-record-util.c:818:21
testsuite-46.sh[74]:     #2 0x559cd058fb03 in create_home /systemd-meson-build/../build/src/home/homectl.c:1112:29
testsuite-46.sh[74]:     #3 0x7f3e9b5b3058 in dispatch_verb /systemd-meson-build/../build/src/shared/verbs.c:103:24
testsuite-46.sh[74]:     #4 0x559cd058c101 in run /systemd-meson-build/../build/src/home/homectl.c:3325:16
testsuite-46.sh[74]:     #5 0x559cd058c00a in main /systemd-meson-build/../build/src/home/homectl.c:3328:1
testsuite-46.sh[74]:     #6 0x7f3e9a88b151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
testsuite-46.sh[74]:     #7 0x559cd0583e7d in _start (/usr/bin/homectl+0x24e7d)
testsuite-46.sh[74]: Address 0x7f3e972e1080 is located in stack of thread T0 at offset 32896 in frame
testsuite-46.sh[74]:     #0 0x559cd05a60df in user_record_make_hashed_password /systemd-meson-build/../build/src/home/user-record-util.c:789
testsuite-46.sh[74]:   This frame has 6 object(s):
testsuite-46.sh[74]:     [32, 40) 'priv' (line 790)
testsuite-46.sh[74]:     [64, 72) 'np' (line 791)
testsuite-46.sh[74]:     [96, 104) 'salt' (line 809)
testsuite-46.sh[74]:     [128, 32896) 'cd' (line 810)
testsuite-46.sh[74]:     [33152, 33168) '.compoundliteral' <== Memory access at offset 32896 partially underflows this variable
testsuite-46.sh[74]:     [33184, 33192) 'new_array' (line 832) <== Memory access at offset 32896 partially underflows this variable
testsuite-46.sh[74]: HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
testsuite-46.sh[74]:       (longjmp and C++ exceptions *are* supported)
testsuite-46.sh[74]: SUMMARY: AddressSanitizer: stack-buffer-overflow (/usr/lib/clang/10.0.1/lib/linux/libclang_rt.asan-x86_64.so+0x9feec)

It seems 'struct crypt_data' is 32896 bytes, but libclang_rt wants more, at least 33168?
2020-09-15 09:30:56 +02:00
Zbigniew Jędrzejewski-Szmek 0e98d17e77 Add a helper function that does make_salt+crypt_r
No functional change.
2020-09-15 09:30:56 +02:00
Yu Watanabe 41bed67613
Merge pull request #16998 from zonque/networkd/mdb
network: add support for setting MDB entries
2020-09-15 16:30:39 +09:00
Christian Göttsche 67f5ae2d69 socket-util: reset length argument for second getsockopt call in fd_[gs]et_rcvbuf
In case the first getsockopt() call changes the value.
2020-09-15 09:35:36 +09:00
Yu Watanabe 3c460bfde6
Merge pull request #16976 from keszybz/systemctl-service-log-levels
systemctl: add service-log-{level,target} verbs
2020-09-15 09:34:07 +09:00
Yu Watanabe c2c61531a2
Merge pull request #17055 from keszybz/two-coverity-fixes
Two coverity fixes
2020-09-15 09:22:39 +09:00
Lennart Poettering 2a407487b2
Merge pull request #17049 from mrc0mmand/code-and-spell-check
tree-wide: assorted cleanups/fixes
2020-09-14 23:00:02 +02:00
Zbigniew Jędrzejewski-Szmek e2146e9b67 basic/copy: vodify unlinkat() call
Not much we can do at this point.

Coverity CID#1432670.
2020-09-14 22:34:43 +02:00
Zbigniew Jędrzejewski-Szmek 649bde89ca test: use pclose() for popen()
Coverity CID#1432701.
2020-09-14 22:32:52 +02:00
Zbigniew Jędrzejewski-Szmek e6e691aebf systemctl: give a nice hint about org.freedesktop.LogControl1 when applicable 2020-09-14 22:12:14 +02:00