1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 19:21:53 +03:00
Commit Graph

16726 Commits

Author SHA1 Message Date
David Herrmann
23972f4244 memfd: map unsealed files as MAP_SHARED
We need to map sealed files as MAP_PRIVATE so far as the kernel treats
MAP_SHARED as writable mapping (you can run mprotect(PROT_WRITE) at any
time on those). However, unsealed files must be mapped as MAP_SHARED.
Otherwise, we never end up writing to the real file.
2014-08-18 13:05:48 +02:00
David Herrmann
c7dab73a5f memfd: disallow importing memfds without sealing
We use memfds for sealing. Lets not bother with memfds created without
MFD_ALLOW_SEALING for now. They're equivalent to random shmem files, so
don't bother treating them as sealable memfds.
2014-08-18 13:03:09 +02:00
David Herrmann
302e4b4963 memfd: don't open kdbus for memfd
No reason to open /dev/kdbus/control if we want memfds. memfd_create() is
always available.
2014-08-18 12:57:55 +02:00
David Herrmann
7e2ce386ca memfd: internalize header
Fix the memfd.h header to use handy features like #pragma, cleanup-funcs
and util.h. Also drop the EXTERN-C macros.
2014-08-18 12:57:03 +02:00
Daniel Mack
4632777024 memfd: fix memfd_create() syscall wrapper
Unlike earlier versions, the syscall only takes 2 arguments in its
final version, not 3.
2014-08-18 12:37:22 +02:00
Daniel Mack
43bde981cc memfd: move code from public library to src/shared
Don't expose generic kernel API via libsystemd, but keep the code internal
for our own usage.
2014-08-18 12:37:20 +02:00
Daniel Mack
93bd9b2ecf Makefile.am: test-bus-memfd went away. Kill its residues in Makefile.am 2014-08-18 12:37:19 +02:00
Daniel Mack
a6082d778e kdbus: switch over to generic memfd implementation (ABI+API break) 2014-08-17 21:47:00 +02:00
Thomas Hindoe Paaboel Andersen
a6a4f52889 networkctl: use safe_qsort in case no links are present
Unlikely to happen but still...
2014-08-16 23:49:36 +02:00
Thomas Hindoe Paaboel Andersen
f1e3bee216 sd-bus,log: remove unused variables 2014-08-16 00:32:21 +02:00
Tom Gundersen
050f74f286 sd-event: return 'r' rather than '-errno' 2014-08-15 20:32:27 +02:00
Lennart Poettering
b5af2aca12 Merge commit 'b39a2770ba55637da80e2e389222c59dbea73507' 2014-08-15 20:25:10 +02:00
Tom Gundersen
e07bbb7c50 sd-event: fix missing needs_rearm 2014-08-15 20:20:38 +02:00
Lennart Poettering
def9a7aa01 sd-bus: add API to check if a client has privileges
This is a generalization of the vtable privilege check we already have,
but exported, and hence useful when preparing for a polkit change.

This will deal with the complexity that on dbus1 one cannot trust the
capability field we retrieve via the bus, since it is read via
/proc/$$/stat (and thus might be out-of-date) rather than directly from
the message (like on kdbus) or bus connection (as for uid creds on
dbus1).

Also, port over all code to this new API.
2014-08-15 20:08:51 +02:00
Lennart Poettering
4311fa08fe update TODO 2014-08-15 18:29:21 +02:00
Lennart Poettering
1aeab12b19 cgroup: only generate warnings if actually writing to cgroup attributes failed 2014-08-15 18:14:37 +02:00
Lennart Poettering
1de1c9c37b main,log: parse the log related kernel command line parameters at one place only, and for all tools
Previously, we ended up parsing some of them three times: in main.c when
processing the kernel cmdline, in main.c when processing the process
cmdline (only for containers), and in log.c again.

Let's streamline this, and only parse them in log.c

In PID 1 also make sure we parse "quiet" first, and then override this
with the more specific checks in log.c
2014-08-15 18:07:36 +02:00
Lennart Poettering
56d96fc00c main: minor code modernization for initializing the console 2014-08-15 18:06:07 +02:00
Lennart Poettering
563b1bdc09 update TODO 2014-08-15 18:01:30 +02:00
Lennart Poettering
41414fed51 hostnamectl: actually implement location support 2014-08-15 17:06:30 +02:00
David Herrmann
bf32f99f65 resolve: fix compilation on LLVM+clang
LLVM+clang does not allow statement-expressions inside of
type-declarations (file-scope). Use CONST_MAX() to avoid this.
2014-08-15 16:59:09 +02:00
David Herrmann
7242d7420b macro: add CONST_MAX() macro
The CONST_MAX() macro is similar to MAX(), but verifies that both
arguments have the same type and are constant expressions. Furthermore,
the result of CONST_MAX() is again a constant-expression.

CONST_MAX() avoids any statement-expressions and other non-trivial
expression-types. This avoids rather arbitrary restrictions in both GCC
and LLVM, which both either fail with statement-expressions inside
type-declarations or statement-expressions inside static-const
initializations.

