Commit graph

17879 commits

Author SHA1 Message Date
Daniel Mack 635f9f0d95 sd-bus: sync kdbus.h (ABI break)
Catch up with some changes in kdbus.h:

  * KDBUS_{ITEM,ATTACH}_CONN_NAME were renamed to
    KDBUS_{ITEM,ATTACH}_CONN_DESCRIPTION, so the term 'name' is not
    overloaded as much.

  * The item types were re-ordered a little so they are lined up to the
    order of the corresponding KDBUS_ATTACH flags

  * A new item type KDBUS_ITEM_OWNED_NAME was introduced, designated to
    store a struct kdbus_name in item->name. KDBUS_ITEM_NAME soley
    stores data in item->str now

  * Some kerneldoc fixes
2014-11-04 12:44:53 +01:00
David Herrmann dfb05a1cf5 barrier: explicitly ignore return values of barrier_place()
The barrier implementation tracks remote states internally. There is no
need to check the return value of any barrier_*() function if the caller
is not interested in the result. The barrier helpers only return the state
of the remote side, which is usually not interesting as later calls to
barrier_sync() will catch this, anyway.

Shut up coverity by explicitly ignoring return values of barrier_place()
if we're not interested in it.
2014-11-04 09:49:43 +01:00
David Herrmann 44dd2c6e86 util: introduce negative_errno()
Imagine a constructor like this:

        int object_new(void **out) {
                void *my_object;
                int r;

                ...
                r = ioctl(...);
                if (r < 0)
                        return -errno;
                ...

                *out = my_object;
                return 0;
        }

We have a lot of those in systemd. If you now call those, gcc might inline
the call and optimize it. However, gcc cannot know that "errno" is
negative if "r" is. Therefore, a caller like this will produce warnings:

        r = object_new(&obj);
        if (r < 0)
                return r;

        obj->xyz = "foobar";

In case the ioctl in the constructor fails, gcc might assume "errno" is 0
and thus the error-handling is not triggered. Therefore, "obj" is
uninitialized, but accessed. Gcc will warn about that.

The new negative_errno() helper can be used to mitigate those warnings.
The helper is guaranteed to return a negative integer. Furthermore, it
spills out runtime warnings if "errno" is non-negative.

Instead of returning "-errno", you can use:
        return negative_errno();

gcc will no longer assume that this can return >=0, thus, it will not warn
about it.

Use this new helper in libsystemd-terminal to fix some grdev-drm warnings.
2014-11-04 08:27:31 +01:00
Vicente Olivert Riera e6c019026b Properly define the __NR_memfd_create macro for MIPS
This macro exists for MIPS since v3.17:
  https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=42944521af97a3b25516f15f3149aec3779656dc
2014-11-04 08:27:31 +01:00
Jan Synacek 31cf921abb localectl: fix localectl set-x11-keymap syntax description
This complements the fix in:

    commit cd4c6fb125
    Author: Jan Synacek <jsynacek@redhat.com>
    Date:   Mon Oct 20 12:43:39 2014 +0200

        man: fix localectl set-x11-keymap syntax description
