Commit graph

21720 commits

Author SHA1 Message Date
Lennart Poettering 9ca45586e6 dns-domain: add call for concatenating two domain names
This is specifically useful for appending the mDNS ".local" suffix to a
single-label hostname in the most correct way. (used in later commit)
2015-08-21 12:41:07 +02:00
Lennart Poettering 46a5e0e742 hostname-util: introduce new is_gateway_hostname() call
This moves is_gateway() from nss-myhostname into the basic APIs, and
makes it more like is_localhost(). Also, we rename it to
is_gateway_hostname() to make it more expressive.

Sharing this function in src/basic/ allows us to reuse the function for
routing name requests in resolved (in a later commit).
2015-08-21 12:07:13 +02:00
Lennart Poettering 0d43ffef5a update TODO 2015-08-20 12:20:14 +02:00
David Herrmann 2c04e5c7e5 Merge pull request #990 from owtaylor/issue-989
Issue 989 - logind: VT is not properly reset on session close
2015-08-19 16:40:54 +02:00
Daniel Mack 9a8e6b0214 Merge pull request #993 from xnox/timedate
timedatectl: assert timezone is not null in setenv() call.
2015-08-19 13:56:27 +02:00
Dimitri John Ledkov 8c4fa32acf timedatectl: assert timezone is not null in setenv() call.
setenv is declared as:

extern int setenv (const char *__name, const char *__value, int __replace)
     __THROW __nonnull ((2));

And i->timezone can be NULL, if for example /etc/localtime is
missing. Previously that worked, but now result in a libc dumping
core, as seen with gcc 2.22, due to:

https://sourceware.org/ml/glibc-cvs/2015-q2/msg00075.html
2015-08-19 10:04:00 +00:00
Lennart Poettering 4105232edc Merge pull request #988 from spartacus06/update-completion-machinectl-v2
Update completion machinectl (part 2)
2015-08-19 11:15:11 +02:00
Lennart Poettering 561a0efdcb Merge pull request #992 from zonque/journal-json
journal: fix json output of unicode characters
2015-08-19 11:12:14 +02:00
Owen W. Taylor 128df4cfe9 logind: get a fresh file descriptor to clean up a VT
When the controlling process exits, any existing file descriptors
for that FD will be marked as hung-up and ioctls on them will
file with EIO. To work around this, open a new file descriptor
for the VT we want to clean up.

Thanks to Ray Strode for help in sorting out the problem and
coming up with a fix!

https://github.com/systemd/systemd/issues/989
2015-08-18 15:26:11 -04:00
Owen W. Taylor 2235695335 logind: use open_terminal() instead of open()
The open_terminal() function adds retries in case a terminal
is in the process of being closed when we open it, and should
generally be used to open a terminal. We especially need it
for code that a subsequent commit adds that reopens the terminal
at session shut-down time; such races would be more likely in
that case.

Found by Ray Strode.
2015-08-18 15:25:57 -04:00
Seth Jennings 4acd40613f shell-completion: bash: make list-transfers and cancel-transfer STANDALONE
list-transfers and cancel-transfers don't take machine arguments.
2015-08-18 13:22:42 -05:00
Seth Jennings 2977883de2 shell-completion: bash: add image transfer subcommands 2015-08-18 13:20:12 -05:00
Daniel Mack 91a8a10809 journal: fix json output of unicode characters 2015-08-18 16:26:11 +02:00
Lennart Poettering 9a877fd409 Merge pull request #984 from whot/hwdb-updates
hwdb: fix capitalization of product version for the Macbooks
2015-08-18 10:17:17 +02:00
Lennart Poettering 73d4f46a77 Merge pull request #983 from phomes/journal_dead_check
journal: remove error check that never happens
2015-08-18 10:16:10 +02:00
Peter Hutterer adcf219921 hwdb: fix capitalization of product version for the Macbooks
We need uppercase hex here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-18 09:39:57 +10:00
Thomas Hindoe Paaboel Andersen b2b46f91db journal: remove error check that never happens
remove_directory will always return 0 so this can never happen.
Besides that, d->path and d are freed so we would end up with
a null pointer dereference anyway.
2015-08-18 00:11:16 +02:00
Daniel Mack d2b5f6bdbb Merge pull request #982 from evverx/add-systemd-cgls
man: add systemd-cgls as tool that shows the cgroup hierarchy
2015-08-17 22:38:30 +02:00
Evgeny Vereshchagin f4b8163b97 man: add systemd-cgls as tool that shows the cgroup hierarchy 2015-08-17 19:16:04 +00:00
Lennart Poettering f90c90b4a1 Merge pull request #977 from richardmaw-codethink/machinectl-userns-login-v2
Fix machinectl login with containers in user namespaces (v2)
2015-08-17 15:12:15 +02:00
Lennart Poettering aaa2a3abf9 Merge pull request #976 from elfring/Remove_unnecessary_checks2
Delete unnecessary checks before some function calls
2015-08-17 11:30:31 +02:00
Lennart Poettering 22175a39e8 Merge pull request #958 from stefwalter/fix-journalctl-f-regression
Regression: 'journalctl -f -t unmatched' doesn't block properly
2015-08-17 11:19:14 +02:00
Richard Maw 671c341958 namespace helpers: Allow entering a UID namespace
To be able to use `systemd-run` or `machinectl login` on a container
that is in a private user namespace, the sub-process must have entered
the user namespace before connecting to the container's D-Bus, otherwise
the UID and GID in the peer credentials are garbage.

