summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Classify processes from sessions into cgroupsAndy Wingo2017-03-14
| | | | | | | Create a private cgroup tree associated with no controllers, and use it to map PIDs to sessions. Since we use our own path structure, remove internal cgroup-related helpers that interpret the cgroup path structure to pull out users, slices, and scopes.
* Stop sessions on ReleaseSessionAndy Wingo2017-03-14
|
* Fix the login monitorAndy Wingo2017-03-14
| | | | | | * src/login/logind.c (main): Create /run/systemd/machines, so that the login monitor works. * configure.ac: v219.10.
* Handle suspend/hibernate/hybrid-suspend/shutdown/reboot directlyAndy Wingo2017-03-14
| | | | | | | | | | | | | | * configure.ac: Get paths of halt and reboot. * Makefile.am (systemsleepdir, systemshutdowndir): New variables. Look in them for hooks to run. * src/login/logind-action.c: Inline the salient bits from systemd's system-sleep.c here. * src/login/logind-dbus.c (execute_shutdown_or_sleep): Call our own shutdown_or_sleep helper instead of invoking a systemd method. * src/login/logind.h: Declare shutdown_or_sleep.
* Beginnings of handling suspend/etc within logindAndy Wingo2017-03-14
| | | | | Since we are catching the keys, we might as well just do suspend/reboot/etc handling here.
* Remove systemd subscription and user/session unitsAndy Wingo2017-03-14
| | | | | | This removes attempts by logind to listen to systemd messages over the bus, and to start and/or manage units associated with sessions and users.
* Remove support for auto-spawning VTsAndy Wingo2017-03-14
| | | | | Auto-spawning VTs requires systemd in practice. If you're using systemd you can just use its logind :)
* Actually working with pamAndy Wingo2017-03-14
| | | | | | | | | | * src/login/logind-user.c (user_start): Don't start slices and systemd-user services. * src/login/logind-dbus.c (method_create_session): Send a reply directly instead of waiting on systemd that isn't there. * configure.ac: Bump version.
* Create /run/systemd as neededAndy Wingo2017-03-14
| | | | | * src/login/logind.c (main): Also create /run/systemd at startup. * configure.ac: Bump to 219.3.
* logind: release VT-positions when closing sessionsDavid Herrmann2017-03-14
| | | | | | | | | Make sure we release VT-positions when a session is closed. Otherwise, lingering sessions will occupy VTs and prevent next logins from succeeding. Note that we already release session-devices when closing a session, so there cannot be anyone using the VT anymore.
* bus-proxy: make StartServiceByName synchronousDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The StartServiceByName() call was provided by dbus-daemon to activate a service without sending a message. On receiption, dbus-daemon schedules an activation request (different modes are supported) and sends back the reply once activation is done. With kdbus, we marked StartServiceByName() as deprecated. There is no real reason to start services explicitly. Instead, applications should just *use* the service and rely on it being activated implicitly. However, we provide compatibility with dbus-daemon and implement StartServiceByName() on the proxy via a call to org.freedesktop.DBus.Peer.Ping() on the destination. This will activate the peer implicitly as part of the no-op Ping() method call (regardless whether the peer actually implements that call). Now, the problem is, StartServiceByName() was synchronous on dbus-daemon but isn't on bus-proxy. Hence, on return, there is no guarantee that ListNames includes the activated name. As this is required by some applications, we need to make this synchronous. This patch makes the proxy track the Ping() method call and send the reply of StartServiceByName() only once Ping() returned. We do not look at possible errors of Ping(), as there is no strict requirement for the peer to implement org.freedesktop.DBus.Peer. Furthermore, any interesting error should have already been caught by sd_bus_send() before. Note: This race was triggered by gdbus. The gdbus-proxy implementation relies on a name to be available after StartServiceByName() returns. This is highly fragile and should be dropped by gdbus. Even if the call is synchronous, there is no reason whatsoever to assume the service did not exit-on-idle before ListNames() returns. However, this race is much less likely than the startup race, so we try to be compatible to dbus-daemon now.
* sd-bus: fix parsing of KDBUS_CMD_LISTDavid Herrmann2017-03-14
| | | | | | | | | | | We *must not* assume that an entry returned by KDBUS_CMD_LIST only carries a single KDBUS_ITEM_OWNED_NAME. Similarly, we already parse multiple such items for message-metadata, so make sure we support the same on KDBUS_CMD_LIST. By relying on the kernel to return all names separately, we limit the kernel API significantly. Stop this and let the kernel decide how to return its data.
* sd-boot: stub - export LoaderDevicePartUUIDKay Sievers2017-03-14
|
* sd-bus: fix encoding/decoding gvariant root containerDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | The gvariant root container contains a 'variant' at the end, which embeds the whole message body. This variant *must* contain a structure so we are compatible to dbus1. Otherwise, it could encode at most 1 type, instead of a full signature. Our gvariant message parser already parses the variant-content as a structure, so we're mostly good. However, it does *not* include the opening and closing parantheses, nor does it parse them. This patch fixes the decoder to verify a message contains the parantheses, and also make the encoder add those parantheses into the marshaled message.
* socket-util: library calls shouldn't log on their ownLennart Poettering2017-03-14
| | | | Instead, make sure that all callers log properly.
* resolved: never attempt to resolve loopback addresses via DNS/LLMNR/mDNSLennart Poettering2017-03-14
| | | | | We already refuse to resolve "localhost", hence we should also refuse resolving "127.0.0.1" and friends.
* networkd: vxlan add support for GBPSusant Sahani2017-03-14
| | | | | | | This patch add support for vxlan VXLAN Group Policy Option. https://tools.ietf.org/html/draft-smith-vxlan-group-policy-00 http://lwn.net/Articles/628683/
* sd-netlink: introduce api for new NL type NLA_FLAGSusant Sahani2017-03-14
|
* sd-netlink: add support for new type NETLINK_TYPE_FLAGSusant Sahani2017-03-14
| | | | | | | | NETLINK_TYPE_FLAG is NLA_FLAG. This new type will be used in NLA_FLAG for example IFLA_VXLAN_GBP and IFLA_VXLAN_REMCSUM_NOPARTIAL
* sd-netlink: add support for vxlan attributesSusant Sahani2017-03-14
|
* sd-bus: fix marshaling of unary typeDavid Herrmann2017-03-14
| | | | | The unary type has a fixed size of 1 in gvariant. Make sure we properly encode it as such. Right now, we encode/decode it as empty sequence.
* sd-bus: drop redundant codeDavid Herrmann2017-03-14
| | | | | | | If c->item_size is 0, the next item to parse in a structure is empty. However, this also implies that the signature must be empty. The latter case is already handled just fine by enter_struct_or_dict_entry() so there is no reason to handle the same case in the caller.
* sd-bus: don't assert() on valid signaturesDavid Herrmann2017-03-14
| | | | | | | Right now sd_bus_message_skip() will abort execution if passed a signature of the unary type "()". Regardless whether this should be supported or not, we really must not abort. Drop the incorrect assertion and add a test-case for this.
* sd-netlink: Add macvtap supportSusant Sahani2017-03-14
|
* netlink-types: use consistent whitespace at EOLZbigniew Jędrzejewski-Szmek2017-03-14
| | | | Follow up for v222-124-g79e27dbcb1.
* sd-bus: remove _VTABLE from new method vtable initialiserdaurnimator2017-03-14
|
* sd-bus: add 'offset' member for vtable methodsdaurnimator2017-03-14
| | | | | Defaults to zero, which retains the current behaviour. Fixes #577
* sd-bus: don't treat KDBUS_ITEM_TIMESTAMP as unknown itemDavid Herrmann2017-03-14
| | | | | | In bus_kernel_translate_message(), we print a DEBUG message on unknown items. But right now, we also print this message for KDBUS_ITEM_TIMESTAMP despite parsing it properly. Fix this!
* treewide: fix typosTorstein Husebø2017-03-14
|
* resolved: rr - ignore pseudo types in NSEC(3) bitmapsTom Gundersen2017-03-14
|
* sd-netlink: add bridge NL paramsSusant Sahani2017-03-14
|
* sd-netlink: add tunnel paramsSusant Sahani2017-03-14
|
* sd-bus: fix path of object-manager signalsDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | | | | | Each signal of the ObjectManager interface carries the path of the object in question as an argument. Therefore, a caller will deduce the object this signal is generated for, by parsing the _argument_. A caller will *not* use the object-path of the message itself (i.e., message->path). This is done on purpose, so the caller can rely on message->path to be the path of the actual object-manager that generated this signal, instead of the path of the object that triggered this signal. This commit fixes all InterfacesAdded/Removed signals to use the path of the closest object-manager as message->path. 'closest' in this case means closest parent with at least one object-manager registered. This fix raises the question what happens if we stack object-managers in a hierarchy. Two implementations are possible: First, we report each object only on the nearest object-manager. Second, we report it on each parent object-manager. This patch chooses the former. This is compatible with other existing ObjectManager implementations, which are required to call GetManagedObjects() recursively on each object they find, which implements the ObjectManager interface.
* logind: fix write_string_file() falloutDaniel Mack2017-03-14
| | | | | | | | WRITE_STRING_FILE_ATOMIC is only valid if WRITE_STRING_FILE_CREATE is also given. IOW, an atomic file write operation is only possible when creating a file is also being asked for. This is a regression from the recent write_string_file() rework.
* shared: dns-name - introduce dns_label_unescape_suffix()Tom Gundersen2017-03-14
| | | | | | | | | | Intended to be called repeatedly, and returns then successive unescaped labels from the most to the least significant (left to right). This is slightly inefficient as it scans the string three times (two would be sufficient): once to find the end of the string, once to find the beginning of each label and lastly once to do the actual unescaping. The latter two could be done in one go, but that seemed unnecessarily convoluted.
* shared: dns-name - use the canonical dns name orderingTom Gundersen2017-03-14
| | | | | | The canonical DNS name ordering considers the rightmost label the most significant, we were considering it the least significant. This is important when implementing NSEC, which relies on the correct order.
* sd-netlink: add tunnel NL parametersSusant Sahani2017-03-14
|
* shared: dns-name - add dns_name_between()Tom Gundersen2017-03-14
| | | | | | | Given three DNS names this function indicates if the second argument lies strictly between the first and the third according to the canonical DNS name order. Note that the order is circular, so the last name is considered to be before the first.
* logind: never select closing sessions for a VTDavid Herrmann2017-03-14
| | | | | | | 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.
* logind: prefer new sessions over older ones on VT switchesDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | 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.
* networkd: move config_parse_vxlan_group_addressSusant Sahani2017-03-14
| | | | | move config_parse_vxlan_group_address from networkd.h to networkd-netdev-vxlan.h
* bus-proxy: never pass on unmatched broadcastsDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | The lovely libvirtd goes into crazy mode if it receives broadcasts that it didn't subscribe to. With bus-proxyd, this might happen in 2 cases: 1) The kernel passes us an unmatched signal due to a false-positive bloom-match. 2) We generate NameOwnerChanged/NameAcquired/NameLost locally even though the peer didn't subscribe to it. dbus-daemon is reliable in what signals it passes on. So make sure we follow that style. Never ever send a signal to a local peer if it doesn't match an installed filter of that peer.
* sd-bus: fix invalid stack access on test-bus-marshalDavid Herrmann2017-03-14
| | | | | Make sure we actually parse "unsigned long long" if we encode a uint64_t. Otherwise, we will get random data from the stack.
* sd-bus: properly match ID changesDavid Herrmann2017-03-14
| | | | | | | | | 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.
* sd-bus: destination-matches cannot match NameOwnerChangedDavid Herrmann2017-03-14
| | | | | | | | | | 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.
* sd-bus: fix gvariant structure encodingDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* sd-bus: fix object tree to be deeper than 2 levelsDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | 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.
* sd-device: never return NULL+0David Herrmann2017-03-14
| | | | | | | | | | | 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.
* networkd: tap add support for vnet_hdrSusant Sahani2017-03-14
| | | | | | | 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.
* logind: bring bus policy up-to-dateLennart Poettering2017-03-14
| | | | | | | | | | | | | A while back we opened up all of logind's bus calls to unprivileged users, via PK. However, the dbus1 policy wasn't updated accordingly. With this change, the dbus1 policy is opened up for all bus calls that should be available to unprivileged clients. (also rearranges some calls in the vtable, to make more sense, and be in line with the order in the bus policy file) Fixes #471.