1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 19:21:53 +03:00
Commit Graph

17070 Commits

Author SHA1 Message Date
Philippe De Swert
b67ddc7bbe journal: do not leak mmaps on OOM
After a section of memory is succesfully allocated, some of the following
actions can still fail due to lack of memory. In this case -ENOMEM is
returned without actually freeing the already mapped memory.
Found with coverity. Fixes: CID#1237762
2014-09-11 17:27:44 +02:00
David Herrmann
21978bc3c9 terminal: fix uninitialized variable in strerror() log message
We currently print weird error-messages if xkbcommon fails (which cannot
fail so far, but might in the future). Fix the uninitialized variable
warnings by setting 'r' correctly.
Thanks to Philippe De Swert for catching this (via coverity).
2014-09-11 17:20:11 +02:00
Philippe De Swert
48d4c7468f journal: do not dereference already freed patterns
In case set_consume goes wrong, the pattern name has already been
freed. So we do not try to print it in the logs, assuming the pattern
addition print will be printed just before the failure anyway. Found
with coverity. Fixes: CID#1237798
2014-09-11 17:13:59 +02:00
Philippe De Swert
fd989a0bc9 bus: avoid using m->kdbus after freeing it
m->kdbus could be freed before it is released. Changing the
order fixes the issue.

Found with Coverity. Fixes: CID#1237798
2014-09-11 17:09:50 +02:00
David Herrmann
393a5ba09f terminal: drop redundant assertion
This assertion is already there two lines down. Drop the redundant
assertion.
2014-09-11 15:30:56 +02:00
David Herrmann
667b60341f terminal: fix wrong return value in idev if fcntl() fails
This might cause >=0 to be returned, even though the method failed. Fix
this and return -errno.
2014-09-11 15:29:58 +02:00
David Herrmann
c600022303 terminal: enable sessions in evcat after taking control
If we enable a session, any probed device might get immediately enabled.
This might cause TakeDevice() messages to be sent before we call
TakeControl(). Therefore, enable sessions *after* sending TakeControl() so
we always succeed if TakeControl() succeeds.
2014-09-11 15:28:37 +02:00
David Herrmann
1f3752c81a terminal: remove unused set.h inclusion in idev
We don't use set.h so no need to include it. We used to include it for
temporary refs on all idev devices of a session, but that never was pushed
upstream.
2014-09-11 15:27:56 +02:00
David Herrmann
8e3ba3772c udev: allow removing tags via TAG-="foobar"
This extends the udev parser to support OP_REMOVE (-=) and adds support
for TAG-= to remove previously set tags. We don't fail if the tag didn't
exist.

This is pretty handy if we ship default rules for seat-assignments and
users want to exclude specific devices from that. They can easily add
rules that drop any automatically added "seat" tags again.
2014-09-11 15:22:16 +02:00
David Herrmann
2e1dd622ee terminal: remove redundant "struct" prefixes
We define typedefs for all internal types so drop the redundant "struct"
prefix.
2014-09-11 15:22:16 +02:00
David Herrmann
98b7fe2ad4 terminal: discard async read() errors for evdev
If read() fails on evdev devices, we deal with this in idev_evdev_hup().
It is very likely this is an async revoke, therefore, we must not abort.
Fix our io helper to discard such errors after passing them to
idev_evdev_hup(), so we don't bail out of the event loop.
2014-09-11 15:22:16 +02:00
Michael Biebl
b76388e123 backlight: Avoid error when state restore is disabled
When the state restore is disabled, we would print:
"Unknown verb: load" instead of simply skipping loading the
state.
2014-09-11 00:53:49 +02:00
Tom Gundersen
b5338a1986 udev: timeout - increase timeout
Some kernel modules still take more than one minute to insmod, we no longer rely on the timeout
killing insmod within a given period of time, so just bump this to a much higher value. Its only
purpose is to make sure that nothing stays aronud forever.
2014-09-10 18:10:06 +02:00
Tom Gundersen
ec3281d3b6 udev: fix copy-paste error in log message 2014-09-10 18:09:32 +02:00
Patrik Flykt
e9385929c8 TODO: Remove Elapsed Time DHCPv6 option as it is done 2014-09-10 12:56:46 +03:00
Patrik Flykt
d63be95a30 test-dhcp6-client: Add checks for Elapsed Time option
Verify that the Elapsed Time option is present.
2014-09-10 12:56:29 +03:00
Patrik Flykt
346e13a25d sd-dhcp6-client: Implement Elapsed Time option
Implement Elapsed Time option as it is defined as MUST in RFC 3315,
section 22.9. The elapsed time value is a 1/100th of a second with
a max value of 0xffff, i.e. 655.35 seconds.

As the main loop might not be running yet when sd_dhcp6_client_start() is
called, fetch the monotonic time directly and not from the event loop
while in state DHCP6_STATE_STOPPED.
2014-09-10 12:56:24 +03:00
Tom Gundersen
9d19a679f2 udev - drop print_kmsg
The only remaining user was 'starting version XXX', which is now logged using log_info().
2014-09-09 22:48:57 +02:00
Tom Gundersen
1187f20655 udev: netif_rename - don't log to kmsg
As of 3.17, the kernel will do this on its own, so just do regular log_debug() logging from udev.
2014-09-09 22:45:03 +02:00
Tom Gundersen
aedca89268 udev: net_setup_link - open ethtool and rtnl connections lazily 2014-09-09 15:36:56 +02:00
Tom Gundersen
4c83d99456 udev: event - keep one rtnl per worker, rather than per event
Creating the rtnl context is cheap, but freeing it may not be, due to
synchronous close().