2014-11-04 08:27:30 +01:00
Lennart Poettering 25b3245fb4 journald: include audit message type number in MESSAGE= string 2014-11-04 01:00:50 +01:00
Lennart Poettering 9833a66c7e journal: also consider audit fields with '-' valid 2014-11-04 00:51:19 +01:00
Lennart Poettering 0aa281df2c audit: improve the audit messages we generate
always pass along comm, as documented by audit. Always set the correct
comm value.
2014-11-04 00:48:09 +01:00
Lennart Poettering 0b97208d8c journald: don't pass around SO_TIMESTAMP timestamp for audit, which we don't have anyway 2014-11-04 00:32:02 +01:00
Lennart Poettering 1248e84008 journal: when dumping log data with missing COMM fields, show "unknown" instead
A small readability improvement...
2014-11-04 00:28:33 +01:00
Lennart Poettering 5034c7bcdf journald: suppress low-level audit text prefix in MESSAGE= field
Let's make the log output more readable, and the header can be
reconstructed in full from the other fields
2014-11-04 00:28:00 +01:00
Lennart Poettering 78fe420ff0 journald: properly decode audit's proctitle= field 2014-11-04 00:27:26 +01:00
Lennart Poettering 4d9ced9956 journald: enable audit in the kernel when initializing
Similar to auditd actually turn on auditing as we are starting. This way
we can operate entirely without auditd around.
2014-11-04 00:01:32 +01:00
Lennart Poettering 2b0073e1d2 journald: there's no point in turning on SO_TIMESTAMP for audit sockets, audit doesn't support timestamps anyway 2014-11-03 23:28:12 +01:00
Lennart Poettering 29a6c2d020 update TODO 2014-11-03 23:10:47 +01:00
Lennart Poettering 26d8ff0491 journald: fix memory leak on error path 2014-11-03 23:10:34 +01:00
Lennart Poettering 332076b45b journald: also check journal file size to deduce if it is empty 2014-11-03 23:10:21 +01:00
Lennart Poettering dbd2a83fbf journalctl: add new --vacuum-size= and --vacuum-time= commands to clean up journal files based on a size/time limit
This is equivalent to the effect of SystemMaxUse= and RetentionSec=,
however can be invoked directly instead of implicitly.
2014-11-03 23:08:33 +01:00
Lennart Poettering a6e841b454 man: document audit input for journald 2014-11-03 22:02:23 +01:00
Lennart Poettering d5d78543a2 units: make ReceiveBuffer= line more readable by using M suffix 2014-11-03 21:51:28 +01:00
Lennart Poettering 99d0966e75 journald: fix minor memory leak 2014-11-03 21:51:28 +01:00
Lennart Poettering cfb1f5df7c core: introduce ConditionSecurity=audit
And conditionalize journald audit support with it
2014-11-03 21:51:28 +01:00
Lennart Poettering 875c2e220e journald: if available pull audit messages from the kernel into journal logs 2014-11-03 21:51:28 +01:00
Lennart Poettering 8457f8d6ac journald: remove a number of malloc()s from the syslog message handling 2014-11-03 21:51:28 +01:00
Lennart Poettering 3b3154df7e journald: constify all things! 2014-11-03 21:51:28 +01:00
Tom Gundersen f49481d0ca man: sd_event_add_post - fix typo 2014-11-03 15:58:30 +01:00
Tom Gundersen aa9c4134ed man: glib-event-glue.c - remove unnecessary includes
This is just an example, so no error-handling is done here anyway.
2014-11-03 14:46:28 +01:00
Lukas Nykryn e8f826f660 sd-pppoe: include ppp_defs.h
On older kernels before this patch:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e8b671460410c8fd996c8a1c228b718c547cc236
ppp-ioctl.h did not pull in ppp_defs.h which results in build errors
2014-11-03 12:38:11 +01:00
Zbigniew Jędrzejewski-Szmek 1f1926aa5e units: order sd-journal-flush after sd-remount-fs
Otherwise we could attempt to flush the journal while /var/log/ was
still ro, and silently skip journal flushing.

The way that errors in flushing are handled should still be changed to
be more transparent and robust.
2014-11-02 21:52:56 -05:00
Zbigniew Jędrzejewski-Szmek 3b02170360 unit: do not order timers.target before basic.target
Since commit 19f8d03783 'timer: order OnCalendar units after
timer-sync.target if DefaultDependencies=no' timers might get a
dependency on time-sync.target, which does not really belong in early
boot. If ntp is enabled, time-sync.target might be delayed until a
network connection is established.

It turns out that majority of timer units found in the wild do not
need to be started in early boot. Out of the timer units available in
Fedora 21, only systemd-readahead-done.timer and mdadm-last-resort@.timer
should be started early, but they both have DefaultDependencies=no,
so are not part of timers.target anyway. All the rest look like they
will be fine with being started a bit later (and the majority even
much later, since they run daily or weekly).

Let timers.target be pulled in by basic.target, but without the
temporal dependency. This means timer units are started on a "best
effort" schedule.

https://bugzilla.redhat.com/show_bug.cgi?id=1158206
2014-11-02 12:33:54 -05:00
Zbigniew Jędrzejewski-Szmek 56dacdbc1c manager: do not print timing when running in test mode 2014-11-02 12:33:54 -05:00
Zbigniew Jędrzejewski-Szmek 14fe721b5f Raise level of 'Found dependency...' lines
This way they always show up together with 'Found ordering cycle...'.
Ordering cycles are a serious error and a major pain to debug. If
quiet is enabled, only the first and the last line of output are
shown:

systemd[1]: Found ordering cycle on basic.target/start
systemd[1]: Breaking ordering cycle by deleting job timers.target/start
systemd[1]: Job timers.target/start deleted to break ordering cycle starting with basic.target/start

which isn't particularly enlightening. So just show the whole message
at the same level.

