Commit graph

6305 commits

Author SHA1 Message Date
Lennart Poettering 4e6a9570b6 bus: fix return message if StartServiceByName() in the driver fails due
to non-existing service
2013-12-24 18:42:38 +01:00
Lennart Poettering 56e61788c5 busctl: show service/session a name belongs to in the list of names
Also, don't show machine name by default as this might cause timeouts on
non-responding peers.
2013-12-24 18:15:38 +01:00
Lennart Poettering 9f6445e34a log: log_error() and friends add a newline after each line anyway, so avoid including it in the log strings 2013-12-24 16:39:37 +01:00
Lennart Poettering ae98841e63 util: don't accept an empty peer label as valid 2013-12-24 16:21:59 +01:00
Lennart Poettering 2dc9970bed bus: only accept kdbus creds if they are valid
This allows userspace to fake kdbus creds via struct ucred in the proxy,
without making the recieving side choke on the missing fields of the
kdbus struct, more precisel pid_starttime and tid
2013-12-24 16:20:47 +01:00
Lennart Poettering eff0527098 util: unify SO_PEERCRED/SO_PEERSEC invocations
Introduce new call getpeercred() which internally just uses SO_PEERCRED
but checks if the returned data is actually useful due to namespace
quirks.
2013-12-24 15:53:04 +01:00
Lennart Poettering 96415cad2f bus: fix hello ioctl buffer size calculation 2013-12-24 15:38:30 +01:00
Lennart Poettering aedd330b13 bus: make gcc shut up 2013-12-24 15:33:02 +01:00
Lennart Poettering 8a0e0ed9dd bus: fake client side creds in the proxy to the caller's creds 2013-12-24 15:27:59 +01:00
Lennart Poettering 3798fd4c30 bus: allow peeking signatures recusively inside of containers
Previously we invalidated the peeked signature as soon as the caller
would recurse into a container, making stack based handling difficult.
With this change we will keep the peeked signature around until the user
advances to the next field.
2013-12-24 03:02:49 +01:00
Lennart Poettering 8f19720dd2 bus: fix assert when serializing fixed size struct to gvariant 2013-12-23 23:48:30 +01:00
Lennart Poettering 85feb8e4d9 bus: don't attach KDBUS_ITEM_ID to match ioctl() if we don't need it 2013-12-23 22:32:33 +01:00
Lennart Poettering d711a95778 bus: fix sender match creation on kdbus 2013-12-23 21:55:27 +01:00
Lennart Poettering 3022d74ba5 sd-event: make sd_event_add_signal() fail with EBUSY if signal is not blocked 2013-12-23 21:44:20 +01:00
Lennart Poettering be04cbca6c core: when we close the notify fd, we also need to free its event source 2013-12-23 21:01:32 +01:00
Lennart Poettering f98a58fe89 sd-event: fix return code of sd_event_run() 2013-12-23 20:25:57 +01:00
Lennart Poettering 6261f11fc3 machinectl: fix success check when getting pty from within container 2013-12-23 20:25:57 +01:00
Kay Sievers 94a6ce5b7c bus-proxyd: init cleanup variable 2013-12-23 19:16:49 +01:00
Kay Sievers 98531b5762 bus: update kdbus.h 2013-12-23 19:15:33 +01:00
Lennart Poettering fbadf04511 bus: when getting a kdbus connection into a container wait first for child, then read message
There's no EOF generated for AF_UNIX/SOCK_DGRAM sockets, hence let's
wait for the child first to see if it succeeded, only then read the socket.
2013-12-23 19:10:11 +01:00
Lennart Poettering e7f7a1b022 bus: when we are connected to a bus, then do not assume peer creds are useful as message creds 2013-12-23 18:56:37 +01:00
Lennart Poettering 02bb6cda87 util: when we try to read /proc/cmdline in a container, read /proc/1/cmdline instead 2013-12-23 18:13:12 +01:00
Lennart Poettering b8d0ffc21f log: als turn on debug logging in non-PID1 if /proc/cmdline contains "debug" 2013-12-23 17:56:44 +01:00
Lennart Poettering 46525bfc02 bus: make sure sd_bus_emit_properties_changed_strv() doesn't return ENOENT if no properties with a change flag are in the interface 2013-12-23 17:30:21 +01:00
Lennart Poettering dc74ce9b4a bus: write debug message when we get a method call we cannot handle 2013-12-23 17:18:30 +01:00
Zbigniew Jędrzejewski-Szmek 6096dfd616 delta: if prefix is specified, only show overrides there
systemd-delta /run/systemd/system will show all unit overrides
in /run, etc.
2013-12-22 22:54:15 -05:00
Zbigniew Jędrzejewski-Szmek f939e9a47c delta: fix delta for drop-ins
Also, fix highlighting, add more debug statements, make const tables
static and global, run path_kill_slashes only at entry.
2013-12-22 22:53:56 -05:00
Lennart Poettering 8f04d2ebba bus: make sure to request peer cred only after connect(), not before 2013-12-23 04:20:55 +01:00
Lennart Poettering cd789fdf45 bus: always talk to the full dbus driver object 2013-12-23 04:20:55 +01:00
Lennart Poettering a7639e37af bus-proxyd: synthesize NameAcquire/NameLost signals for socket clients 2013-12-23 04:20:55 +01:00
Lennart Poettering dff91e8b7f bus: use memcpy() rather than unbounded strcpy() 2013-12-23 04:20:55 +01:00
Lennart Poettering b67f541f13 bus: switch kdbus bloom filter over to SipHash (from MurmurHash3)
Let's try to standardize on a single non-cryptographic hash algorithm,
and for that SipHash appears to be the best answer.