Also drop some excessive logging. We now log about the changing ifname
exactly once.
2014-09-09 15:30:10 +02:00
Tom Gundersen
b081b27e14 udev: import the full db on MOVE events for devices without dev_t 2014-09-09 15:03:49 +02:00
Ivan Shapovalov
72ba9f04f9 build-sys: make hibernation support configure option also handle hybrid-sleep; fix indentation 2014-09-09 15:03:49 +02:00
Marcel Holtmann
fea0bfaed5 hwdb: update 2014-09-09 07:44:02 +02:00
Thomas Hindoe Paaboel Andersen
822a59607c execute: silence warnings
Mark two function parameters as const
2014-09-08 22:10:36 +02:00
Thomas Hindoe Paaboel Andersen
120d578e5f namespace: avoid posible use of uninitialized variable 2014-09-08 22:09:41 +02:00
Mantas Mikulėnas
52e231b046 rules: net-setup-link - remove stray linebreak
If not backslash-escaped, it splits the rule in two.
2014-09-08 22:03:17 +02:00
Tom Gundersen
e4d7c49050 rules: net-setup-link - preserve ID_NET_LINK_FILE and ID_NET_NAME after MOVE 2014-09-08 17:18:43 +02:00
Dave Reisner
4cb4060678 machined: remove redundant sd_notify
We already call this on via bus_event_loop_with_idle on exit. This
makes machined consistent with other similar daemons: localed,
hostnamed, timedated.
2014-09-08 09:29:36 -04:00
Angus Gibson
84b5b79a8f networkd: allow specification of DHCP route metric
This lets the routing metric for links to be specified per-network,
still defaulting to DHCP_ROUTE_METRIC (1024) if unspecified. Hopefully
this helps with multiple interfaces configured via DHCP.
2014-09-08 15:09:08 +02:00
Tom Gundersen
af5effc422 networkctl: show the link file applied to each link 2014-09-08 15:09:08 +02:00
Tom Gundersen
d95b83b87d udev: link-config - only set *name on success 2014-09-08 15:09:07 +02:00
Tom Gundersen
ad6e5b348f udev: net_setup_link - export the .link filename applied to the link 2014-09-08 15:09:07 +02:00
Tom Gundersen
373d9f173f networkctl: show the network file applied to each link 2014-09-08 15:09:07 +02:00
Tom Gundersen
adc5b2e2eb sd-network: add _get_network_file api 2014-09-08 15:09:07 +02:00
Tom Gundersen
b70c73fcf1 TODO 2014-09-08 15:09:07 +02:00
Emil Renner Berthing
46b0c76e2c networkd: add preferred source to dhcp4 gateway route
This makes DHCPv4 and IPv4LL coexist peacefully.

[tomegun: apply to both the dhcp routes, use in_addr_is_null() rather than a
separate variable to indicate when prefsrc should be applied]
2014-09-08 15:08:27 +02:00
Tom Gundersen
4bd5ace3e7 units: networkd - order after udev
This way we are sure that /dev/net/tun has been given the right permissions before we try to connect to it.
Ideally, we should create tun/tap devices over netlink, and then this whole issue would go away.
2014-09-08 15:07:51 +02:00
Tom Gundersen
1eb808756e networkd: netdev - failing to create a netdev is not fatal, just fail that netdev 2014-09-08 15:07:51 +02:00
Tom Gundersen
6f44acfb48 networkd: tuntap - return correct error when /dev/net/tun cannot be opened 2014-09-08 15:07:51 +02:00
Daniel Mack
e44da745d1 service: hook up custom endpoint logic
If BusPolicy= was passed, the parser function will have created
an ExecContext->bus_endpoint object, along with policy information.

In that case, create a kdbus endpoint, and pass its path name to the
namespace logic, to it will be mounted over the actual 'bus' node.

At endpoint creation time, no policy is updloaded. That is done after
fork(), through a separate call. This is necessary because we don't
know the real uid of the process earlier than that.
2014-09-08 14:15:02 +02:00
Daniel Mack
060e088e94 exit-status: add new exit code for custom endpoint errors 2014-09-08 14:12:56 +02:00
Daniel Mack
a610cc4f18 namespace: add support for custom kdbus endpoint
If a path to a previously created custom kdbus endpoint is passed in,
bind-mount a new devtmpfs that contains a 'bus' node, which in turn in
bind-mounted with the custom endpoint. This tmpfs then mounted over the
kdbus subtree that refers to the current bus.

This way, we can fake the bus node in order to lock down services with
a kdbus custom endpoint policy.
2014-09-08 14:12:56 +02:00
Daniel Mack
5019962312 bus: parse BusPolicy directive in service files
Add a new directive called BusPolicy to define custom endpoint policies. If
one such directive is given, an endpoint object in the service's ExecContext is
created and the given policy is added to it.
2014-09-08 14:12:54 +02:00
Daniel Mack
e7d718afdb bus: add code to create custom endpoints and set their policy
Custom endpoints are alternative connection points to a bus, allowing
specific policy to be uploaded.

Add two functions to bus-kernel. One to create such endpoints, and another
one for setting a policy for them.
2014-09-08 11:06:45 +02:00
Daniel Mack
bb7dd0b04a bus: add kdbus endpoint types
Add types to describe endpoints and associated policy entries,
and add a BusEndpoint instace to ExecContext.
2014-09-08 11:06:45 +02:00
Daniel Mack
5369c77d2e bus: factor out bus policy items
In order to re-use the policy definitions, factor them out into their own
files.
2014-09-08 11:06:45 +02:00
Marcel Holtmann
de68938a2c hwdb: Update database of Bluetooth company identifiers 2014-09-08 05:06:18 +02:00
Michael Biebl
67826132ad man: fix references to systemctl man page which is now in section 1
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760613
2014-09-06 13:45:18 +02:00
Lennart Poettering
3bcde97e85 update TODO 2014-09-05 21:49:44 +02:00