Commit graph

14805 commits

Author SHA1 Message Date
Lennart Poettering a2b135e3d8 update TODO 2014-03-25 02:11:52 +01:00
Lennart Poettering 67608cad23 util: consider both fuse.glusterfs and glusterfs network file systems
Based on a similar patch by Lukáš Nykrýn.
2014-03-25 01:46:24 +01:00
Lennart Poettering 981e4cd325 ask-password: modernizations 2014-03-25 01:30:19 +01:00
Lennart Poettering 036eeac5a1 ask-password: when the user types a overly long password, beep and refuse
Based on a similar patch from David Härdeman.
2014-03-25 01:27:45 +01:00
Lennart Poettering af7424af70 systemctl: add more verbose explanation of --kill-who and what control/main processes are 2014-03-25 00:51:22 +01:00
Lennart Poettering 0088d63151 systemctl: --kill-mode is long long gone, don't mention it in the man page 2014-03-25 00:31:48 +01:00
Lennart Poettering 905826156d man: be more specific when EnvironmentFile= is read
http://lists.freedesktop.org/archives/systemd-devel/2014-March/018004.html
2014-03-25 00:26:09 +01:00
Lennart Poettering d2753d2200 man: explain that the journal field SYSLOG_IDENTIFIER is usually derived from program_invocation_short_name 2014-03-25 00:10:41 +01:00
Lennart Poettering b107b705cc update TODO 2014-03-25 00:03:23 +01:00
Lennart Poettering 7514578081 sd-event: don't accidentally turn of watchdog timer event if we determine 0 2014-03-25 00:01:51 +01:00
Lennart Poettering 52444dc478 sd-event: initialization perturbation value right before we use it
That way, we don't forget to initialize it when the watchdog is
initialized before all event sources.
2014-03-24 23:54:21 +01:00
Lennart Poettering 56dc9aec21 sd-daemon: fix incorrect variable access 2014-03-24 23:54:14 +01:00
Lennart Poettering ac1a87b9f2 cryptsetup: minor typo fix 2014-03-24 23:46:13 +01:00
Lennart Poettering 79e16ce3bf networkd: fix a couple of memory leaks 2014-03-24 23:46:13 +01:00
Tom Gundersen c3ebdce39a networkd: netdev - fix error handling in set_ifindex()
Firstly, remove stray assert(). Also be a bit stricter when verifying the
received info. If we get an applicable newlink message that we can't make
sense of, we will now enter NETDEV_FAILED, as we cannot reasonably continue
without knowing the ifindex of our device.
2014-03-24 22:09:06 +01:00
Lennart Poettering c4bfd1691f core: don't try to relabel mounts before we loaded the policy 2014-03-24 21:04:02 +01:00
Jason St. John 07a062a793 timedate: fix numerous grammar errors in comments and output/debug messages 2014-03-24 20:49:34 +01:00
Tom Gundersen 3caf0bc89b sd-rtnl: tests - drop redundant tests
These tests were both broken and redundant, so let's drop them.
2014-03-24 20:40:34 +01:00
Marc-Antoine Perennou e43e3e3eed libsystemd: Don't use "class" in public headers
For compatibility with C++
2014-03-24 20:36:57 +01:00
Lennart Poettering 7f8aa67131 core: remove tcpwrap support
tcpwrap is legacy code, that is barely maintained upstream. It's APIs
are awful, and the feature set it exposes (such as DNS and IDENT
access control) questionnable. We should not support this natively in
systemd.

Hence, let's remove the code. If people want to continue making use of
this, they can do so by plugging in "tcpd" for the processes they start.
With that scheme things are as well or badly supported as they were from
traditional inetd, hence no functionality is really lost.
2014-03-24 20:07:42 +01:00
Lennart Poettering 1cfc57e884 build-sys: add makefile link 2014-03-24 19:57:29 +01:00
Lennart Poettering 1c07b16c2f service: don't take chkconfig priority into account
Given that native services do not carry a sysv priority anyway it is
pointless reading them from chkconfig headers, and pretend they'd work.
So let's drop this.
2014-03-24 19:57:28 +01:00
Tom Gundersen 6c7c89dfc6 networkd: add CapabilityBoundingSet 2014-03-24 17:13:24 +01:00
Tom Gundersen e634cd4096 sd-rtnl: message parsing - log when ignoring message attributes 2014-03-24 16:59:31 +01:00
Tom Gundersen d39edfc72f networkd: netdev - verify that newlink messages has the expected kind
We match 'newlink' messages with expected netdev's based on their names. Now also
make sure that the receieved link has the expected kind.
2014-03-24 16:59:30 +01:00
Tom Gundersen 3dd215e056 sd-rtnl: add sd_rtnl_message_enter_container()
Extend rta_offset_tb into a stack of offset tables, one for each parent of the
current container, and make sd_rtnl_message_{enter,exit}_container() pop/push
to this stack.

