Commit graph

11863 commits

Author SHA1 Message Date
Tom Gundersen 8300ba218e resolved: pin the server used in a transaction
We want to discover information about the server and use that in when crafting
packets to be resent.
2015-07-14 18:50:53 +02:00
Tom Gundersen 91b14d6ff3 resolved: reference count the dns servers
We want to reference the servers from their active transactions, so make sure
they stay around as long as the transaction does.
2015-07-14 12:03:04 +02:00
Tom Gundersen a0166609f7 resolved: packet - ensure there is space for IP+UDP headers
Currently we only make sure our links can handle the size of the payload witohut
taking the headers into account.
2015-07-14 12:03:04 +02:00
Daniel Mack 818ef443f0 resolved: make LLMNR checks conditional
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-13 11:28:30 -04:00
Daniel Mack 8b757a3861 resolved: separate LLMNR specific header bits
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-13 11:28:29 -04:00
Daniel Mack 22a37591ed resolved: use a #define for LLMNR port
De-duplicate some magic numbers.
2015-07-13 11:28:29 -04:00
Daniel Mack 5f402ae84b resolved: move LLMNR related functions into separate file 2015-07-13 11:28:29 -04:00
Beniamino Galvani e43a8393ea dhcp: add support for vendor specific DHCP option
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-12 14:26:32 -04:00
Tom Gundersen 13a5d76b32 basic: util - add base64mem() function similar to hexmem()
This implements RFC4648 for a slightly more compact representation of
binary data compared to hex (6 bits per character rather than 4).
2015-07-12 19:24:14 +02:00
Tom Gundersen 30494563f2 basic: util - fix errorhandling in unhexmem()
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-12 19:11:34 +02:00
Tom Gundersen 39fced0162 Merge pull request #558 from poettering/logind-bus-policy
logind: bring bus policy up-to-date
2015-07-12 11:44:45 +02:00
Lennart Poettering 6b62bbbc7b logind: some firmware implementations remove OsIndications if it is unset
We shouldn't fall over that, and just assume it is 0 in this case.

Fixes #499.
2015-07-11 17:32:25 -03:00
Lennart Poettering 559b5cc273 logind: bring bus policy up-to-date
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.
2015-07-11 17:03:42 -03:00
Daniel Mack 6f9d58d87f Merge pull request #551 from poettering/fopen-temporary-noerrno
util: make sure we don't clobber errno in error path
2015-07-11 13:35:50 -04:00
Daniel Mack 0dc705bee2 Merge pull request #552 from poettering/path-is-mount-point-simplification
basic: simplify path_is_mount_point() a bit
2015-07-11 13:35:24 -04:00
Lennart Poettering 10c03e9e82 basic: simplify path_is_mount_point() a bit
This removes two uses of the ternary operator.
2015-07-11 14:20:44 -03:00
Lennart Poettering 64ee7ab462 util: make sure we don't clobber errno in error path 2015-07-11 14:19:36 -03:00
Daniel Mack f2db89c99c Merge pull request #548 from vcaputo/fix_path_state_debug_msg
core: include unit in path state transition debug logging.
2015-07-10 20:42:32 -04:00
Vito Caputo 3541bf1f07 core: include unit in path state transition debug logging. 2015-07-10 16:40:46 -07:00
David Herrmann e6494a07cb logind: rename 'pos' to 'position'
Spell out the proper name. Use 'pos' over 'position', and also update the
logind state file to do the same. Note that this breaks live updates.
However, we only save 'POSITION' on non-seat0, so this shouldn't bother
anyone for real. If you run multi-seat setups, you better restart a
machine on updates, anyway.
2015-07-10 15:25:44 +02:00
David Herrmann cc85d56245 logind: allow greeters to take over VTs
Make sure a greeter can forcefully spawn a session on a VT that is
in-use. A recent patch prevented this (this used to be possible for all
session types) as it is highly fragile. However, as it turns out,
greeters seem to rely on that feature. Therefore, make sure we allow it
explicitly for greeters.
2015-07-10 15:25:43 +02:00
Lennart Poettering 43694a8cc7 Merge pull request #531 from dvdhrm/boot-buildid
boot: use BUILD_ID if VERSION_ID is not available
2015-07-09 11:50:03 -03:00
Lennart Poettering 0aa7a4c225 Merge pull request #532 from dvdhrm/bus-managed-root
sd-bus: include queried path in GetManagedObjects
2015-07-09 11:47:55 -03:00
cee1 ac5213569c basic/util.c fopen_temporary(): close fd if failed 2015-07-09 10:41:23 -04:00
Lennart Poettering d711ea2b95 Merge pull request #529 from dvdhrm/bus-slot-description
sd-bus: sd_bus_slot_get_description() should return const strings
2015-07-09 11:38:11 -03:00
David Herrmann 92d16a53e3 sd-bus: include queried path in GetManagedObjects
If GetManagedObjects is called on /foo/bar, then it should also include
the object /foo/bar, if it exists. Right now, we only include objects
underneath /foo/bar/.

