summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-02-01cgls: add --unit to show unitsZbigniew Jędrzejewski-Szmek
$ systemd-cgls -u systemd-journald.service machine.slice I opted for a "global" switch, instead of modifying the behaviour of just one argument. It seem to be a more useful setting, since usually one will want to query one or more units, and not mix unit names with paths. Closes #5156.
2017-02-01shared/cgroup-show: extract funtion to query unit cgroup pathZbigniew Jędrzejewski-Szmek
…and use it where possible.
2017-02-01cgtop: use common function to query cgroup rootZbigniew Jędrzejewski-Szmek
show_cgroup_get_root_and_warn is renamed to show_cgroup_get_path_and_warn because it now optionally allows querying a non-root path. This removes duplicated code and teaches cgtop to combine -M with a root prefix: $ systemd-cgtop -M myprecious /system.slice ...
2017-02-01cgls: make function to query cgroup root publicZbigniew Jędrzejewski-Szmek
No functional change.
2017-02-01Merge pull request #5191 from keszybz/tweaksZbigniew Jędrzejewski-Szmek
2017-02-01Revert "Trivial typo fixes and code refactorings (#5191)"Zbigniew Jędrzejewski-Szmek
Let's do a merge to preserve all the commit messages. This reverts commit 785d345145bbd06c8f1c75c6a0b119c4e8f411db.
2017-02-01Trivial typo fixes and code refactorings (#5191)Zbigniew Jędrzejewski-Szmek
* logind: trivial simplification free_and_strdup() handles NULL arg, so make use of that. * boot: fix two typos * pid1: rewrite check in ignore_proc() to not check condition twice It's harmless, but it seems nicer to evaluate a condition just a single time. * core/execute: reformat exec_context_named_iofds() for legibility * core/execute.c: check asprintf return value in the usual fashion This is unlikely to fail, but we cannot rely on asprintf return value on failure, so let's just be correct here. CID #1368227. * core/timer: use (void) CID #1368234. * journal-file: check asprintf return value in the usual fashion This is unlikely to fail, but we cannot rely on asprintf return value on failure, so let's just be correct here. CID #1368236. * shared/cgroup-show: use (void) CID #1368243. * cryptsetup: do not return uninitialized value on error CID #1368416.
2017-02-01nspawn: Print attempted execv() path on failure (#5199)Philip Withnall
The failure message is typically currently: execv() failed: No such file or directory which is not very useful because it doesn’t tell you which file or directory it was trying to exec.
2017-02-01Merge pull request #5166 from keszybz/gcc7Evgeny Vereshchagin
Fixes for gcc 7 and new µhttpd & glibc warnings
2017-01-31Merge pull request #5146 from ssahani/ifname-aliasZbigniew Jędrzejewski-Szmek
networkd: Allow ':' in label This reverts a341dfe563 and takes a slightly different approach: anything is allowed in network interface labels, but network interface names are verified as before (i.e. amongst other things, no colons are allowed there).
2017-01-31nss-util: silence warning about deprecated RES_USE_INET6Zbigniew Jędrzejewski-Szmek
src/nss-resolve/nss-resolve.c: In function ‘_nss_resolve_gethostbyname_r’: src/nss-resolve/nss-resolve.c:680:13: warning: RES_USE_INET6 is deprecated NSS_GETHOSTBYNAME_FALLBACKS(resolve); ^~~~~~~~~~~~~~~~~~~~~~~~~ In glibc bz #19582, RES_USE_INET6 was deprecated. This might make sense for clients, but they didn't take into account nss module implementations which *must* continue to support the option. glibc internally defines DEPRECATED_RES_USE_INET6 which can be used without emitting a warning, but it's not exported publicly. Let's do the same, and just copy the definition to our header.
2017-01-31MurmurHash: all /* fall through */ commentsZbigniew Jędrzejewski-Szmek
2017-01-31cryptsetup: do not return uninitialized value on errorZbigniew Jędrzejewski-Szmek
CID #1368416.
2017-01-31journal/lookup3: silence gcc 7 implicit-fallthrough warningZbigniew Jędrzejewski-Szmek
This file doesn't include any of our headers, so just use the pragma without defining it in macros.h
2017-01-31tree-wide: adjust fall through comments so that gcc is happyZbigniew Jędrzejewski-Szmek
gcc 7 adds -Wimplicit-fallthrough=3 to -Wextra. There are a few ways we could deal with that. After we take into account the need to stay compatible with older versions of the compiler (and other compilers), I don't think adding __attribute__((fallthrough)), even as a macro, is worth the trouble. It sticks out too much, a comment is just as good. But gcc has some very specific requiremnts how the comment should look. Adjust it the specific form that it likes. I don't think the extra stuff we had in those comments was adding much value. (Note: the documentation seems to be wrong, and seems to describe a different pattern from the one that is actually used. I guess either the docs or the code will have to change before gcc 7 is finalized.)
2017-01-31nspawn: fix clobbering of selinux context argZbigniew Jędrzejewski-Szmek
First bug fixed by gcc 7. Yikes.
2017-01-31pid1: remove duplicate const attributeZbigniew Jędrzejewski-Szmek
gcc 7 started warning about this.
2017-01-31microhttpd-util: silence warnings about deprecated optionsZbigniew Jędrzejewski-Szmek
2017-01-31core: fix copy paste error (s/source/destination/) (#5197)Evgeny Vereshchagin
``` -bash-4.3# systemd-run --property BindPaths=/etc:tmp/hey sh -c 'ls /tmp/hey' ``` prints `Destination path tmp/hey is not absolute.` instead of `Destination path /etc is not absolute.` CID #1368239
2017-01-31shared/cgroup-show: use (void)Zbigniew Jędrzejewski-Szmek
CID #1368243.
2017-01-31journal-file: check asprintf return value in the usual fashionZbigniew Jędrzejewski-Szmek
This is unlikely to fail, but we cannot rely on asprintf return value on failure, so let's just be correct here. CID #1368236.
2017-01-31core/timer: use (void)Zbigniew Jędrzejewski-Szmek
CID #1368234.
2017-01-31core/execute.c: check asprintf return value in the usual fashionZbigniew Jędrzejewski-Szmek
This is unlikely to fail, but we cannot rely on asprintf return value on failure, so let's just be correct here. CID #1368227.
2017-01-31core/execute: reformat exec_context_named_iofds() for legibilityZbigniew Jędrzejewski-Szmek
2017-01-31coredump: really extract container cmdline (#5167)Evgeny Vereshchagin
Fixes: ``` root# systemd-nspawn -D ./cont/ --register=no /bin/sh -c '/bin/sh -c "kill -ABRT \$\$"' ... Container cont failed with error code 134. root# journalctl MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1 -o verbose | grep -i container_cmdline ...prints nothing... ...should be COREDUMP_CONTAINER_CMDLINE=systemd-nspawn -D ./cont/ --register=no /bin/sh -c /bin/sh -c "kill -ABRT \$\$" ``` Also, fixes CID #1368263 ``` ==352== 130 bytes in 1 blocks are definitely lost in loss record 1 of 2 ==352== at 0x4C2ED5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==352== by 0x4ED8581: greedy_realloc (alloc-util.c:57) ==352== by 0x4ECAAD5: get_process_cmdline (process-util.c:147) ==352== by 0x10E385: get_process_container_parent_cmdline (coredump.c:645) ==352== by 0x112949: process_kernel (coredump.c:1240) ==352== by 0x113003: main (coredump.c:1297) ==352== ```
2017-01-31Merge pull request #5168 from ddstreet/apply_format_helperZbigniew Jędrzejewski-Szmek
simplify udev_event_apply_format().
2017-01-31Merge pull request #5192 from keszybz/systemctl-ignore-sigtermZbigniew Jędrzejewski-Szmek
Fix for initrd-switch-root failing and causing emergency.target to be started.
2017-01-31util-lib: Fix chase_symlinks() with absolute symlinks (#5185)3chas3
If chase_symlinks() encouters an absolute symlink, it resets the todo buffer to just the newly discovered symlink and discards any of the remaining previous symlink path. Regardless of whether or not the symlink is absolute or relative, we need to preserve the remainder of the path that has not yet been resolved.
2017-01-31basic: check strdup result in khash_dup (#5176)Evgeny Vereshchagin
Fixes CID #1368249
2017-01-31Merge pull request #5175 from keszybz/hostname-fallbackMartin Pitt
Allow distributions to override the "localhost" fallback
2017-01-31systemctl: ignore SIGTERM after switch rootZbigniew Jędrzejewski-Szmek
https://bugzilla.redhat.com/show_bug.cgi?id=1414904#c14 and #c15.
2017-01-31systemctl: always avoid being killed when doing switch-rootZbigniew Jędrzejewski-Szmek
The same logic as described in acc28e2e3037d689d6481e applies to any time we are switching root, to just set the flag unconditionally.
2017-01-31pid1: rewrite check in ignore_proc() to not check condition twiceZbigniew Jędrzejewski-Szmek
It's harmless, but it seems nicer to evaluate a condition just a single time.
2017-01-31boot: fix two typosZbigniew Jędrzejewski-Szmek
2017-01-31logind: trivial simplificationZbigniew Jędrzejewski-Szmek
free_and_strdup() handles NULL arg, so make use of that.
2017-01-30journal-gatewayd: return -EINVAL if ARG_TRUST and HAVE_GNUTLS (#5181)Yi EungJun
This bug was introduced by 1aa1e59.
2017-01-29journal-gatewayd: actually recognize -D as a synonym for --directory (#5180)Ivan Shapovalov
2017-01-27build-sys,hostnamed: allow distributions to override the "localhost" fallbackZbigniew Jędrzejewski-Szmek
A configure param is added to make this easy to change if distributions want to differentiate on that. The default remains unchanged. https://bugzilla.redhat.com/show_bug.cgi?id=1392925#c10
2017-01-27udev-event: use in-place whitespace replacementDan Streetman
Instead of using a temp buffer to replace whitespace in variable substitutions, just allow util_replace_whitespace to replace in-place. Add a comment to util_replace_whitespace indicating it is used to replace in-place, to prevent accidental future breakage.
2017-01-27udev-event: refactor udev_event_apply_formatDan Streetman
Move the large case statement into its own function
2017-01-24resolve: fix strv memleakZbigniew Jędrzejewski-Szmek
sd_bus_message_read_strv() returns a normal strv...
2017-01-24core/execute: fix strv memleakZbigniew Jędrzejewski-Szmek
compile_read_write_paths() returns a normal strv from strv_copy(), and setup_namespace() uses it read-only, so we should use strv_free to deallocate.
2017-01-24core/dbus: fix two strv memleaksZbigniew Jędrzejewski-Szmek
job_dbus_path and unit_dbus_path both allocate new strings, so we should use strv_free.
2017-01-24core: fix memleak in bus_exec_context_set_transient_property (#5143)Evgeny Vereshchagin
Fixes: ```sh systemd-run --property EnvironmentFile=/some/environment/file /bin/sleep 30 ``` ``` 23 bytes in 1 blocks are definitely lost in loss record 1 of 7 at 0x4C2DB9D: malloc (vg_replace_malloc.c:299) by 0x4E85488: malloc_multiply (alloc-util.h:70) by 0x4E85F19: strjoin_real (string-util.c:252) by 0x1AF741: bus_exec_context_set_transient_property (dbus-execute.c:1418) by 0x1A907C: bus_service_set_property (dbus-service.c:330) by 0x1A66DD: bus_unit_set_properties (dbus-unit.c:1456) by 0x19CF93: transient_unit_from_message (dbus-manager.c:892) by 0x19D388: method_start_transient_unit (dbus-manager.c:980) by 0x4F60544: method_callbacks_run (bus-objects.c:418) by 0x4F62D9D: object_find_and_run (bus-objects.c:1255) by 0x4F633CE: bus_process_object (bus-objects.c:1371) by 0x4F2CE1D: process_message (sd-bus.c:2563) ``` Closes: #5142
2017-01-24tree-wide: remove consecutive duplicate words in comments (#5148)Stefan Schweter
2017-01-24virt: update url to hypervisor top-level functional specification (#5149)Stefan Schweter
2017-01-25networkd: Allow ':' in labelSusant Sahani
IFA_LABEL does not need much of a validation except the length that is IFNAMSIZ as seen from kernel code.
2017-01-24socket-utils: revert f1811313f42dc7ddaed3c47edc834c2bfd1309b2Susant Sahani
':' in not a a valid interface name.
2017-01-24core: don't load dropin data multiple times for the same unit (#5139)Franck Bui
When an alias is loaded, we resolve this alias to its final unit first to load the dropin data. However if the final unit was already loaded, there's no point in reloading the dropin data a second time. This patch optimizes this case. Also this allows the dropin loading code to assume that only units not yet loaded are passed down. This assumption is not yet used but might be in the future. [zj: invert the condition in the if]
2017-01-23network: accept colons in network interface names, normally used for alias ↵peoronoob
interfaces (#5117)