Also make sd_rtnl_message_rewind() parse the top-level container, and use this
when reading a message from the socket.

This changes the API by dropping the now redundant sd_rtnl_message_read()
method.
2014-03-24 16:59:30 +01:00
Lennart Poettering 48791a98be units: networkd shouldn't have PrivateTmp= set, since it runs in early-boot
/tmp is only available in later boot, and we shouldn't create private
subdirs in it hence, while we are still in early boot.
2014-03-24 16:48:39 +01:00
Lennart Poettering 777920bc03 update TODO 2014-03-24 16:24:07 +01:00
Lennart Poettering bd8f585b99 core: add a setting to globally control the default for timer unit accuracy 2014-03-24 16:24:07 +01:00
Lennart Poettering dedabea4b3 timer: support timers that can resume the system from suspend 2014-03-24 16:24:07 +01:00
Daniel Mack e955c45881 sd-bus: invert bus->is_kernel check in sd_bus_get_peer_creds()
The bug was introducted in a3d59cd1 ("sd-bus: don't use assert_return()
to check for disconnected bus connections")
2014-03-24 14:45:34 +01:00
Gerd Hoffmann cd31d1884f rules: update qemu hid rules
Update comment to be a bit more specific.

Change match to blacklist the serial number of the broken devices
instead of whitelisting the serial number of the fixed devices.
This allows to do something useful with the serial number in the
future.
2014-03-24 08:30:57 -04:00
Lennart Poettering d784e2dbac systemctl: show last trigger time in "systemctl list-timers" 2014-03-24 03:42:17 +01:00
Lennart Poettering 3d94f76c99 util: replace close_pipe() with new safe_close_pair()
safe_close_pair() is more like safe_close(), except that it handles
pairs of fds, and doesn't make and misleading allusion, as it works
similarly well for socketpairs() as for pipe()s...
2014-03-24 03:22:44 +01:00
Lennart Poettering 6a0f1f6d5a sd-event: rework API to support CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM, too 2014-03-24 02:58:41 +01:00
Tom Gundersen f66eeb6bb6 sd-rtnl: message - protect against SEGFAULT when reading messages
Make sure the returned data fits the datatype we requested. Otherwise return -EIO.

Also fix a broken test that this exposed.
2014-03-23 21:54:16 +01:00
Tom Gundersen a212d0dadd sd-rtnl: message - don't skip parts of message when parsing
If a message type occurs repeatedly let the last one win.

Also, don't skip type == MAX.

Based on patch from: Susant Sahani <susant@redhat.com>
2014-03-23 17:51:23 +01:00
David Herrmann 374c356979 sd-bus: mark sd_bus_unref() as broken regarding self-refs
If you allocate a message with bus==NULL and then unref the main bus,
it will free your message underneath and your program will go boom!

To fix that, we really need to figure out what the semantics for
self-references (m->bus) should be and when/where/what accesses are
actually allowed.

Same is true for the pseudo-thread-safety we employ..
2014-03-22 19:35:25 +01:00
Kay Sievers 23aedd0294 README: update 2014-03-22 18:28:47 +01:00
Thomas Bächler f33016ff8b README: Correct EFI requirements
systemd does not need or use CONFIG_EFI_VARS anywhere, this should
be CONFIG_EFIVAR_FS instead.
2014-03-22 18:22:52 +01:00
David Herrmann eb33a6f858 sd-bus: add note about sd_bus_unref() recursion
In sd_bus_unref() we check for self-reference loops and destruct our
queues in case we're the only reference holders. However, we do _not_
modify our own ref-count, thus effectively causing the
message-destructions to enter with the same reference count as we did.

The only reason this doesn't cause an endless recursion (or trigger
assert(m->n_ref > 0) in sd_bus_message_unref()) is the fact that we
decrease queue-counters _before_ calling _unref(). That's not obvious at
all, so add a big fat note in bus_reset_queues() to everyone touching that
code.
2014-03-22 18:06:38 +01:00
David Herrmann 22fdeadcc0 sd-rtnl: fix self-reference leaks
Like sd-bus, sd-rtnl can have self-references through queued messages. In
particular, each queued message has the following self-ref loop:
  rtnl->wqueue[i]->rtnl == rtnl
Same is true for "rqueue".