With this change there are two other hash functions left in systemd: an
older version of MurmurHash embedded into libudev for the bloom filters
in udev messages (which is hard to update, given that the we probably
should stay compatible with older versions of the library). And lookup3
in the journal files (which we could replace for new files, but which is
probably not worth the work).
2013-12-23 04:20:55 +01:00
Kay Sievers 57d0e6b273 libudev: ship the original MurmurHash2.[ch] file 2013-12-23 02:55:06 +01:00
Mantas Mikulėnas 91d53e2b89 loginctl: fix output of type with class 2013-12-22 19:12:57 -05:00
Zbigniew Jędrzejewski-Szmek d4fffc4b8b Fix extraction of _SYSTEMD_USER_UNIT
Units from user services underneath user@.service would not be detected
properly.
2013-12-22 18:55:01 -05:00
Zbigniew Jędrzejewski-Szmek 58684be9a7 systemctl: also color filenames of drop-ins in cat 2013-12-22 18:55:01 -05:00
Lennart Poettering 09812eb764 sd-daemon: introduce sd_watchdog_enabled() for parsing $WATCHDOG_USEC
Also, introduce a new environment variable named $WATCHDOG_PID which
cotnains the PID of the process that is supposed to send the keep-alive
events. This is similar how $LISTEN_FDS and $LISTEN_PID work together,
and protects against confusing processes further down the process tree
due to inherited environment.
2013-12-22 22:19:03 +01:00
Lennart Poettering 565a9388f2 journal: when we shall go down do so cleanly 2013-12-22 21:12:25 +01:00
Lennart Poettering 9bf3b53533 shared: switch our hash table implementation over to SipHash
SipHash appears to be the new gold standard for hashing smaller strings
for hashtables these days, so let's make use of it.
2013-12-22 21:12:25 +01:00
Lennart Poettering 14f862a508 bus: also take write queue into consideration in sd_bus_try_close() 2013-12-22 21:11:03 +01:00
Lennart Poettering 610f780cd6 core: the cgroup properties are not actually const 2013-12-22 21:11:03 +01:00
Kay Sievers f72a3e5bad Revert "bus-proxyd: use a loop instead of c&p"
This reverts commit 9818fa6d6d.

The proxy does not work anymore with this patch.
2013-12-22 16:41:24 +01:00
Tom Gundersen 23f30ed312 libsystemd-dhcp: add some asserts 2013-12-22 14:42:12 +01:00
Patrik Flykt 3dd7140035 libsystemd-dhcp: Handle T2 Rebinding timeout
Reuse existing functionality when adding T2 Rebinding support.
2013-12-22 14:37:53 +01:00
Patrik Flykt 6a1cd41ef0 libsystemd-dhcp: Factor out common code initializing events
Factor out common code from timeout T1 handling and starting of
the DHCP client.
2013-12-22 14:37:53 +01:00
Patrik Flykt aba26854e5 libsystemd-dhcp: Handle T1 Renewing timeout
Expiration of T1 timeout takes the client to the Rebinding state,
where it attempts to renew its lease. Start by opening a DCHP unicast
socket as there now is a proper IP address set.

Compute the resend timer as half of the remaining time down to a
minimum of 60 seconds (RFC2131). Modify DHCP Request sending to send
only UDP DHCP data when unicasting. Also modify DHCP Ack/Nak
receiving such that the client_receive_ack() takes care of using
either the full IP, UDP, DHCP packet or only the DHCP payload
depending whether the client is in Requesting or Renewing state.
Finally always report DHCP_EVENT_IP_ACQUIRE from Requesting state
and only DHCP_EVENT_IP_CHANGE if the IP address was modified when
the lease was renewed.
2013-12-22 14:37:53 +01:00
Patrik Flykt 234fc2dfce libsystemd-dhcp: Add functions for sending unicast UDP messages
Create a helper functions setting up an unicast DHCP UDP socket and
sending data. Add function stubs for the test program.

[tomegun: initialize structs when allocating, and drop unneccesary 'err']
2013-12-22 14:37:49 +01:00
Patrik Flykt 2fba7b03b5 libsystemd-dhcp: Check test result without casting value 2013-12-22 14:28:00 +01:00
Patrik Flykt 0c6a3c888a libsystemd-dhcp: Fix checksum computation for buffer with odd size
Fix off-by-one error and notice that summing may need more than one
round for the result to be in the lower 16 bits.
2013-12-22 14:28:00 +01:00
Patrik Flykt 77e8d29dd2 libsystemd-dhcp: Fix receiving of other message when expecting Ack
When a DHCP Nak is received, return a DHCP_EVENT_NO_LEASE event. If
some other DHCP message is received or an error happens when parsing
options, return -ENOMSG in order to ignore the packet. There may be
more than one server serving the same subnet, each server will send
its Offer to the client.
2013-12-22 14:28:00 +01:00