1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00
Commit Graph

28364 Commits

Author SHA1 Message Date
Lennart Poettering
9606bc4b4b seccomp: disable RestrictAddressFamilies= for the ABI we shall block, not the one we are compiled for (#5272)
It's a difference. Not a big one, but let's be correct here.
2017-02-12 15:25:40 -05:00
Lucas Werkmeister
ec7924fa21 man: busctl: improve capture description (#5321) 2017-02-12 15:20:08 -05:00
Zbigniew Jędrzejewski-Szmek
179e679edd Merge pull request #5276 from poettering/resolved-cname
a good number of resolved fixes
2017-02-12 15:08:19 -05:00
Zbigniew Jędrzejewski-Szmek
a8cfb1b394 core/dbus: silence gcc warning about unitialized variable
src/core/dbus.c: In function 'find_unit':
src/core/dbus.c:334:15: warning: 'u' may be used uninitialized in this function [-Wmaybe-uninitialized]
         *unit = u;
               ^
src/core/dbus.c:301:15: note: 'u' was declared here
         Unit *u;
               ^
2017-02-12 13:22:18 -05:00
Zbigniew Jędrzejewski-Szmek
4440b27d41 core/manager: silence gcc warning about unitialized variable
At -O3, this was printed a hundred times for various callers of
manager_add_job_by_name(). AFAICT, there is no error and `unit` is always
intialized. Nevertheless, add explicit initialization to silence the noise.

src/core/manager.c: In function 'manager_start_target':
src/core/manager.c:1413:16: warning: 'unit' may be used uninitialized in this function [-Wmaybe-uninitialized]
         return manager_add_job(m, type, unit, mode, e, ret);
                ^
src/core/manager.c:1401:15: note: 'unit' was declared here
         Unit *unit;
               ^
2017-02-12 12:56:40 -05:00
Zbigniew Jędrzejewski-Szmek
7a6a095a9e core/manager: make manager_load_unit*() functions always take output arg
We were inconsistent, manager_load_unit_prepare() would crash if _ret was ever NULL.
But none of the callers use NULL. So simplify things and require it to be non-NULL.
2017-02-12 12:40:09 -05:00
Hans de Goede
3746771220 hwdb: Cube iwork8 air button keymap fixup
The home and power buttons on the Cube iwork8 air tablet are swapped,
add a hwdb entry fixing this up.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2017-02-12 12:45:21 +01:00
Hans de Goede
57bb707d48 rules: Add extended evdev/input match rules for event nodes with the same name
Sometimes a system may have 2 input event nodes with the same name where
we only want to apply keyboard hwdb rules to 1 of the 2 devices.

This problem happens e.g. on devices where the soc_button_array driver is
used (e.g. intel atom based tablets) which registers 2 event nodes with
the name "gpio-keys".

This commit adds a new extended match rule which extends the match to also
check $attr{phys} and $attr{capabilities/ev}, allowing to differentiate
between devices with an identical name.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2017-02-12 12:43:23 +01:00
Lennart Poettering
6818c54ca6 core: skip ReadOnlyPaths= and other permission-related mounts on PermissionsStartOnly= (#5309)
ReadOnlyPaths=, ProtectHome=, InaccessiblePaths= and ProtectSystem= are
about restricting access and little more, hence they should be disabled
if PermissionsStartOnly= is used or ExecStart= lines are prefixed with a
"+". Do that.

(Note that we will still create namespaces and stuff, since that's about
a lot more than just permissions. We'll simply disable the effect of
the four options mentioned above, but nothing else mount related.)

This also adds a test for this, to ensure this works as intended.

No documentation updates, as the documentation are already vague enough
to support the new behaviour ("If true, the permission-related execution
options…"). We could clarify this further, but I think we might want to
extend the switches' behaviour a bit more in future, hence leave it at
this for now.

Fixes: #5308
2017-02-12 00:44:46 -05:00
Doug Christman
963e3d8373 calendarspec: fix duplicate detection (#5310)
a2eb5ea79c added a new field to `CalendarComponent`; update
`normalize_chain` to compare all fields when dropping duplicates
2017-02-12 00:39:17 -05:00
Evgeny Vereshchagin
0d7578dc30 shared: pass *unsigned_long to namespace_flag_from_string_many (#5315)
Fixes:
```
src/shared/bus-unit-util.c: In function ‘bus_append_unit_property_assignment’:
src/shared/bus-unit-util.c:570:65: warning: passing argument 2 of ‘namespace_flag_from_string_many’ from incompatible pointer type [-Wincompatible-pointer-types]
                         r = namespace_flag_from_string_many(eq, &flags);
                                                                 ^
In file included from src/shared/bus-unit-util.c:31:0:
src/shared/nsflags.h:41:5: note: expected ‘long unsigned int *’ but argument is of type ‘uint64_t * {aka long long unsigned int *}’
 int namespace_flag_from_string_many(const char *name, unsigned long *ret);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Closes #5312
2017-02-12 00:38:16 -05:00
Evgeny Vereshchagin
b9e2d822d0 shared: convert unsigned long to uint64_t explicitly (#5314)
Closes #5313
2017-02-12 00:36:34 -05:00
Zbigniew Jędrzejewski-Szmek
e0686b73ac Merge pull request #5303 from poettering/deleted-units
a small number of install and unit management related fixes
2017-02-12 00:31:39 -05:00
Michael Shields
501bf2d5d2 It's now ok to use Google NTP servers (#5311) 2017-02-12 00:30:40 -05:00
Lucas Werkmeister
dbb1d5cf69 man: systemd.journal-fields: document _SYSTEMD_INVOCATION_ID (#5316)
#4067 added documentation to systemd.exec(5), but not systemd.journal-fields(7).
2017-02-12 00:27:58 -05:00
Zbigniew Jędrzejewski-Szmek
303c0bf80c test-execute: use __func__ to shorten messages 2017-02-12 00:26:19 -05:00
Zbigniew Jędrzejewski-Szmek
e94681ad15 README: document capsh's usefulness 2017-02-12 00:26:19 -05:00
Zbigniew Jędrzejewski-Szmek
0608ba9826 test-execute: detect missing capsh in all tests
Fixes #5273.
2017-02-12 00:26:19 -05:00
Zbigniew Jędrzejewski-Szmek
050db122ba Merge pull request #5250 from ddstreet/test-sys-nodes-script
replace test/sys.tar.xz with script to create test/sys/ contents
2017-02-10 19:52:58 -05:00
Florian Klink
a0e5c15d4f networkd: add IPv6ProxyNDPAddress support (#5174)
IPv6 Neighbor discovery proxy is the IPv6 equivalent to proxy ARP for IPv4.
It is required when ISPs do not unconditional route IPv6 subnets
to their designated target, but expect neighbor solicitation messages
for every address on a link.

A variable IPv6ProxyNDPAddress= is introduced to the [Network] section,
each representing a IPv6 neighbour proxy entry in the neighbour table.
2017-02-11 00:47:55 +01:00
Zbigniew Jędrzejewski-Szmek
680a752c83 basic/architecture: adjust Risc-V ifdef (#5304)
https://lists.freedesktop.org/archives/systemd-devel/2017-February/038286.html

Let's keep both the old and new for now, so systemd builds correctly in either
environment. Later on we should drop the old.
2017-02-10 23:48:22 +01:00
Lennart Poettering
f2d9751c59 seccomp: order seccomp ABI list, so that our native ABI comes last (#5306)
this way, we can still call seccomp ourselves, even if seccomp() is
blocked by the filter we are installing.

Fixes: #5300
2017-02-10 23:47:50 +01:00
Dan Streetman
2a478ebfa1 test: remove sys.tar.xz
The tarball is no longer needed, as the sys-script.py script creates
all the sys/ contents.
2017-02-10 15:29:52 -05:00
Dan Streetman
741111c2ed test: change Makefile.am to use sys-script.py instead of sys.tar.xz 2017-02-10 15:29:46 -05:00
Dan Streetman
d95b329d70 test: create sys-script.py script
The script contains the contents of all sys/ test files, and creates
all dirs/links/files when run.  This replaces the sys.tar.xz tarball
that contained sys/, so changes to sys files only require a simple
commit in git, instead of checking in an entire new tarball for each
sys/ change.
2017-02-10 15:29:23 -05:00
Dan Streetman
d001ac2c01 test: add script to convert sys/ into sys-script.py
Instead of keeping all sys/ nodes in a tarball, use a script
"sys-script.py" to create all the sys/ entries.

This adds a script to create that initial "sys-script.py" script, using
an existing sys/ directory, created from the sys.tar.xz contents.
The "sys-script.py" can then be edited or recreated later, when any sys/
files are added or modified; the change will be only a patch to the
"sys-script.py" script in git, instead of forcing git to store a new
binary tarball.
2017-02-10 15:27:18 -05:00
Lennart Poettering
c3c7eb7d7d path-lookup: if $HOME can be determined but $XDG_RUNTIME_DIR can't, is it
So far, if either $HOME or $XDG_RUNTIME_DIR is not set we wouldn't use
either, and fail acquire_config_dirs() and acquire_control_dirs() in
their entireties. With this change, let's make use of the variables we
can acquire, and don't bother with the other.

Specifically this means: in both acquire_config_dirs() and
acquire_control_dirs() handle ENXIO from user_config_dir() and
user_runtime_dir() directly, instead of propagating it up and handling
it in the caller.
2017-02-10 15:18:23 +01:00
Lennart Poettering
b9418b053a path-lookup: drop redundant strv_isempty() check
If the strv is empty, then strv_extend_strv_concat() is a NOP anyway,
and hence there is no reason to guard for this explicitly.
2017-02-10 15:17:18 +01:00
Lennart Poettering
c49970743e path-lookup: try harder acquiring them $HOME of a user
Let's use get_home_dir() for figuring out the home directory, so that
there's a good chance we succeed figuring out unit locations even if
$HOME isn't set.

Fixes: #5260
2017-02-10 15:16:11 +01:00
Lennart Poettering
d0fd66a379 install: never hit assert() when we can't figure out where to write configuration symlinks
Under specific circumstances it might happen that we can't figure out
where to place our symlinks, for example because we are supposed to
create them in the runtime directory but $XDG_RUNTIME_DIR is not set. In
this case, return -ENXIO instead of hitting an assert().

(Yeah, the error isn't very descriptive, but for now this should at
least be good enough to remove the assert() being hit.)
2017-02-10 15:14:18 +01:00
Lennart Poettering
637d6e5b9c install: when disabling units, do so even if the unit is missing
In some cases there might be unit symlinks in .wants/ or .requires/
directories even though the unit is otherwise fully removed. In this
case, don't fail removal, but still remove the symlinks.

This reworks the symlink marking logic to always add unit files that we
are missing to the changes list, but proceed with any symlink removal
for them. This way we'll still generate useful hints that a unit is
missing if you invoke "systemctl disable idontexist.service", but also
still remove any link to it.

Fixes: #4995
2017-02-10 14:36:17 +01:00
Lennart Poettering
807fa5d9a0 dbus: check selinux privilege before returning process list
We protect less interetsing stuff with selinux "status", let's do that
here too.
2017-02-10 11:54:18 +01:00
Lennart Poettering
8367fea557 core: make sure to destroy all name watching bus slots when we are kicked off the bus (#5294)
Fixes: #4528
2017-02-09 21:54:48 -05:00
Martin Pitt
d26fdaa236 tests: show journal on systemd-resolved.service failures (#5297)
In networkd-test.py, show resolved's journal on failure, to debug issues
like https://github.com/systemd/systemd/pull/5283.
2017-02-09 21:30:44 -05:00
Lennart Poettering
7961116e2c seccomp: add forgotten munmap() syscall to @file-system (#5291)
We added mmap() and mmap2(), but forgot munmap(). Fix that.

Pointed out by @lucaswerkmeister:

https://github.com/systemd/systemd/pull/4537#issuecomment-273275298
2017-02-09 21:29:33 -05:00
Zbigniew Jędrzejewski-Szmek
1c37a73210 Merge pull request #5293 from poettering/seccomp-docs
Two doc fixes
2017-02-09 21:28:12 -05:00
Evgeny Vereshchagin
aac9c8871e Merge pull request #5295 from poettering/shutup-canonicalize
Shut up canonicalize debug log messages
2017-02-10 04:03:59 +03:00
Lennart Poettering
fa07c85956 dbus: permit seeing process list of units whose unit files are missing
Previously, we'd refuse the GetUnitProcesses() bus call if the unit file
couldn't be loaded. Which is wrong, as admins should be able to inspect
services whose unit files was deleted. Change this logic, so that we
permit introspecting the processes of any unit that is loaded,
regardless if it has a unit file or not.

(Note that we won't load unit files in GetUnitProcess(), but only
operate on already loaded ones. That's because only loaded units can
have processes — as that's how our GC logic works — and hence loading
the unit just for the process tree is pointless, as it would be empty).

See: #4995
2017-02-09 21:04:22 +01:00
Lennart Poettering
058db92528 dropin: always initialize return parameters on success
Just as a matter of coding style: whenever we return successfully, let's
make sure all our return parameters are properly initialized to
something.
2017-02-09 20:10:03 +01:00
Lennart Poettering
a09d3eafac dropin: let's reduce duplicate a bit
After generating the template name we can shortcut things and just call
unit_file_find_dirs() from inside itself, just with the new name and
save a good number of duplicate lines.
2017-02-09 20:08:58 +01:00
Lennart Poettering
96bb2fd8bd dropin: let's prefer strjoina() over strjoin() 2017-02-09 20:08:44 +01:00
Lennart Poettering
09c624878a dropin: downgrade logging about paths we cannot canonicalize
After all, most units won't have drop-in dirs, hence there's no point in
logging about that.

Fixes: #5252
2017-02-09 20:08:24 +01:00
Lennart Poettering
66a5b902ff man: update pam_systemd and systemd-logind man pages a bit
This builds on @utezduyar's #4640, but extends on it.

Fixes: #4550
Replaces: #4640
2017-02-09 18:44:34 +01:00
Lennart Poettering
0b8fab97cf man: improve documentation on seccomp regarding alternative ABIs
Let's clarify that RestrictAddressFamilies= and MemoryDenyWriteExecute=
are only fully effective if non-native system call architectures are
disabled, since they otherwise may be used to circumvent the filters, as
the filters aren't equally effective on all ABIs.

Fixes: #5277
2017-02-09 18:42:17 +01:00
Zbigniew Jędrzejewski-Szmek
9c0f732c62 Introduce '## ' as internal comment prefix in .in files and filter out a comment (#5289)
Sometimes we have comments which don't make sense outside of the systemd
codebase, so let's filter them out from the user-visible files.

Fixes #5286.
2017-02-09 16:28:37 +01:00
Lennart Poettering
12bf233175 resolved: if strict DNSSEC mode is selected never downgrade below DNSSEC server feature level due to packet loss
Fixes: #4315
2017-02-09 16:13:07 +01:00
Lennart Poettering
e96de0ce47 resolved: also synthesize records for the full local hostname
Previously, we'd only synthesize RRs for the LLMNR and mDNS versions of
the hostnames (i.e. the first label of the kernel hostname, as well as
the first label of the kernel hostname suffixed with .local). With this
change, we also synthesize an RR for the full hostname, which is
relevant in case it has more than one label.

Fixes: #5041
2017-02-09 16:13:07 +01:00
Lennart Poettering
a1077c8447 nss-myhostname: don't fill scopeid for non-link-local addresses
Inspired by #4465, we shouldn't do this for nss-myhostname either.
2017-02-09 16:13:07 +01:00
Lennart Poettering
eb08640a44 resolved: when a server response with REFUSED, try a different one
Fixes: #4264
2017-02-09 16:13:07 +01:00
Lennart Poettering
27007efff6 nss-resolve: don't set scopeindex for non-link-local addresses
Apparently some apps don't like that. And given that this isn't
necessary for link-local addresses, let's suppress this information.

Fixes: #4465
2017-02-09 16:13:07 +01:00