summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt2014-09-15
| | | | | | | | | It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
* test: fix test of uid-rangeThomas Hindoe Paaboel Andersen2014-09-14
| | | | | | | | | The number of uid's in the range should be tested instead of written directly. The test still passes with the fix checks. Found with Coverity. Fixes: CID#1237714 - 1237722
* sd-dhcp: fix test of magic cookieThomas Hindoe Paaboel Andersen2014-09-14
| | | | | | | The magic cookie is set in dhcp_message_init. Test the magic cookie value intead of writing the last 3/4 of it directly. Found with Coverity. Fixes: CID#1237732 CID#1237734 CID#1237735
* resolved: fall back to hardcoded ifindex when checking if a link is the loopbackTom Gundersen2014-09-13
| | | | | | Reported by Philippe De Swert <philippedeswert@gmail.com>. Coverity CID#1237656
* networkd: remove vestigial event sourcesDave Reisner2014-09-13
| | | | | 187fe1db took advantage of floating events, but didn't remove pointers it made superfluous.
* core: use correct function to free CalendarSpecDave Reisner2014-09-13
|
* core: fix a potential mem leakThomas Hindoe Paaboel Andersen2014-09-13
| | | | Found with Coverity. Fixes: CID#996438
* analyze: fix mem leakThomas Hindoe Paaboel Andersen2014-09-13
| | | | Found with Coverity. Fixes: CID#1237756
* core: smack-setup: Actually allow for succesfully loading CIPSO policyPhilippe De Swert2014-09-13
| | | | | | | | The line under the last switch statement *loaded_policy = true; would never be executed. As all switch cases return 0. Thus the policy would never be marked as loaded. Found with Coverity. Fixes: CID#1237785
* analyze: avoid a null dereferenceThomas Hindoe Paaboel Andersen2014-09-11
| | | | | | | If we have an error in the early sd_bus_* calls then unit_times will still be null. Found with coverity. Fixes: CID#996464
* udev: timeout - warn after a third of the timeout before killingTom Gundersen2014-09-11
|
* firstboot: silence a warningThomas Hindoe Paaboel Andersen2014-09-11
| | | | | | | No change in behavoir as the fallthrough from ARG_COPY had already set arg_copy_locale to true. Found with coverity. Fixes: CID#1237622
* manager: use correct cleanup functionThomas Hindoe Paaboel Andersen2014-09-11
| | | | | | | | Close the dir instead of attempt to free it. Introduced in 874310b7b68c4c0d36ff07397db30a959bb7dae5 Found with coverity. Fixes: CID#996368
* activate: fix fd leak in do_accept()Philippe De Swert2014-09-11
| | | | Found with Coverity.
* test: fix mem-leak in fdopen() testDavid Herrmann2014-09-11
| | | | | | We must free FILE* after function return to not leak resources. Note that this also closes our fd as fdopen() takes ownership of it. Reported by Philippe De Swert (via coverity).
* bus: unref buscreds on failurePhilippe De Swert2014-09-11
| | | | | | | Actually unref the buscreds when we are not going to return a pointer to them. As when bus_creds_add_more fails we immediately return the error code otherwise and leak the new buscreds. Found with coverity. Fixes: CID#1237761
* journal: do not leak mmaps on OOMPhilippe De Swert2014-09-11
| | | | | | | 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
* terminal: fix uninitialized variable in strerror() log messageDavid Herrmann2014-09-11
| | | | | | | 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).
* journal: do not dereference already freed patternsPhilippe De Swert2014-09-11
| | | | | | | 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
* bus: avoid using m->kdbus after freeing itPhilippe De Swert2014-09-11
| | | | | | | m->kdbus could be freed before it is released. Changing the order fixes the issue. Found with Coverity. Fixes: CID#1237798
* terminal: drop redundant assertionDavid Herrmann2014-09-11
| | | | | This assertion is already there two lines down. Drop the redundant assertion.
* terminal: fix wrong return value in idev if fcntl() failsDavid Herrmann2014-09-11
| | | | | This might cause >=0 to be returned, even though the method failed. Fix this and return -errno.
* terminal: enable sessions in evcat after taking controlDavid Herrmann2014-09-11
| | | | | | | 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.
* terminal: remove unused set.h inclusion in idevDavid Herrmann2014-09-11
| | | | | | 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.
* udev: allow removing tags via TAG-="foobar"David Herrmann2014-09-11
| | | | | | | | | | 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.
* terminal: remove redundant "struct" prefixesDavid Herrmann2014-09-11
| | | | | We define typedefs for all internal types so drop the redundant "struct" prefix.
* terminal: discard async read() errors for evdevDavid Herrmann2014-09-11
| | | | | | | 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.
* backlight: Avoid error when state restore is disabledMichael Biebl2014-09-11
| | | | | | When the state restore is disabled, we would print: "Unknown verb: load" instead of simply skipping loading the state.
* udev: timeout - increase timeoutTom Gundersen2014-09-10
| | | | | | 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.
* udev: fix copy-paste error in log messageTom Gundersen2014-09-10
|
* test-dhcp6-client: Add checks for Elapsed Time optionPatrik Flykt2014-09-10
| | | | Verify that the Elapsed Time option is present.
* sd-dhcp6-client: Implement Elapsed Time optionPatrik Flykt2014-09-10
| | | | | | | | | | 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.
* udev - drop print_kmsgTom Gundersen2014-09-09
| | | | The only remaining user was 'starting version XXX', which is now logged using log_info().
* udev: netif_rename - don't log to kmsgTom Gundersen2014-09-09
| | | | As of 3.17, the kernel will do this on its own, so just do regular log_debug() logging from udev.
* udev: net_setup_link - open ethtool and rtnl connections lazilyTom Gundersen2014-09-09
|
* udev: event - keep one rtnl per worker, rather than per eventTom Gundersen2014-09-09
| | | | | | | | 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.
* udev: import the full db on MOVE events for devices without dev_tTom Gundersen2014-09-09
|
* execute: silence warningsThomas Hindoe Paaboel Andersen2014-09-08
| | | | Mark two function parameters as const
* namespace: avoid posible use of uninitialized variableThomas Hindoe Paaboel Andersen2014-09-08
|
* machined: remove redundant sd_notifyDave Reisner2014-09-08
| | | | | | We already call this on via bus_event_loop_with_idle on exit. This makes machined consistent with other similar daemons: localed, hostnamed, timedated.
* networkd: allow specification of DHCP route metricAngus Gibson2014-09-08
| | | | | | 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.
* networkctl: show the link file applied to each linkTom Gundersen2014-09-08
|
* udev: link-config - only set *name on successTom Gundersen2014-09-08
|
* udev: net_setup_link - export the .link filename applied to the linkTom Gundersen2014-09-08
|
* networkctl: show the network file applied to each linkTom Gundersen2014-09-08
|
* sd-network: add _get_network_file apiTom Gundersen2014-09-08
|
* networkd: add preferred source to dhcp4 gateway routeEmil Renner Berthing2014-09-08
| | | | | | | 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]
* networkd: netdev - failing to create a netdev is not fatal, just fail that ↵Tom Gundersen2014-09-08
| | | | netdev
* networkd: tuntap - return correct error when /dev/net/tun cannot be openedTom Gundersen2014-09-08
|
* service: hook up custom endpoint logicDaniel Mack2014-09-08
| | | | | | | | | | | | 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.