Commit Graph

24631 Commits

Author SHA1 Message Date
Evgeny Vereshchagin 5c7290b195 tests: add test-selinux-checks 2016-01-31 09:02:51 +00:00
Lennart Poettering dcabda4155 Merge pull request #2469 from keszybz/resolved-2
Resolved 2
2016-01-30 15:04:56 +01:00
Zbigniew Jędrzejewski-Szmek 132bdb0cf8 Merge pull request #2478 from grawity/fix/touch-mode
basic: fix touch() creating files with 07777 mode
2016-01-29 21:19:21 -05:00
Mantas Mikulėnas 06eeacb6fe basic: fix touch() creating files with 07777 mode
mode_t is unsigned, so MODE_INVALID < 0 can never be true.

This fixes a possible DoS where any user could fill /run by writing to
a world-writable /run/systemd/show-status.
2016-01-29 23:41:09 +02:00
Zbigniew Jędrzejewski-Szmek c542f805dd man: reword sentence 2016-01-29 12:24:15 -05:00
Zbigniew Jędrzejewski-Szmek e3309036cd resolved: log server type when switching servers
I'm not defining _DNS_SERVER_TYPE_MAX/INVALID as usual in the enum,
because it wouldn't be used, and then gcc would complain that
various enums don't test for _DNS_SERVER_TYPE_MAX. It seems better
to define the macro rather than add assert_not_reached() in multiple
places.
2016-01-29 12:24:15 -05:00
Zbigniew Jędrzejewski-Szmek a43a068a30 resolved: add macro to compare sized fields
For consistency, generic.size is renamed to generic.data_size.

nsec3.next_hashed_name comparison was missing a size check.
2016-01-29 12:24:14 -05:00
Zbigniew Jędrzejewski-Szmek ba82da3bb5 resolve-host: add option to list protocols 2016-01-29 12:13:08 -05:00
Zbigniew Jędrzejewski-Szmek 869b3b67e3 resolve-host: allow specifying type as TYPEnn
This mirrors the behaviour of host and makes the conversion to and from
string symmetrical.
2016-01-29 12:13:08 -05:00
Zbigniew Jędrzejewski-Szmek f3367a64ca test-tables: ellide boring parts of sparse mappings 2016-01-29 12:13:08 -05:00
Zbigniew Jędrzejewski-Szmek c7472ce088 test-resolve-tables: new "test", useful to print mappings 2016-01-29 12:13:08 -05:00
Zbigniew Jędrzejewski-Szmek fc8eec10f6 resolved: calculate and print tags for DNSKEY records 2016-01-29 12:13:06 -05:00
Martin Pitt 7d82cd4d53 Merge pull request #2474 from poettering/doc-fix-2189
man: document special considerations when mixing templated service un…
2016-01-29 16:53:13 +01:00
Lennart Poettering ae0a5fb1e1 man: document special considerations when mixing templated service units and DefaultDependencies=no
Fixes #2189.
2016-01-29 16:50:50 +01:00
Daniel Mack 0e3a930a60 Merge pull request #2465 from poettering/systemctl-chroot
Fix for #2015
2016-01-29 16:04:03 +01:00
Daniel Mack e0d2df39b1 Merge pull request #2472 from poettering/mini-fixes
Two mini fixes
2016-01-29 15:51:16 +01:00
Lennart Poettering d152dd467a systemctl: actually honour the try-reload-or-restart verb aabf5d4243 promised
The verb entry got lost in the ultimate commit.
2016-01-29 15:49:05 +01:00
Lennart Poettering 1e726cc963 systemctl: make most systemctl commands NOPs in a chroot() environment
Fixes #2015
2016-01-29 15:49:05 +01:00
Lennart Poettering 040524b4a3 systemctl: consider a chroot() environment always offline 2016-01-29 15:16:56 +01:00
Lennart Poettering a16f96cd56 basic: when parsing verb command lines, optionally shortcut them in chroot() environments
This adds some basic infrastructure in order to fix #2015.
2016-01-29 15:16:56 +01:00
Lennart Poettering 6c033c3496 man: document which section the configuration settings of timesyncd.conf belong into 2016-01-29 14:53:05 +01:00
Lennart Poettering dbc7bede4a man: actually say which section resolv.conf's setting should be placed in 2016-01-29 14:53:01 +01:00
Lennart Poettering 6c38b6c04e build-sys: install systemd-resolve in /usr/bin
The command has a man page now and is public, hence add it to /usr/bin.
2016-01-29 14:45:41 +01:00
Zbigniew Jędrzejewski-Szmek a5a5f03382 Merge pull request #2466 from poettering/nspawn-journal
Two small nspawn fixes
2016-01-28 19:32:48 -05:00
Zbigniew Jędrzejewski-Szmek 2bc968b748 Merge pull request #2464 from poettering/reload-or-try-restart
Fix for #688
2016-01-28 19:11:30 -05:00
Zbigniew Jędrzejewski-Szmek 99e5ca6d8b resolved: expand flags field in DNSKEY records 2016-01-28 18:35:02 -05:00
Zbigniew Jędrzejewski-Szmek cfb90da3dc resolved: convert TLSA fields to string
Example output:
_443._tcp.fedoraproject.org IN TLSA  0 0 1 GUAL5bejH7czkXcAeJ0vCiRxwMnVBsDlBMBsFtfLF8A=
                                     -- Cert. usage: CA constraint
                                     -- Selector: Full Certificate
                                     -- Matching type: SHA-256
