Zbigniew Jędrzejewski-Szmek
6ea07d4fb4
Merge pull request #12140 from poettering/copy-early
...
chattr/copy.c fixes
2019-03-29 15:02:50 +01:00
Zbigniew Jędrzejewski-Szmek
2818ddc8f4
Merge pull request #12133 from poettering/rseq-whitelist
...
whitelist rseq() system call in `@default` syscall group
2019-03-29 14:59:00 +01:00
Lennart Poettering
8a016c746e
util-lib: when copying files make sure to apply some chattrs early, some late
...
Some chattrs only work sensible if you set them right after opening a
file for create (think: FS_NOCOW_FL). Others only work when they are
applied when the file is fully written (think: FS_IMMUTABLE_FL). Let's
take that into account when copying files and applying a chattr to them.
2019-03-28 18:43:04 +01:00
Lennart Poettering
6fee3be0b4
seccomp: add rseq() to default list of syscalls to whitelist
...
Apparently glibc is going to call this implicitly soon, hence let's
whitelist this by default.
Fixes : #12127
2019-03-28 12:09:38 +01:00
Zbigniew Jędrzejewski-Szmek
10c353e1c5
Remove variable only used for an assert
...
When compiled with -DNDEBUG, we get warnings about set-but-unused variables.
In general, it's not something we care about, but since removing those
variables arguably makes the code nicer, let's just to it in this case.
2019-03-28 09:03:06 +01:00
Lennart Poettering
36dbf97170
Merge pull request #12119 from keszybz/voidify-mkdir-p
...
Voidify mkdir_p() and normalize util.h includes
2019-03-27 15:05:51 +01:00
Zbigniew Jędrzejewski-Szmek
6e5dcce4b1
Voidify more mkdir_p calls
2019-03-27 11:53:12 +01:00
Zbigniew Jędrzejewski-Szmek
ca78ad1de9
headers: remove unneeded includes from util.h
...
This means we need to include many more headers in various files that simply
included util.h before, but it seems cleaner to do it this way.
2019-03-27 11:53:12 +01:00
Lennart Poettering
49bd196d69
Merge pull request #12110 from keszybz/sysv-compat-fix
...
Sysv-compat compilation fix
2019-03-27 09:29:13 +01:00
Lennart Poettering
175b43cb8e
Merge pull request #12116 from keszybz/mock-compilation-fixes
...
Fixes for compilation in Fedora 30 mock
2019-03-27 09:27:20 +01:00
Zbigniew Jędrzejewski-Szmek
10fd1d46fc
shared/install: try even harder to make sure variable is initalized
...
Apparently the fix in a05294ff05 was
not sufficient. Let's declare the two arrays as static variables.
2019-03-26 19:58:17 +01:00
Zbigniew Jędrzejewski-Szmek
be3f37528e
util-lib: fix sentence in comment
2019-03-26 19:06:48 +01:00
Lennart Poettering
427646ea9d
sleep: use negative_errno() where appropriate
2019-03-26 11:17:23 +01:00
Lennart Poettering
64e82c1976
mount-util: beef up bind_remount_recursive() to be able to toggle more than MS_RDONLY
...
The function is otherwise generic enough to toggle other bind mount
flags beyond MS_RDONLY (for example: MS_NOSUID or MS_NODEV), hence let's
beef it up slightly to support that too.
2019-03-25 19:33:55 +01:00
Lennart Poettering
f0a95a2c6d
mount-util: use set_put_strdup() where appropriate
2019-03-25 19:33:55 +01:00
Lennart Poettering
f8b1904f96
mount-util: don't clobber return value in umount_recursive()
...
We shouldn't override 'r' with the result of cunescape(), since we use
it to return the last error of umount().
2019-03-25 19:33:55 +01:00
Lennart Poettering
b82f71c7ff
tree-wide: constify a few static string tables
2019-03-25 14:04:34 +01:00
Yu Watanabe
7bb55ed099
util: fix condition_free_list_type()
...
This fixes a bug introduced by c4f58deab5 .
Closes oss-fuzz#13878, oss-fuzz#13882, oss-fuzz#13884, oss-fuzz#13886, and
oss-fuzz#13888.
2019-03-24 00:34:33 +09:00
Lennart Poettering
16b4623620
Merge pull request #11602 from vesajaaskelainen/dbus-reboot-with-parameters
...
dbus-manager: Add RebootWithParameters d-bus method
2019-03-22 21:07:47 +01:00
Vesa Jääskeläinen
428b296a59
logind: Add support for RebootParameter
...
This adds support for user to set & get reboot parameter for reboot.
As callee would be next issuing Reboot call same policy checks are being used.
If unit file issuing the reboot action defines RebootArgument (or similar) that
setting takes precedence.
2019-03-22 20:30:33 +02:00
Lennart Poettering
e4077ff6f3
nspawn: don't free "fds" twice
...
Previously both run() and run_container() would free 'fds'. Let's fix
that, and let run() free it but make run_container() already remove all
fds from it, because that's what we actually want to do.
Fixes : #12073
2019-03-22 18:11:27 +01:00
Zbigniew Jędrzejewski-Szmek
094eecd29d
Merge pull request #12055 from poettering/save-argc-argv
...
main-func.h and systemctl argc/argv improvements
2019-03-22 16:58:18 +01:00
Vesa Jääskeläinen
77defcf538
systemctl: restore "systemctl reboot ARG" functionality
...
Commit d85515edcf changed logic how reboot is
executed. That commit changed behavior to use emergency action reboot code path
to perform the reboot.
This inadvertently broke rebooting with argument:
$ systemctl reboot custom-reason
Restore original behavior so that if reboot service unit similar to
systemd-reboot.service is executed it is possible to override reboot reason
with "systemctl reboot ARG".
When "systemctl reboot ARG" is executed ARG is placed in file
/run/systemd/reboot-param and reboot is issued using logind's Reboot
dbus-service.
If RebootArgument is specified in systemd-reboot.service it takes precedence
over what systemctl sets.
Fixes : #11828
2019-03-22 17:38:54 +02:00
Lennart Poettering
a0c6f3cb66
main-func: make sure we destruct memory and stuff last
...
Let's terminate pagers and agents before releasing all memory.
2019-03-21 18:10:06 +01:00
Lennart Poettering
60ffa37a65
main-func: implicitly save argc/argv in DEFINE_MAIN_FUNCTION() functions
...
Let's remove the risk of forgetting to save argc/argv if
DEFINE_MAIN_FUNCTION() is used.
2019-03-21 18:10:06 +01:00
Yu Watanabe
c4f58deab5
network,udev: split static condition tests from net_match_config()
2019-03-21 23:37:39 +09:00
Yu Watanabe
828fa6108b
condition: introduce condition_test_list()
2019-03-21 23:37:39 +09:00
Lennart Poettering
c3d13d2ad5
Merge pull request #12058 from keszybz/oci-simplifications
...
Follow-ups for nspawn-oci review
2019-03-21 13:55:09 +01:00
Zbigniew Jędrzejewski-Szmek
19130626a0
nspawn-oci: use SYNTHETIC_ERRNO
2019-03-21 10:51:43 +01:00
David Michael
82bd4da71e
shared/install: Preserve escape characters for escaped unit names
...
Since switching to extract_first_word with no flags for parsing
unit names in 4c9565eea5 , escape
characters will be stripped from escaped unit names such as
"mnt-persistent\x2dvolume.mount" resulting in the unit not being
configured as defined. Preserve escape characters again for
compatibility with existing preset definitions.
2019-03-20 18:26:24 +01:00
Lennart Poettering
054b6be05b
ask-password: add extra paranoid overflow check
2019-03-20 10:48:33 +01:00
Lennart Poettering
e1ed99c8c8
ask-password: erase character read with _cleanup_
...
This is much nicer, since it means we erase the character regardless how
we exit the scope.
2019-03-20 10:48:33 +01:00
Zbigniew Jędrzejewski-Szmek
67fb5f338f
seccomp: allow shmat to be a separate syscall on architectures which use a multiplexer
...
After
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d6040d46817 ,
those syscalls have their separate numbers and we can block them.
But glibc might still use the old ones. So let's just do a best-effort
block and not assume anything about how effective it is.
2019-03-15 15:46:41 +01:00
Zbigniew Jędrzejewski-Szmek
e55bdf9b6c
seccomp: shm{get,at,dt} now have their own numbers everywhere
...
E.g. on i686:
(previously)
arch x86: SCMP_SYS(mmap) = 90
arch x86: SCMP_SYS(mmap2) = 192
arch x86: SCMP_SYS(shmat) = -221
arch x86: SCMP_SYS(shmat) = -221
arch x86: SCMP_SYS(shmdt) = -222
(now)
arch x86: SCMP_SYS(mmap) = 90
arch x86: SCMP_SYS(mmap2) = 192
arch x86: SCMP_SYS(shmat) = 397
arch x86: SCMP_SYS(shmat) = 397
arch x86: SCMP_SYS(shmdt) = 398
The relevant commit seems to be
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d6040d46817 .
2019-03-15 15:28:43 +01:00
Zbigniew Jędrzejewski-Szmek
a75fcef8fb
shared/bootspec: avoid signed-unsigned comparison
...
../src/shared/bootspec.c: In function ‘find_sections’:
../src/shared/bootspec.c:425:23: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
425 | if (n != size)
| ^~
2019-03-15 15:28:43 +01:00
Lennart Poettering
d8b4d14df4
util: split out nulstr related stuff to nulstr-util.[ch]
2019-03-14 13:25:52 +01:00
Lennart Poettering
2b2fec7db0
util: split out errno related stuff
2019-03-14 13:25:51 +01:00
Zbigniew Jędrzejewski-Szmek
94dfd646b3
Merge pull request #11985 from poettering/clean-dir
...
some rafactoring in systemctl/bus-unit-util
2019-03-14 12:21:53 +01:00
Lennart Poettering
d55e43344b
Merge pull request #11971 from keszybz/kernel-install-directory
...
Make kernel-install create entry directory
2019-03-14 10:51:55 +01:00
Lennart Poettering
1b63cc6ea9
bus-unit-procs: use empty_or_root() where appropriate
2019-03-13 17:44:11 +01:00
Lennart Poettering
25b1d72dcc
bus-unit-util: split out code that shows a unit's process tree
...
The code is complex enough to deserve its own .c file. Let's split this
out.
2019-03-13 17:41:41 +01:00
Lennart Poettering
e45c81b8bc
shared: split out code to wait for jobs to complet into its own source file
...
It's complex enough and quite a few functions. Let's hence split this
out.
No code change, just some rearranging of source files.
2019-03-13 17:39:24 +01:00
Lennart Poettering
db7091dca2
bus-unit-util: insist on full initialization
2019-03-13 17:38:43 +01:00
Lennart Poettering
2cdb2c2dc3
bus-unit-util: never call into log_job_error_with_service_result() if we are not a service
...
The call can't handle non-services, hence don't bother.
2019-03-13 17:38:43 +01:00
Lennart Poettering
61e209eb3a
bus-unit-util: move explanations array to inner scope
...
It's specific to service units, hence let's minimize the scope since it
has no validity outside of the log message generation for service units.
2019-03-13 17:38:43 +01:00
Lennart Poettering
190c22189d
bus-unit-util: use structure initialization
2019-03-13 17:38:43 +01:00
Lennart Poettering
1c070ea086
bus-unit-util: use free_and_strdup() where we can
2019-03-13 17:38:43 +01:00
Lennart Poettering
cc5957dca0
bootspec: don't log in boot_entries_load_config_auto() about no ESP
...
Let's do it in the caller instead. That way, logind can stay silent
about it.
Fixes : #11950
2019-03-13 17:06:24 +01:00
Lennart Poettering
760877e90c
util: split out sorting related calls to new sort-util.[ch]
2019-03-13 12:16:43 +01:00
Lennart Poettering
0a9707187b
util: split out memcmp()/memset() related calls into memory-util.[ch]
...
Just some source rearranging.
2019-03-13 12:16:43 +01:00