So we extend namespace_open and namespace_enter to support UID namespaces,
and we enter the UID namespace in bus_container_connect_{socket,kernel}.

namespace_open will degrade to a no-op if user namespaces are not enabled
in the kernel.

Special handling is required for the setns call in namespace_enter with
a user namespace, since transitioning to your own namespace is forbidden,
as it would result in re-entering your user namespace as root.

Arguably it may be valid to check this at the call site, rather than
inside namespace_enter, but it is less code to do it inside, and if the
intention of calling namespace_enter is to *be* in the target namespace,
rather than to transition to the target namespace, it is a reasonable
approach.

The check for whether the user namespace is the same must happen before
entering namespaces, as we may not be able to access /proc during the
intermediate transition stage.

We can't instead attempt to enter the user namespace and then ignore
the failure from it being the same namespace, since the error code is
not distinct, and we can't compare namespaces while mid-transition.
2015-08-17 08:52:13 +00:00
Markus Elfring 3e044c492e Bug #944: Deletion of unnecessary checks before a few calls of systemd functions
The following functions return immediately if a null pointer was passed.
* calendar_spec_free
* link_address_free
* manager_free
* sd_bus_unref
* sd_journal_close
* udev_monitor_unref
* udev_unref

It is therefore not needed that a function caller repeats a corresponding check.

This issue was fixed by using the software Coccinelle 1.0.1.
2015-08-17 10:45:30 +02:00
Daniel Mack e503467fa0 Merge pull request #953 from poettering/ebadf
tree-wide: generate EBADF when we get invalid fds
2015-08-17 10:10:04 +02:00
Daniel Mack 4fe66a7155 Merge pull request #970 from poettering/timedatectl-set-netp
man: extend documentation for timedatectl's set-ntp command
2015-08-17 10:09:16 +02:00
Daniel Mack 2f258a317d Merge pull request #973 from poettering/sd-bus-error-ret
sd-bus: always fill in sd_bus_error paramters, on error
2015-08-17 10:07:27 +02:00
Daniel Mack e036a5f1d5 Merge pull request #974 from teg/resolved-fixes-2
resolved: debugging improvements
2015-08-17 10:04:31 +02:00
Stef Walter c51e1a9635 journalctl: make sure 'journalctl -f -t unmatched' blocks
Previously the following command:

$ journalctl -f -t unmatchedtag12345

... would block when called with criteria that did not match any
journal lines. Once log lines appeared that matched the criteria
they were displayed.

Commit 02ab86c732 broke this
behavior and the journal was not followed, but the command
exits with '-- No entries --' displayed.

This commit fixes the issue.

More information downstream:

https://bugzilla.redhat.com/show_bug.cgi?id=1253649
2015-08-17 09:51:51 +02:00
Markus Elfring dc4ebc0787 Bug #944: Deletion of unnecessary checks before calls of the function "free"
The function "free" is documented in the way that no action shall occur for
a passed null pointer. It is therefore not needed that a function caller
repeats a corresponding check.
http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first