https://bugzilla.redhat.com/show_bug.cgi?id=1158206
2014-11-02 12:33:54 -05:00
Tom Gundersen 8cd80c94a5 sd-pppoe: fix some leaks 2014-11-01 23:53:25 +01:00
Tom Gundersen cda391c3f9 libsystemd-networkd: introduce sd-pppoe library
This library negotiates a PPPoE channel. It handles the discovery stage and
leaves the session stage to the kernel. A further PPP library is needed to
actually set up a PPP unit (negotatie LCP, IPCP and do authentication), so in
isolation this is not yet very useful.

The test program has two modes:

  # ./test-pppoe

will create a veth tunnel in a new network namespace, start pppoe-server on one
end and this client library on the other. The pppd server will time out as no
LCP is performed, and the client will then shut down gracefully.

  # ./test-pppoe eth0

will run the client on eth0 (or any other netdev), and requires a PPPoE server
to be reachable on the local link.
2014-11-01 22:31:40 +01:00
Colin Walters ea55caa60c libudev: Use correct free function
FILE * wants cleanup_fclose().

Spotted by udev hwdb segfaulting in gnome-continuous' buildroot
construction.
2014-11-01 16:04:25 -04:00
Joe Lawrence 85f13fce32 scsi_id: fix usage spelling
s/threat/treat/g
2014-11-01 15:52:55 -04:00
Zbigniew Jędrzejewski-Szmek b43434e94e TODO 2014-11-01 15:37:16 -04:00
Michael Chapman c008f6ee8d kernel-install/90-loaderentry.install: fix cmdline parsing
A recent commit (2f3a215) changed the parsing of /proc/cmdline to use a
shell array. Unfortunately, this introduced a bug: "read -ar line"
populates the shell variable $r, not $line. This breaks installation of
new loader entries:

  # kernel-install add 3.17.1-304.fc21.x86_64 \
      /boot/vmlinuz-3.17.1-304.fc21.x86_64
  Could not determine the kernel command line parameters.
  Please specify the kernel command line in /etc/kernel/cmdline!

This commit alters the read command to correctly populate the $line
array instead.
2014-11-01 14:39:48 -04:00
Zbigniew Jędrzejewski-Szmek a65b824577 systemd-journal-flush.service: remove "trigger" from description
This service is now synchronous, so "trigger" is misleading.
2014-11-01 14:39:48 -04:00
Umut Tezduyar Lindskog 2a97b03b3b man: explain journalctl --flush correctly 2014-11-01 14:39:48 -04:00
WaLyong Cho 311f6cf33f bus: use STR_IN_SET 2014-11-01 14:39:47 -04:00
Jan Synacek 86fb9ca7ae core: improve error message when machine id is missing 2014-11-01 14:39:47 -04:00
Dan Williams 393b6f28ec sd-dhcp6-client: fix off-by-two error in DUID length
The duid data passed by the caller does not include the DUID type,
but sd_dhcp6_client_set_duid() was treating it like it did.
2014-11-01 14:39:47 -04:00
Daniele Medri 489464d0a2 calendarspec: add constant for weekdays_bits 2014-11-01 14:39:47 -04:00
Zbigniew Jędrzejewski-Szmek e03234a160 man: describe all log levels in udevadm(8)
https://bugs.freedesktop.org/show_bug.cgi?id=85657
2014-11-01 14:39:47 -04:00
Zbigniew Jędrzejewski-Szmek f47ad59316 Use log "level" instead of "priority"
The term "priority" is misleading because higher levels have lower
priority. "Level" is clearer and shorter.

This commit touches only the textual descriptions, not function and variable
names themselves. "Priority" is used in various command-line switches and
protocol constants, so completly getting rid of "priority" is hard.

I also left "priority" in various places where the clarity suffered
when it was removed.
2014-11-01 14:39:47 -04:00
Zbigniew Jędrzejewski-Szmek ee7122c0ec libudev: do not accept invalid log levels
Invalid log levels lead to a assert failure later on.

https://bugs.freedesktop.org/show_bug.cgi?id=85657
2014-11-01 14:39:47 -04:00
Zbigniew Jędrzejewski-Szmek fe756ed9ec libudev: modernization
This brings udev logging style a bit closer to normal systemd convention.
2014-11-01 14:39:47 -04:00
Tom Gundersen 1caa12d0a8 sd-dhcp-lease: use shared default prefixlen function
Also change the default prefixlen function to only access the first octet of the in_addr.
2014-11-01 19:02:44 +01:00
Tom Gundersen bab4792961 sd-dhcp-lease: use unaligned read helpers 2014-11-01 18:59:55 +01:00