When sd_rtnl_unref() gets called, we must therefore make sure we correctly
consider each self-reference when deciding to destroy the object. For each
queued message, there _might_ be one ref. However, rtnl-messages can be
created _without_ a bus-reference, therefore we need to verify the
actually required ref-count.

Once we know exactly how many self-refs exist, and we verified none of the
queued messages has external references, we can destruct the object.
We must immediately drop our own reference, then flush all queues and
destroy the bus object. Otherwise, each sd_rtnl_message_unref() call would
recurse into the same destruction logic as they enter with the same
rtnl-refcnt.

Note: We really should verify _all_ queued messages have m->rtnl set to
      the bus they're queued on. If that's given, we can change:
        if (REFCNT_GET(rtnl->n_ref) <= refs)
      to
        if (REFCNT_GET(rtnl->n_ref) == refs)
      and thus avoid recalculating the required refs for each message we
      remove from the queue during destruction.
2014-03-22 18:00:03 +01:00
Tom Gundersen 2afa65c312 sd-dhcp-client: test - don't close socket twice
One end of the socketpair is closed by the library, so only close our end. Also switch to
the safe_close() so we get notified about problems with closing.
2014-03-22 10:52:49 +01:00
Tom Gundersen c6f7c917a1 libsystemd-network: move network-utils from src/shared
This does not belong in shared as it is mostly a detail of our networking subsystem.

Moreover, now we can use libudev here, which will simplify things.
2014-03-21 21:54:37 +01:00
Umut Tezduyar Lindskog b5db00e52e sd-ipv4ll/networkd: generate predictable addresses
Increase the chance of using the same link local address between reboots. The
pseudo random sequence of addresses we attempt is now seeded with data that is
very likely to stay the same between reboots, but at the same time be unique
to the specific machine/nic.

First we try to use the ID_NET_NAME_* data from the udev db combined with the
machin-id, which is guaranteed to be unique and persistent, if available. If
that is not possible (e.g., in containers where we don't have access to the
udev db) we fallback to using the MAC address of the interface, which is
guaranteed to be unique, and likely to be persistent.

[tomegun: three minor changes:

 - don't expose HASH_KEY in the siphash24 header
 - get rid of some compile-warnings (and some casts at the same time),
   by using uint8_t[8] rather than uint64_t in the api
 - added commit message]
2014-03-21 20:24:10 +01:00
Kay Sievers 18bb8adb06 timedated: do not reset poll interval with a spike 2014-03-21 20:22:38 +01:00
Tom Gundersen 4644fee04f sd-dhcp-client/sd-ipv4ll: allow mac address to be updated at any time
If necessary, restart the clients to deal with a changing mac address
at runtime. This will solve the problem of starting clients on bridges
before they have received their final MAC address.
2014-03-21 18:36:32 +01:00
Brandon Philips 9765ce69e1 network: dhcp: create explicit host route to gateway
Some DHCP servers gives you a netmask of 255.255.255.255 so the gateway is not
routable. Other DHCP client implementations look through the existing routes to
figure out if they should add an explicit host route. See below for a link.

However, it makes sense to just create the route explicitly whether it is
needed or not since it is explicit, makes the dhcp route entries independent of
other entries and saves us from knowing the state of the kernel tables.

After patch route table on a machine with a network (common case):

default via 10.0.2.2 dev ens3
10.0.2.0/24 dev ens3  proto kernel  scope link  src 10.0.2.15
10.0.2.2 dev ens3  scope link

After patch route table on a machine without a network (this case):

default via 10.240.0.1 dev ens4v1
10.240.0.1 dev ens4v1  scope link

The code from dhcpcd that works around this issue is on line 637.
https://android.googlesource.com/platform/external/dhcpcd/+/master/configure.c
2014-03-21 17:52:42 +01:00
Tom Gundersen 9e64dd7276 sd-dhcp-client: add fallback subnet masks
The DHCP RFC does not require the DHCP server to send a subnet mask, so if it
is missing, let's try to use the default subnet masks based on address class.
In case the class the address belongs to does not have a default subnet mask,
we fail as before.

Also improve logging when handling invalid dhcp messages, and simply ignore them
rather than stop the whole dhcp client.
2014-03-21 17:52:42 +01:00
Tom Gundersen 022446adf9 sd-dhcp-client: make timeout handling a bit more robust
Accept any lease lifetime greater than one second. Server should not
hand out extremely short leases, but let's not be the ones to fail.

Do not fail when arming a timer in the past, but also only arm one such
timer.

Avoid rounding errors when computing the default timeouts, this may be
an issue if we are handed a very short lease.

Also, don't pass 'time_now' around, as that can be found in the event
object when needed.
2014-03-21 17:52:42 +01:00