summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-07-22cgls: machines can also be servicesSteven Allen
This makes `systemd-cgls -M <machine name>` work with nspawn containers in systemd 222.
2015-07-17basic: bitmap - complete fix for bitshift overflowTom Gundersen
The bug found by David existed in several places, fix them all. Also extend the tests to cover these cases.
2015-07-17Merge pull request #611 from dvdhrm/bitmap-fixesTom Gundersen
Bitmap fixes
2015-07-17Merge pull request #607 from ssahani/vxlan1David Herrmann
networkd: move config parsers to specific header files
2015-07-17bitmap: avoid 32bit integer overflow in shiftDavid Herrmann
We really must use 64bit integers to calculate long-long shifts. Otherwise, we will never get higher masks than 2^31.
2015-07-17bitmap: allow bitmap_iterate() on NULL bitmapDavid Herrmann
Make sure we properly treat NULL bitmaps as empty. Right now, we don't (which really looks like a typo).
2015-07-17cgtop: include missing signal.h for sigwinchUmut Tezduyar Lindskog
2015-07-16logind: never select closing sessions for a VTDavid Herrmann
If a session is in closing state (and already got rid of its VT), then never re-select it for that VT. There is no reason why we should grant something to a session that is already going away *AND* already got rid of exactly that.
2015-07-16logind: prefer new sessions over older ones on VT switchesDavid Herrmann
Our seat->positions[] array keeps track of the 'preferred' session on a VT. The only situation this is used, is to select the session to activate when a VT is activated. In the normal case, there's only one session per VT so the selection is trivial. Older greeters, however, implement take-overs when they start sessions on the same VT that the greeter ran on. We recently limited such take-overs to VTs where a greeter is running on, to force people to never share VTs in new code that is written. For legacy reasons, we need to be compatible to old greeters, though. Hence, we allow those greeters to implement take-over. In such take-overs, however, we should really make sure that the new sessions gets preferred over the old one under all circumstances. Hence, make sure we override the previous preferred session with a new session.
2015-07-16networkd: move config_parse_tunnel_addressSusant Sahani
move config_parse_tunnel_address from networkd.h to tunnel specific file networkd-netdev-tunnel.h
2015-07-16networkd: move config_parse_vxlan_group_addressSusant Sahani
move config_parse_vxlan_group_address from networkd.h to networkd-netdev-vxlan.h
2015-07-16sd-bus: add new test for NameAcquired via proxy/dbus-daemonDavid Herrmann
This adds test-bus-proxy which should be used to test correct behavior of systemd-bus-proxyd. The first test that was added is to verify we actually receive NameAcquired signals for ourselves on bus-connect.
2015-07-16Merge pull request #602 from teg/bitmap-iteratorDavid Herrmann
bitmap: use external iterator
2015-07-16sd-bus: properly match ID changesDavid Herrmann
If the caller does not specify arg1 for NameOwnerChanged matches, we really must take the ID from arg2 or arg3, if provided. They are guaranteed to be identical to arg1 if either is supplied, but there is no strict requiredment that arg1 is supplied. Hence, make sure to always take the more restrictive match. Otherwise, we install rather wide matches without anyone requiring them.
2015-07-16sd-bus: destination-matches cannot match NameOwnerChangedDavid Herrmann
Make sure we don't install NameOwnerChanged matches if the caller passed a destination='' match (except if it is the broadcast address). Per spec, all NameOwnerChanged signals are broadcasts. Only the NameLost/NameAcquired signals are unicasts, but those are never received through sd-bus. Instead, the bus-proxy synthesizes them and it already installs proper matches for them.
2015-07-16sd-bus: fix invalid stack access on test-bus-marshalDavid Herrmann
Make sure we actually parse "unsigned long long" if we encode a uint64_t. Otherwise, we will get random data from the stack.
2015-07-16bitmap: use external iteratorTom Gundersen
Reuse the Iterator object from hashmap.h and expose a similar API. This allows us to do { Iterator i; unsigned n; BITMAP_FOREACH(n, b, i) { Iterator j; unsigned m; BITMAP_FOREACH(m, b, j) { ... } } } without getting confused. Requested by David.
2015-07-16sd-bus: fix gvariant structure encodingDavid Herrmann
In gvariant, all fixed-size objects need to be sized a multiple of their alignment. If a structure has only fixed-size members, it is required to be fixed size itself. If you imagine a structure like (ty), you have an 8-byte member followed by an 1-byte member. Hence, the overall inner-size is 9. The alignment of the object is 8, though. Therefore, the specs mandates final padding after fixed-size structures, to make sure it's sized a multiple of its alignment (=> 16). On the gvariant decoder side, we already account for this in bus_gvariant_get_size(), as we apply overall padding to the size of the structure. Therefore, our decoder correctly skips such final padding when parsing fixed-size structure. On the gvariant encoder side, however, we don't account for this final padding. This patch fixes the structure and dict-entry encoders to properly place such padding at the end of non-uniform fixed-size structures. The problem can be easily seen by running: $ busctl --user monitor and $ busctl call --user org.freedesktop.systemd1 / org.foobar foobar "(ty)" 777 8 The monitor will fail to parse the message and print an error. With this patch applied, everything works fine again. This patch also adds a bunch of test-cases to force non-uniform structures with non-pre-aligned positions. Thanks to Jan Alexander Steffens <jan.steffens@gmail.com> for spotting this and narrowing it down to non-uniform gvariant structures. Fixes #597.
2015-07-15Merge pull request #588 from teg/resolved-nsecDaniel Mack
resolved: add basic NSEC and NSEC3 support
2015-07-15sd-bus: fix object tree to be deeper than 2 levelsDavid Herrmann
So right now our object-tree is limited to 2 levels at most ('/' and '/foo/...../bar'). We never link any intermediate levels, even though that was clearly the plan. Fix the bus_node_allocate() helper to actually link all intermediate nodes, too, not just the root node. This fixes a simple inverse ptr-diff bug. The downside of this fix is that we clearly never tested (nor used) the object tree in any way. The only reason that the introspection works is that our enumerators shortcut the object tree. Lets see whether that code actually works.. Thanks to: Nathaniel McCallum <nathaniel@themccallums.org> ..for reporting this. See #524 for an actual example code.
2015-07-15sd-device: never return NULL+0David Herrmann
It is highly confusing if a getter function returns 0, but the value is set to NULL. This, right now, triggers assertions as code relies on the returned values to be non-NULL. Like with sd-bus-creds and friends, return 0 only if a value is actually available. Discussed with Tom, and actually fixes real bugs as in #512.
2015-07-15sd-boot: ignore missing /etc/machine-idDavid Herrmann
If /etc/machine-id is missing (eg., gold images), we should not fail installing sd-boot. This is a perfectly fine use-case and we should simply skip installing the default loader config in that case.
2015-07-14resolved: rr - add NSEC3 supportTom Gundersen
Needed for DNSSEC.
2015-07-14basic: util - add base32hexmem() function similar to hexmem()Tom Gundersen
This implements more of RFC4648.
2015-07-14resolved: rr - add NSEC supportTom Gundersen
Needed for DNSSEC.
2015-07-14basic: add a Bitmap implementationTom Gundersen
For when a Hashmap is overkill.
2015-07-14basic: util - fix memleak on error in unbase64mem()Tom Gundersen
2015-07-14Merge pull request #538 from mischief/multiple-routersTom Gundersen
sd-dhcp-lease: fix handling of multiple routers We only support one router, but in case more than one is given, we now ignore subsequent ones, rather than fall over.
2015-07-14Merge pull request #586 from teg/resolved-rrs-3Daniel Mack
resolved: minor improvements to RR handling
2015-07-14resolved: improve printing of unknown RRsTom Gundersen
This implements the recommendations from RFC3597.
2015-07-14Merge pull request #585 from teg/resolved-harden-2Daniel Mack
resolved: harden
2015-07-14Merge commit 'refs/pull/436/head' of https://github.com/systemd/systemdDavid Herrmann
This merges: sd-netlink: respect attribute type flags ..fixing a conflict due to a typo fix.
2015-07-14resolved: rr - add DS supportTom Gundersen
Needed for DNSSEC.
2015-07-14resolved: rr - print formated timestamps in RRSIGTom Gundersen
2015-07-14resolved: use one UDP socket per transactionTom Gundersen
We used to have one global socket, use one per transaction instead. This has the side-effect of giving us a random UDP port per transaction, and hence increasing the entropy and making cache poisoining significantly harder to achieve. We still reuse the same port number for packets belonging to the same transaction (resent packets).
2015-07-14resolved: implement RFC5452Tom Gundersen
This improves the resilience against cache poisoning by being stricter about only accepting responses that match precisely the requst they are in reply to. It should be noted that we still only use one port (which is picked at random), rather than one port for each transaction. Port randomization would improve things further, but is not required by the RFC.
2015-07-14resolved: pin the server used in a transactionTom Gundersen
We want to discover information about the server and use that in when crafting packets to be resent.
2015-07-14Merge pull request #530 from dvdhrm/resolve-host-dbusDaniel Mack
resolve-host: enable dbus-activation
2015-07-14resolved: reference count the dns serversTom Gundersen
We want to reference the servers from their active transactions, so make sure they stay around as long as the transaction does.
2015-07-14resolved: packet - ensure there is space for IP+UDP headersTom Gundersen
Currently we only make sure our links can handle the size of the payload witohut taking the headers into account.
2015-07-14networkd: tap add support for vnet_hdrSusant Sahani
This patch adds support to configure IFF_VNET_HDR flag for a tap device. It allows whether sending and receiving large pass larger (GSO) packets. This greatly increases the achievable throughput.
2015-07-14resolved: rr - print DNSKEY and RRSIG in base64Tom Gundersen
As mandated by RFC4034.
2015-07-13resolved: make LLMNR checks conditionalDaniel Mack
Make all LLMNR related packet inspections conditional to p->protocol. Use switch-case statements while at it, which will make future additions more readable.
2015-07-13resolved: separate LLMNR specific header bitsDaniel Mack
The C and T bits in the DNS packet header definitions are specific to LLMNR. In regular DNS, they are called AA and RD instead. Reflect that by calling the macros accordingly, and alias LLMNR specific macros. While at it, define RA, AD and CD getters as well.
2015-07-13resolved: use a #define for LLMNR portDaniel Mack
De-duplicate some magic numbers.
2015-07-13resolved: move LLMNR related functions into separate fileDaniel Mack
2015-07-12dhcp: add support for vendor specific DHCP optionBeniamino Galvani
This adds support for option 43 (Vendor Specific Information) to libsystemd-network DHCP code. The option carries an opaque object of n octets, interpreted by vendor-specific code on the clients and servers. [@zonque: adopted to new unhexmem() API]
2015-07-12basic: util - add base64mem() function similar to hexmem()Tom Gundersen
This implements RFC4648 for a slightly more compact representation of binary data compared to hex (6 bits per character rather than 4).
2015-07-12basic: util - fix errorhandling in unhexmem()Tom Gundersen
We were ignoring failures from unhexchar, which meant that invalid hex characters were being turned into garbage rather than the string rejected. Fix this by making unhexmem return an error code, also change the API slightly, to return the size of the returned memory, reflecting the fact that the memory is a binary blob,and not a string. For convenience, still append a trailing NULL byte to the returned memory (not included in the returned size), allowing callers to treat it as a string without doing a second copy.
2015-07-12Merge pull request #558 from poettering/logind-bus-policyTom Gundersen
logind: bring bus policy up-to-date