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

16697 Commits

Author SHA1 Message Date
Ronny Chevalier
ece74070c7 bootchart: use NSEC_PER_SEC 2014-08-18 21:02:04 +02:00
Denis Kenzior
fe3f22d116 bus-control: Fix cgroup handling
On systems without properly setup systemd, cg_get_root_path returns
-ENOENT.  This means that busctl doesn't display much information.

busctl monitor also fails whenever it intercepts messages.

This fix fakes creates a fake "/" root cgroup which lets busctl work
on such systems.
2014-08-18 21:01:57 +02:00
Lennart Poettering
a1d4404f9a man: mention that "units" are commonly system services
Also, provide an example for -u.
2014-08-18 19:08:03 +02:00
Lennart Poettering
ea352b409e networkd: fix how we generate lists in link_save()
https://bugs.freedesktop.org/show_bug.cgi?id=82721
2014-08-18 18:59:48 +02:00
Ronny Chevalier
8aa209ee14 tests: add missing entry to test-tables 2014-08-18 18:44:03 +02:00
Ronny Chevalier
6accc7a24c tests: add tests for time-util.c
add tests for:
- timezone_is_valid
- get_timezones
2014-08-18 18:44:00 +02:00
Ronny Chevalier
b08f2be60a tests: add test-condition-util 2014-08-18 18:43:58 +02:00
Ronny Chevalier
8852362bfc tests: add tests for util.c
add tests for:
- is_symlink
- pid_is_unwaited
- pid_is_alive
- search_and_fopen
- search_and_fopen_nulstr
- glob_exists
- execute_directory
2014-08-18 18:43:55 +02:00
Ronny Chevalier
d7aeffea14 tests: add test for fdset_iterate 2014-08-18 18:43:52 +02:00
Ronny Chevalier
0709b74374 tests: add tests for fileio.c
add tests for:
- write_string_stream
- write_string_file
- sendfile_full
2014-08-18 18:43:50 +02:00
Ronny Chevalier
1f532d7ef3 tests: add missing unlink 2014-08-18 18:43:48 +02:00
Ronny Chevalier
43dc004336 tests: add tests for socket-util.c
add tests for:
- socket_address_is
- socket_address_is_netlink
- sockaddr_equal
2014-08-18 18:43:45 +02:00
Ronny Chevalier
c16d01af57 man: fix typo 2014-08-18 18:29:27 +02:00
Michael Olbrich
1924a97db5 tmpfiles: only execute chmod()/chown() when needed
This avoids errors like this, when the paths are already there with the
correct permissions and owner:

chmod(/var/spool) failed: Read-only file system
2014-08-18 18:25:30 +02:00
Lennart Poettering
630a4d9ea7 Merge remote-tracking branch 'origin/master' 2014-08-18 18:12:55 +02:00
Tom Gundersen
e0fbf1fcff networkd: warn when ignoring unsupported tuntap options
The interface for creating tuntap devices should be ported to rtnl so it would support the same settings
as other kinds. In the meantime, the best one can do is to drop in a .link file to set the desired options.
2014-08-18 18:11:42 +02:00
Stef Walter
283868e1dc core: Verify systemd1 DBus method callers via polkit
DBus methods that retrieve information can be called by anyone.

DBus methods that modify state of units are verified via polkit
action: org.freedesktop.systemd1.manage-units

DBus methods that modify state of unit files are verified via polkit
action: org.freedesktop.systemd1.manage-unit-files

DBus methods that reload the entire daemon state are verified via polkit
action: org.freedesktop.systemd1.reload-daemon

DBus methods that modify job state are callable from the clients
that started the job.

root (ie: CAP_SYS_ADMIN) can continue to perform all calls, property
access etc. There are several DBus methods that can only be
called by root.

Open up the dbus1 policy for the above methods.

(Heavily modified by Lennart, making use of the new
bus_verify_polkit_async() version that doesn't force us to always
pass the original callback around. Also, interactive auhentication must
be opt-in, not unconditional, hence I turned this off.)
2014-08-18 18:08:28 +02:00
Lennart Poettering
f38857914a bus-util: simplify bus_verify_polkit_async() a bit
First, let's drop the "bus" argument, we can determine it from the
message anyway.

Secondly, determine the right callback/userdata pair automatically from
what is currently is being dispatched. This should simplify things a lot
for us, since it makes it unnecessary to pass pointers through the
original handlers through all functions when we process messages, which
might require authentication.
2014-08-18 17:49:53 +02:00
Lennart Poettering
caa829849d sd-bus: add API to query which handler/callback is currently being dispatched 2014-08-18 17:49:53 +02:00
Daniel Mack
fac9c0d508 memfd: internalize functions, drop sd_memfd type
Remove the sd_ prefix from internal functions and get rid of the sd_memfd
type. As a memfd is now just a native file descriptor, we can get rid of our
own wrapper type, and also use close() and dup() on them directly.
2014-08-18 13:32:08 +02:00
David Herrmann
8a02decaf1 memfd: use _cleanup_ if applicable
We now have a sd_memfd_freep helper, use it if applicable.
2014-08-18 13:07:43 +02:00
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