This issue was fixed by using the software Coccinelle 1.0.1.
2015-08-17 09:30:49 +02:00
Markus Elfring f00ef7f5d4 Bug #944: Replacement of a free() call by mfree()
The function "mfree" should be called instead of "free" at a specific
source code place.
2015-08-17 09:10:56 +02:00
Tom Gundersen 6b34a6c995 resolved: cache - add more detailed cache debug logging 2015-08-17 07:18:30 +02:00
Lennart Poettering 759e02e79d sd-bus: always fill in sd_bus_error paramters, on error
Whenever one of our calls is invoked with a non-NULL, writable
sd_bus_error parameter, let's fill in some valid error on failure. We
previously only filled in remote errors, but never local errors, which is
hard to handle by users. Hence, let's clean this up to always fill in
the error.

This introduces a new bus_assert_return() macro that works like
assert_return() but optionally also initializes a bus_error struct.

Fixes #224.

Based on a patch by Umut Tezduyar.
2015-08-16 22:13:34 +02:00
Lennart Poettering 0d4605ec3c update TODO 2015-08-16 21:59:58 +02:00
Lennart Poettering 0038aed166 Merge pull request #908 from richardmaw-codethink/nspawn-path-escapes-v3
Allow arbitrary file paths to be passed to nspawn (v3)
2015-08-16 21:32:03 +02:00
Lennart Poettering d1584b9f5b README: drop reference to Endocode
Chris Kühl does not work at Endocode anymore, the contact data is no
longer valid.
2015-08-16 21:06:42 +02:00
Tom Gundersen 17018c3cc7 TODO 2015-08-16 20:52:30 +02:00
Tom Gundersen 7499840853 resolve-host: print RTT 2015-08-16 20:52:21 +02:00
Tom Gundersen 6b9308d14b resolved: packet - fix typo in read_rr() 2015-08-16 20:52:21 +02:00
Tom Gundersen 0125ed22e3 Merge pull request #955 from poettering/resolved-localhost-xyz
resolved: enable synthesizing of A, AAAA and PTR records for "localhost"
2015-08-16 20:46:11 +02:00
Tom Gundersen 3aeae87664 Merge pull request #954 from poettering/nss-myhostname-loopback
nss-myhostname: use LOOPBACK_IFINDEX instead of if_nametoindex("lo")
2015-08-16 20:38:32 +02:00
Tom Gundersen 53576a7010 Merge pull request #972 from poettering/resolve-host-auto-start
resolve-host: enable auto start of resolved
2015-08-16 20:37:52 +02:00
Lennart Poettering 50d25fb08b resolve-host: enable auto start of resolved
There's no reason to explicitly turn off bus activation for resolved
here. The reason this was done before was that the code was copied from
nss-resolve, which has a fallback to glibc's nss-dns if resolved is not
reachable. However, such a logic makes no sense for resolve-host since
such a fallback doesn't make sense here, which means we can actually
turn on activation. Let's do it hence.
2015-08-16 20:29:23 +02:00
Lennart Poettering 7d19344a99 Merge pull request #971 from evverx/news-fix
NEWS: fix the "indirect" state description
2015-08-16 20:24:25 +02:00
Evgeny Vereshchagin c7683ffb53 NEWS: fix the "indirect" state description 2015-08-16 18:10:23 +00:00
Lennart Poettering 7b0991c617 Merge pull request #931 from spartacus06/update-completion-machinectl
Update shell completion for machinectl
2015-08-16 19:58:49 +02:00
Lennart Poettering 8731be1a52 man: extend documentation for timedatectl's set-ntp command
This extends on the relationship between timedatectl's set-ntp command
and its effect on the systemd-timesyncd.service unit. This also links
that unit back to the timedatectl man page.

Closes #798.
2015-08-16 18:29:54 +02:00
Lennart Poettering e6a26d8c97 update TODO 2015-08-16 18:25:34 +02:00
Seth Jennings 4f8f4c310c shell-completion: use list-images rather than list
"machinectl list" only lists running machines while many of the MACHINES
commands use names of images; both running and non-running.

List machines from both "list" and "list-images" and use sort -u to
avoid duplicates.
2015-08-16 11:20:21 -05:00
Seth Jennings 6eb8bec62d shell-completion: update machinectl bash completion
Many new subcommands have been added since the bash completion was last
updated.  Bring it up to speed.
2015-08-16 11:19:36 -05:00