This follows the behavior of existing dbus implementations.

Obsoletes #527 and fixes #525. Reported by: Nathaniel McCallum
2015-07-09 13:30:16 +02:00
David Herrmann 59658d1958 boot: use BUILD_ID if VERSION_ID is not present
According to os-release(5), VERSION_ID is not mandatory and BUILD_ID only
needs to be unique underneath VERSION_ID. Therefore, assuming a missing
VERSION_ID field means 'empty', we can rely on BUILD_ID to be unique.

Use BUILD_ID if VERSION_ID is not present. This way, rolling-release
distros can still provide a proper os-release entry without crafting
random VERSION_ID strings.

This fixes #186.
2015-07-09 13:07:27 +02:00
David Herrmann d8c64b7f90 boot: fix memleaks in os-release parser
There is no guarantee that the os-release section contains each key only
once, nor any guarantee that all keys are present. Make sure we properly
free memory in both cases.

Not that it matters much, as we're short-living, anyway. But correct code
is always nicer to read..
2015-07-09 13:02:54 +02:00
David Herrmann 839b6dbba9 sd-bus: sd_bus_slot_get_description() should return const strings
All other *_get_description() functions use 'const char**', so make sure
sd_bus_slot_get_description() does the same.

This changes API, but ABI stays stable. I think this is fine, but I
wouldn't mind bumping SONAME.

Reported in #528.
2015-07-09 10:44:04 +02:00
Thomas Blume 06af2a04fb Reload manager defaults at daemon-reload
"systemctl daemon-reload" should also update the manager defaults from
/etc/systemd/system.conf.
For details, see:
http://lists.freedesktop.org/archives/systemd-devel/2015-June/033062.html