2016-01-28 18:35:02 -05:00
Zbigniew Jędrzejewski-Szmek d93a16b81f resolved: OPENPGPKEY records 2016-01-28 18:35:02 -05:00
Zbigniew Jędrzejewski-Szmek 48d45d2b49 resolved: TLSA records 2016-01-28 18:35:01 -05:00
Zbigniew Jędrzejewski-Szmek d7671a3efd resolved: add alignment to base64
We try to fit the lengthy key data into available space. If the other
fields take less than half of the available columns, we use align everything
in the remaining columns. Otherwise, we put everything after a newline,
indented with 8 spaces.

This is similar to dig and other tools do.

$ COLUMNS=78 ./systemd-resolve -t any .
. IN SOA   a.root-servers.net nstld.verisign-grs.com 2016012701 1800 900 604800 86400
. IN RRSIG SOA RSASHA256 0 86400 20160206170000 20160127160000 54549
        S1uhUoBAReAFi5wH/KczVDgwLb+B9Zp57dSYj9aX4XxBhKuzccIducpg0wWXhjCRAWuzY
        fQ/J2anm4+C4BLUTdlytPIemd42SUffQk2WGuuukI8e67nkrNF3WFtoeXQ4OchsyO24t2
        rxi682Zo9ViqmXZ+MSsjWKt1jdem4noaY=
. IN NS    h.root-servers.net
. IN NS    k.root-servers.net
. IN NS    e.root-servers.net
. IN NS    c.root-servers.net
. IN NS    b.root-servers.net
. IN NS    g.root-servers.net
. IN NS    d.root-servers.net
. IN NS    f.root-servers.net
. IN NS    i.root-servers.net
. IN NS    j.root-servers.net
. IN NS    m.root-servers.net
. IN NS    a.root-servers.net
. IN NS    l.root-servers.net
. IN RRSIG NS RSASHA256 0 518400 20160206170000 20160127160000 54549
        rxhmTVKUgs72G3VzL+1JRuD0nGLIrPM+ISfmUx0eYUH5wZD5XMu2X+8PfkAsEQT1dziPs
        ac+zK1YZPbNgr3yGI5H/wEbK8S7DmlvO+/I9WKTLp/Zxn3yncvnTOdjFMZxkAqHbjVOm+
        BFz7RjQuvCQlEJX4PQBFphgEnkiOnmMdI=
. IN NSEC  aaa ( NS SOA RRSIG NSEC DNSKEY )
. IN RRSIG NSEC RSASHA256 0 86400 20160206170000 20160127160000 54549
        HY49/nGkUJJP1zLmH33MIKnkNH33jQ7bsAHE9itEjvC4wfAzgq8+Oh9fjYav1R1GDeJ2Z
        HOu3Z2uDRif10R8RsmZbxyZXJs7eHui9KcAMot1U4uKCCooC/5GImf+oUDbvaraUCMQRU
        D3mUzoa0BGWfxgZEDqZ55raVFT/olEgG8=
. IN DNSKEY 257 3 RSASHA256 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0
                            O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0
                            NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL4
                            96M/QZxkjf5/Efucp2gaDX6RS6CXpoY68LsvPVjR0ZSwzz1ap
                            AzvN9dlzEheX7ICJBBtuA6G3LQpzW5hOA2hzCTMjJPJ8LbqF6
                            dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relSQageu+ipAdTTJ2
                            5AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1
                            ihz0=
. IN DNSKEY 256 3 RSASHA256 AwEAAbr/RV0stAWYbmKOldjShp4AOQGOyY3ATI1NUpP4X1qBs
                            6lsXpc+1ABgv6zkg02IktjZrHnmD0HsElu3wqXMrT5KL1W7Sp
                            mg0Pou9WZ8QttdTKXwrVXrASsaGI2z/pLBSnK8EdzqUrTVxY4
                            TEGZtxV519isM06CCMihxTn5cfFBF
. IN RRSIG DNSKEY RSASHA256 0 172800 20160204235959 20160121000000 19036
        XYewrVdYKRDfZptAATwT+W4zng04riExV36+z04kok09W0RmOtDlQrlrwHLlD2iN/zYpg
        EqGgDF5T2xlrQdNpn+PFHhypHM7NQAgLTrwmiw6mGbV0bsZN3rhFxHwW7QVUFAvo9eNVu
        INrjm+sArwxq3DnPkmA+3K4ikKD2iiT/jT91VYr9SHFqXXURccLjI+nmaE7m31hXcirX/
        r5i3J+B4Fx4415IavSD72r7cmruocnCVjcp+ZAUKeMyW+RwigzevLz3oEcCZ4nrTpGLEj
        wFaVePYoP+rfdmfLfTdmkkm4APRJa2My3XOdGFlgNS1pW1pH4az5LapLE2vMO7p1aQ==