If anybody knows how to circumvent this, please feel free to unify
CONST_MAX() and MAX().
2014-08-15 16:59:09 +02:00
David Herrmann
fdcba430ae macro: const'ify MIN/MAX/... macros
We must add 'const' to local variables in statement-expressions to
guarantee that the macros can produce constant-expressions if given such.
GCC seems to ignore this, but LLVM/clang requires it (understandably).
2014-08-15 16:59:09 +02:00
Lennart Poettering
4de120ee44 resolved: fix assertion when joining llmnr mcast group 2014-08-15 16:42:14 +02:00
Lennart Poettering
40274ed623 networkd: print nice warnings if people configure invalid domain names 2014-08-15 16:21:19 +02:00
Lennart Poettering
a0627f82e2 util: make is_localhost() check for 'localdomain' too, so that we can use it for both validating domains and host names 2014-08-15 16:04:46 +02:00
Lennart Poettering
486d1a8148 networkd: fix minor memory leak 2014-08-15 16:02:42 +02:00
Lennart Poettering
c627729fc4 networkctl: show acquired system domains 2014-08-15 16:02:29 +02:00
Lennart Poettering
8612e93653 sd-network: add system-wide sd_network_get_domains() API 2014-08-15 16:02:14 +02:00
Lennart Poettering
d5314fff96 networkd: always write out locally configured settings first, dhcp-acquired ones later
This is primarily important for the domains list, as we really should
prefer the locally configured domain over the dhcp supplied ones when we
use it as a search list.
2014-08-15 15:42:56 +02:00
Lennart Poettering
f15b6e5a8b networkd: remove "*" from domains list
Also, simplify things a bit and make sure we don't forget looking at one
of the entries.
2014-08-15 15:36:17 +02:00
Lennart Poettering
1405434b69 networkctl: two OOM fixes 2014-08-15 15:34:56 +02:00
Lennart Poettering
31d2e1961a sd-nework: be more careful with error codes, return ENODATA if you lack information 2014-08-15 15:34:33 +02:00
Tom Gundersen
67272d157a sd-network: add support for wildcard domains 2014-08-15 15:15:24 +02:00
Tom Gundersen
6192b846ca networkd: add support for Domains= to .network files
This allows the search/routing domanis to be specified per link/network and be passed
on to resolved.
2014-08-15 15:15:24 +02:00
Harald Hoyer
2f3a215f61 kernel-install/90-loaderentry.install: fixed cmdline parsing
If /etc/kernel/cmdline is missing or empty, we read /proc/cmdline and
want to filter out the initrd line. Due to a bug, the whole contents was
filtered out.
2014-08-15 14:41:50 +02:00
Stef Walter
b39a2770ba core: Rename Job.subscribed field to Job.clients
This reflects how this field will be used, to not only track where
to send signals, but also which callers (other than root) are allowed
to call DBus methods on the Job.
2014-08-15 14:07:07 +02:00
Stef Walter
2ea31e5b13 core: Common code for DBus methods that Cancel a job
Both ofs.Job.Cancel() and ofs.Manager.CancelJob() now use same
implementation. So we can add caller verify logic appropriately.
2014-08-15 14:07:07 +02:00
Stef Walter
36e34057a2 sd-bus: Remove bus arg from bus_verify_polkit_async_registry_free()
It's unneccessary, not used, and complicates callers of the
function.
2014-08-15 14:07:07 +02:00
David Herrmann
926446f4aa test: fix strtod test for real
The "0,5" syntax was actually right. The real problem is, the test should
only run if the local system has the de_DE.UTF-8 locale. Therefore, skip
the tests if setlocale() fails. This is kinda ugly, as it is done
silently, but we cannot skip partial tests with the current
infrastructure. Should be fine this way.
2014-08-15 13:25:15 +02:00
Lennart Poettering
db73295acc util: never use ether_ntoa(), since it formats with %x, not %02x, which makes ethernet addresses look funny 2014-08-15 13:19:03 +02:00
Lennart Poettering
c22bf27bee unit: remove spurious newline 2014-08-15 13:19:03 +02:00
Lennart Poettering
3e3db0ee86 networkctl: increase column width for link type to 18, to accomodate for 'ieee80211_radiotap' 2014-08-15 13:19:03 +02:00
Tom Gundersen
ad0734e890 networkd: rename UseDomainName to UseDomains
This option will also apply to the search domains, so make it plural.
2014-08-15 12:53:34 +02:00
Lennart Poettering
1836bf9e1d sysctl: always write net.ipv4.conf.all.xyz= in addition to net.ipv4.conf.default.xyz=
Otherwise we have a boot-time race, where interfaces that popped up
after the sysctl service would get the settings applied, but all others
wouldn't.
2014-08-15 12:07:33 +02:00
Lennart Poettering
6b2f67b31c cgroup: downgrade log messages about non-existant cgroup attributes to LOG_DEBUG 2014-08-15 11:57:07 +02:00
Lennart Poettering
70c949a42b cgroup: never try to create files in cgroupfs, only open them for writing
This should have the benefit that cg_set_attribute() returns ENOENT
instead of EACCESS when we use it for non-existing attributes.
2014-08-15 11:57:07 +02:00
David Herrmann
ce049dcda4 test: fix strtod() test
One strtod() test is broken since:

commit 8e21100002
Author: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date:   Mon Aug 4 23:13:31 2014 +0200

    test: use fabs on doubles

The commit was right, so no reason to revert it, but the test was broken
before and only worked by coincidence. Convert "0,5" to "0.5" so we don't
depend on locales for double conversion (or well, we depend on "C" which
seems reasonable).
2014-08-15 10:44:43 +02:00
Lennart Poettering
2301cb9fdb networkctl: print local domain name in status output 2014-08-15 03:10:20 +02:00
Lennart Poettering
708281b811 dhcp: the localhost isn't valid as hostname either 2014-08-15 03:10:20 +02:00