Commit graph

9392 commits

Author SHA1 Message Date
Lennart Poettering f7fce3454c sd-bus: rename sd_bus_get_server_id() to sd_bus_get_owner_id()
In kdbus a "server id" is mostly a misnomer, as there isn't any "server"
involved anymore. Let's rename this to "owner" id hence, since it is an
ID that is picked by the owner of a bus or direct connection. This
matches nicely the sd_bus_get_owner_creds() call we already have.
2014-11-04 18:09:19 +01:00
Lennart Poettering f4b2933ee7 sd-bus,sd-event: unify error handling of object descriptions
a) When getting the description return ENXIO if none is set

b) Allow setting a description to NULL

c) return ECHILD on fork() like for other calls
2014-11-04 18:09:19 +01:00
Lennart Poettering d1b91c99d9 sd-bus: make use of free_and_strdup() where it makes sense 2014-11-04 18:09:19 +01:00
Lennart Poettering 9cbfc66c62 sd-bus: also allow setting descriptions on bus slots 2014-11-04 18:09:19 +01:00
Lennart Poettering f1f00dbb7f sd-event: implicitly set signal event source's descriptions to the signal name 2014-11-04 18:09:19 +01:00
Lennart Poettering 356779df90 sd-event: rename sd_event_source_set_name() to sd_event_source_get_name()
To mirror the recent name change of the concept for sd_bus objects,
follow the same logic for sd_event_source objects, too.
2014-11-04 18:09:19 +01:00
Michal Schmidt e80afdb3e4 test: use assert_se in test_hashmap_move 2014-11-04 17:05:01 +01:00
Lennart Poettering 455971c149 sd-bus: rename "connection name" to "description" for the sd-bus API too
kdbus recently renamed this concept, and so should we in what we expose
in userspace.
2014-11-04 16:13:49 +01:00
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 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 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
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 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
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
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 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
Tom Gundersen 4903a73c37 dhcp6: use unaligned read/write helpers 2014-11-01 15:36:29 +01:00
Tom Gundersen 725ca0e53a resolved: dns-packet - use unaligned read/write helpers 2014-11-01 15:36:29 +01:00
Tom Gundersen f089257d7b shared: add helpers for unaligend BE read/write 2014-11-01 15:36:29 +01:00