-- Information acquired via protocol DNS in 14.4ms.
-- Data is authenticated: no
2016-01-28 18:35:01 -05:00
Zbigniew Jędrzejewski-Szmek 27d3b124c7 man: force space in cmdsynopsis
Docbook renders the man page as "[OPTIONS]--type" without it.
2016-01-28 18:35:01 -05:00
Zbigniew Jędrzejewski-Szmek 77abf3c115 resolved: emit full path to file we failed to write
Otherwise it's unclear if it's /etc/resolv.conf or some
other file that is meant.
2016-01-28 18:34:38 -05:00
Lennart Poettering ba8e6c4d0e nspawn: make sure --link-journal=host may be used twice in a row
Fixes #2186

This fixes fall-out from 574edc9006.
2016-01-28 20:24:28 +01:00
Lennart Poettering 8054d749c4 nspawn: make journal linking non-fatal in try and auto modes
Fixes #2091
2016-01-28 20:16:44 +01:00
Lennart Poettering aabf5d4243 systemctl: rename "reload-or-try-restart" verb to "try-reload-or-restart"
But also keep the old name as (undocumented) compatibility around.

The reload-or-try-restart was documented to be a NOP if the unit is not running, since the previous commits this is
also implemented. The old name suggests that the "try" logic only applies to restarting. Fix this, by moving the "try-"
to the front, to indicate that the whole option is a NOP if the service isn't running.
2016-01-28 18:57:04 +01:00
Lennart Poettering 42f729c15e systemctl: improve message when a job fails with a JOB_INVALID state
This result can only happen if the job was a reload job for an inactive unit. Make the error message actually say that.
2016-01-28 18:53:34 +01:00
Lennart Poettering 75a77a6ba4 core: when propagating reload jobs, downgrade them to try-reload
Otherwise we might end up generating jobs that fail immediately.

This follows the same logic that restart propagation follows.
2016-01-28 18:51:42 +01:00
Lennart Poettering f0469b8c4a core: when determining system state, don't bother with JOB_TRY_RESTART
When we determine the current system state we check whether units like emergency.target are running or a job that
results in them being run is queued. However, this is not the case for JOB_TRY_RESTART, since that's a NOP if the unit
has not been running before. Hence, don't bother with checking for that job type.
2016-01-28 18:49:59 +01:00
Lennart Poettering 3282591dc3 core: make sure "systemctl reload-or-try-restart is actually a noop if a unit is not running
This makes sure we follow the same basic logic for try-restart if we have a try-reload.

Fixes #688
2016-01-28 18:48:42 +01:00
Lennart Poettering 2fcee0a59a man: stop documenting legacy RedHatisms
We generally document only the supported verbs, but not the compatibility verbs we also support, in order to keep the
documentation minimal.
2016-01-28 18:46:24 +01:00
Daniel Mack 9e83569d8f Merge pull request #2463 from poettering/machined-tty-fix
Fixes for the service TTY reset logic and other stuff
2016-01-28 17:37:06 +01:00
Lennart Poettering ad6b1fa287 basic: getauxval(AT_RANDOM) is apparently not necessarily aligned
Let's make sure we read it in a way compatible with non-aligned memory.

Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812928
2016-01-28 17:00:38 +01:00
Lennart Poettering b430f85f22 systemctl: don't make up unit states, and don't eat up errors to eagerly
When checking a unit's state, don't ignore errors too eagerly, but generate proper error messages. Also, don't
synthesize an "unknown" state on error, but let the operation file. If a unit file isn't loaded treat this as
"inactive" as that's effectively what it means.
2016-01-28 16:53:06 +01:00
Lennart Poettering 6233b9023b systemctl: don't mangle unit names in check_unit_generic()
As it turns out all callers of check_unit_generic() already mangle unit names, or get the unit names directly from PID
1 (and hence arein normalized form anyway), hence there's no point in mangling then...
2016-01-28 16:34:21 +01:00
Lennart Poettering d813d7a372 shared: meanor clean-ups for logs-show.c
Some minor simplifications. Shouldn't change codepaths.
2016-01-28 16:28:01 +01:00
Lennart Poettering 1e22b5cda0 core: don't reset /dev/console if stdin/stdout/stderr as passed as fd in a transient service
Otherwise we might end resetting /dev/console all the time when a transient service starts or stops.

Fixes #2377
Fixes #2198
Fixes #2061
2016-01-28 16:25:39 +01:00
Jan Engelhardt cd72d2044a doc: improved wording in some places
Avoid "mountpoint mounted" (word repetition),
"queriable" (no match in m-w.com and dict.cc).
2016-01-28 11:13:17 +01:00
Jan Engelhardt ace483c471 man: try to repair some nonsensical paragraph 2016-01-28 11:12:29 +01:00
Jan Engelhardt 055a100d2e man: top-align cell text for large tables 2016-01-28 11:12:29 +01:00
Jan Engelhardt 9c5baa43ae man: avoid double virtualization
"VM virtualization" <=> "virtual machine virtualization", and double
virtualization is just incorrect in this context.
2016-01-28 11:12:29 +01:00