Amended to use  manager_set_defaults() as common function.
2015-07-09 10:22:30 +02:00
Thomas Hindoe Paaboel Andersen 207dffe2ff machine: remove unused variables 2015-07-08 23:46:47 +02:00
Lennart Poettering 593b07d25d Merge pull request #516 from utezduyar/consistent-get-callback-return
property callback returns are consistent
2015-07-08 17:24:20 -03:00
Lennart Poettering 1434eb3838 Merge pull request #500 from zonque/fileio
fileio: consolidate write_string_file*()
2015-07-08 17:13:53 -03:00
Lennart Poettering 74d8a0d4b2 Merge pull request #514 from teg/resolved-rrsig-marshal
resolved: fix marshalling of RRSIG records
2015-07-08 13:00:20 -03:00
Tom Gundersen 1161d5d28b Merge pull request #510 from zonque/journal-gatewayd
journal-gatewayd: fix tmpfile logic
2015-07-08 16:16:44 +02:00
Daniel Mack b9fd7bb60a Merge pull request #501 from keszybz/remove-python-systemd
Remove python-systemd
2015-07-08 09:38:38 -04:00
Umut Tezduyar Lindskog 0f82610153 property callback returns are consistent
It is no different to return 0 over 1 in the property
callback. It is confusing to return 1 which made me think
1 has a special purpose. This way code is consistent with
the rest of the tree.
2015-07-08 14:37:25 +02:00
Tom Gundersen 0b1b17d325 resolved: fix marshalling of RRSIG records
The key tag is 16, not 8 bits.
2015-07-08 13:53:39 +02:00
Daniel Mack 9e19c04f3a journal-gatewayd: fix tmpfile logic
"rw" is not a valid mode string for f*open(). This got broken in
cc02a7b330 ("journal-gatewayd: factor out opening of temp
file").
2015-07-07 17:21:27 -04:00
David Herrmann b80120c4cb logind: fail on CreateSession if already in session
Right now, if you're already in a session and call CreateSession, we
return information about the current session of yours. This is highy
confusing and a nasty hack. Avoid that, and instead return a commonly
known error, so the caller can detect that.

This has the side-effect, that we no longer override XDG_VTNR and XDG_SEAT
in pam_systemd, if you're already in a session. But this sounds like the
right thing to do, anyway.
2015-07-07 19:38:41 +02:00
David Herrmann 586cd08e1b logind: allow sessions to share a VT if it's a greeter
Old gdm and lightdm start the user-session during login before they
destroy the greeter-session. Therefore, the user-session will take over
the VT from the greeter. We recently prevented this by never allowing
multiple sessions on the same VT. Fix this now, by explicitly allowing
this if the owning session is a GREETER.

Note that gdm no longer behaves like this. Instead, due to wayland, they
always use a different VT for each session. All other login-managers are
highly encouraged to destroy the greeter-session _before_ starting the
user-session. We now work around this, but this will probably not last
forever (and will already have nasty side-effects on the greeter-session).
2015-07-07 19:13:52 +02:00
Zbigniew Jędrzejewski-Szmek af86c44038 Remove repeated 'the's 2015-07-07 07:40:53 -04:00
Daniel Mack 7e59232f31 Merge pull request #502 from keszybz/login-small-cleanup
Login small cleanup
2015-07-06 20:45:17 -04:00
Zbigniew Jędrzejewski-Szmek 2799e519ca Remove python-systemd
python-system has moved to it's own repository:
https://github.com/systemd/python-systemd
2015-07-06 20:32:12 -04:00
Zbigniew Jędrzejewski-Szmek fc08079ef2 treewide: fix typos of let's 2015-07-06 20:09:54 -04:00
Zbigniew Jędrzejewski-Szmek 5549398216 login: use normal comparison to zero for integers
! is supposed to be used for booleans and pointers.
2015-07-06 20:04:53 -04:00
Daniel Mack ad118bda15 tree-wide: fix write_string_file() user that should not create files
The latest consolidation cleanup of write_string_file() revealed some users
of that helper which should have used write_string_file_no_create() in the
past but didn't. Basically, all existing users that write to files in /sys
and /proc should not expect to write to a file which is not yet existant.
2015-07-06 19:27:20 -04:00
Daniel Mack 4c1fc3e404 fileio: consolidate write_string_file*()
Merge write_string_file(), write_string_file_no_create() and
write_string_file_atomic() into write_string_file() and provide a flags mask
that allows combinations of atomic writing, newline appending and automatic
file creation. Change all users accordingly.
2015-07-06 19:19:25 -04:00
Daniel Mack 40beecdb6d fileio: add 'enforce_newline' argument to write_string_stream()
Add a flag to control whether write_string_stream() should always enforce a
trailing newline character in the file.
2015-07-06 17:31:44 -04:00
Kay Sievers de8763b6d2 get_process_environ: exit early when there is nothing to read 2015-07-06 23:02:47 +02:00