1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 16:59:03 +03:00
Commit Graph

15111 Commits

Author SHA1 Message Date
Tom Gundersen
7182867e79 sd-rtnl: add multi-part message test 2014-04-19 16:47:52 +02:00
Tom Gundersen
4e996881b2 sd-rtnl: message - concatenate multi-part messages from different packets 2014-04-19 16:47:52 +02:00
Tom Gundersen
24a026737d sd-rtnl: message - don't put NULL message on rqueue
If nothing interesting was receieved we should not put anything on
the queue.
2014-04-19 16:47:52 +02:00
Tom Gundersen
6fc518838c sd-rtnl: message - make room for all pending messages, not just the first
Also, don't actually read any of the message when peeking, just get its length.
2014-04-19 16:47:52 +02:00
Kay Sievers
2f20a8ebdb Revert "Handle Unix domain socket connections from outside our namespace"
This reverts commit 9754d56e9b.

It causes a crash in PID1:
  Apr 19 13:49:32 lon systemd[1]: Code should not be reached 'Unhandled socket type.'
                                  at src/core/socket.c:684, function instance_from_socket(). Aborting.
  Apr 19 13:49:32 lon systemd[1]: Caught <ABRT>, dumped core as pid 336.
  Apr 19 13:49:32 lon systemd[1]: Freezing execution.
2014-04-19 13:53:11 +02:00
Greg KH
a606871da5 tmpfiles: fix permissions on new journal files
When starting up journald on a new system, set the proper permissions on
the system.journal files, not only on the journal directory.
2014-04-17 23:58:12 -04:00
Zbigniew Jędrzejewski-Szmek
1dd5aa56d1 build-sys: do not try to build test-rtnl-manual w/o kmod 2014-04-17 23:39:54 -04:00
Łukasz Stelmach
7c4e5e4db8 build-sys: add libkmod flags for test_rtnl_manual 2014-04-17 23:39:54 -04:00
Ali H. Caliskan
f2f426ddcf core: minor typo fix 2014-04-17 23:30:13 -04:00
Zbigniew Jędrzejewski-Szmek
00a5cc3a63 delta: do not use unicode chars in C locale
https://bugzilla.redhat.com/show_bug.cgi?id=1088418
2014-04-16 23:33:48 -04:00
Djalal Harouni
af7fce1cdb install: create_symlink() check unlink() return value
create_symlink() do not check the return value of unlink(), this may
confuse the user.

Before the unlink() call we check the 'force' argument. If it is not set
we fail with -EEXIST, otherwise we unlink() the file, therefore the next
symlink() should not fail with -EEXIST (do not count races...).

However since callers may not have appropriate privileges to unlink()
the file we lose the -EPERM or any other errno code of unlink(), and
return the -EEXIST of the next symlink(). Fix this by checking unlink()
results.

Before:
$ systemctl --force --root=~/container-03 set-default multi-user.target
Failed to set default target: File exists

After:
$ systemctl --force --root=~/container-03 set-default multi-user.target
Failed to set default target: Permission denied
2014-04-16 23:13:22 -04:00
Djalal Harouni
a1484a216e systemctl: allow to change the default target without the --force switch
Currently "systemctl set-default" will fail to change the default target
due to the 'default.target' being a symlink which is always the case.

To work around this, the user must specify the "--force" switch to be
able to overwrite the existing symlink.

This is clearly a regression that was introduced by commit  718db96199
since it worked before without the "--force" switch and the man pages do
not mention that you need to specify it. It is expected that this is a
symlink.

So just explicity set the force flag to make it work again.

https://bugs.freedesktop.org/show_bug.cgi?id=76623

Reported-by: <code@progandy.de>
2014-04-16 23:13:22 -04:00
Eelco Dolstra
9754d56e9b Handle Unix domain socket connections from outside our namespace
NixOS uses Unix domain sockets for certain host <-> container
interaction; i.e. the host connects to a socket visible in the
container's directory tree, where the container uses a .socket unit to
spawn the handler program on demand. This worked in systemd 203, but
in 212 fails with "foo.socket failed to queue service startup job
(Maybe the service file is missing or not a template unit?): No data
available".

The reason is that getpeercred() now returns ENODATA if it can't get
the PID of the client, which happens in this case because the client
is not in the same PID namespace. Since getpeercred() is only used to
generate the instance name, this patch simply handles ENODATA by
creating an instance name "<nr>-unknown".

[zj: reorder clauses and remove (unsigned long) casts.]
2014-04-16 22:24:28 -04:00
Zbigniew Jędrzejewski-Szmek
5d2abc04fc man: document relationship between RequiresMountsFor and noauto
https://bugzilla.redhat.com/show_bug.cgi?id=1088057
2014-04-16 22:17:29 -04:00
Zbigniew Jędrzejewski-Szmek
7f076504b8 test-path-util: fix running with separate build dir
test-path-utils attempts to find itself, but if the binary is not
in current directory, the test would fail.
2014-04-16 22:04:48 -04:00
Zbigniew Jędrzejewski-Szmek
2e573fcf87 sysctl: replaces some slashes with dots
It turns out that plain sysctl understands a.b/c syntax to write to
/proc/sys/a/b.c. Support this for compatibility.

https://bugs.freedesktop.org/show_bug.cgi?id=77466
2014-04-16 21:52:36 -04:00
Thomas Hindoe Paaboel Andersen
806a37e743 systemctl: add --recursive for list-timers 2014-04-16 23:51:27 +02:00
Thomas Hindoe Paaboel Andersen
0cfc352571 systemctl: add --recursive for list-sockets 2014-04-16 00:38:22 +02:00
Thomas Hindoe Paaboel Andersen
b8ec9ba918 bus-proxy: remove unused variable 2014-04-14 21:02:25 +02:00
Thomas Hindoe Paaboel Andersen
5706b3e78d cgls: avoid writing an unused value
silences a build-scan warning for the unused value in r
2014-04-14 21:02:20 +02:00
Thomas Hindoe Paaboel Andersen
2667cc2589 timedatectl: avoid using uninitialized var
sec is not set if have_time is false so avoid using it. have_time
was introduced in 9ff09bcb86 but only
the first uses for sec were covered

Found with scan-build
2014-04-14 19:16:56 +02:00
Thomas Hindoe Paaboel Andersen
a6ad1458e8 man: fix typos in sd_event_new 2014-04-14 19:12:59 +02:00
Tom Gundersen
3379e257ee networkd: link - make state changing logging a bit less verbose 2014-04-14 17:55:47 +02:00
Tom Gundersen
b9ef681b04 sd-rtnl: message_addr - allow dumping of messages 2014-04-14 17:53:21 +02:00
Tom Gundersen
a88f77c406 sd-rtnl: socket_read - use a read buffer
Rather than allocating/freeing memory for each message read, keep a global read buffer
in the rtnl object. Also, rather than using a fixed size, peek at the pending message
header to get the message size and reallocate as necessary.
2014-04-14 17:53:21 +02:00
Tom Gundersen
1403f45ab6 sd-rtnl: multi-part message - store as linked-list rather than independent messages
This means the API can stay the same as for single-part messages by simply passing the head message around. Unrefing
the head of the linked list unrefs the whole list.
2014-04-14 17:53:21 +02:00
Tom Gundersen
e00d77ddd5 sd-rtnl: message_addr - expose a few more getters 2014-04-14 17:53:01 +02:00
Tom Gundersen
e9189a1f56 networkd: link - ignore missing MAC address from NEWLINK message
The kernel may broadcast such messages, simply discard them.
2014-04-14 17:53:01 +02:00
Kay Sievers
d060b62fcb hwdb: PCI - include "primary" model string in subsystem model string
The data in the PCI ids file is randomly inconsistent. Many
subvendor model strings just describe the "product" where the
hardware is built into, not the hardware itself. This causes
some "Network Card Model Foo" to show up as "Laptop Model Bar".

Try to make the best out of this mess and concatenate both
strings to describe the hardware.
2014-04-14 08:21:52 -07:00
Kay Sievers
dbe633cc02 hwdb: update 2014-04-14 08:21:51 -07:00
Lennart Poettering
d96ea5048b util: ignore kernel errors reported via close(), unless it is EBADF
The kernel can return pretty much anything there, even though the fd is
closed. Let's not get confused by that.
2014-04-13 20:01:41 -07:00
Kay Sievers
3ebdb81ef0 udev: serialize/synchronize block device event handling with file locks 2014-04-13 19:54:27 -07:00
Lennart Poettering
2f1a3d0868 bus-proxy: when replying to bus calls set a synthetic serial number and patch the sender address
Otherwise old libdbus1 is confused and will not accept our replies.
2014-04-13 19:43:00 -07:00
Lennart Poettering
2a0abe5b6d bus: process AddMatch/RemoveMatch driver call in proxy
Previously, AddMatch/RemoveMatch calls where processed exclusively in
the proxy. That's racy however, since subscribing to a signal might not
complete before the signal is sent due to some subsequent method call.
Hence, in order to expose the same ordering guarantees as dbus1 process
the AddMatch/RemoveMatch calls from the proxy, so that they are
dispatched synchronously to all following messages, thus fixing the
race.

Ultimately, we should probabably dissolve the driver entirely into the
proxy, as it is purely a compatibility feature anyway...
2014-04-13 18:34:55 -07:00
Lennart Poettering
6e0369b0ff man: explain that the timestamps on incoming kdbus messages are not necessarily monotonically increasing 2014-04-13 17:42:11 -07:00
Lennart Poettering
11fb37f16e update TODO 2014-04-13 17:41:51 -07:00
Lennart Poettering
bdb65e785a build-sys: add Makefile symlink 2014-04-13 17:41:02 -07:00
Lennart Poettering
01083ad094 update TODO 2014-04-13 17:41:01 -07:00
Lennart Poettering
faae655de3 man: add man page for sd_event_new() 2014-04-13 17:41:01 -07:00
Kay Sievers
9ea28c55a2 udev: remove seqnum API and all assumptions about seqnums
The way the kernel namespaces have been implemented breaks assumptions
udev made regarding uevent sequence numbers. Creating devices in a
namespace "steals" uevents and its sequence numbers from the host. It
confuses the "udevadmin settle" logic, which might block until util a
timeout is reached, even when no uevent is pending.

Remove any assumptions about sequence numbers and deprecate libudev's
API exposing these numbers; none of that can reliably be used anymore
when namespaces are involved.
2014-04-13 17:12:14 -07:00
Dan Kilman
a163b64c4b bash completion: fix __get_startable_units 2014-04-13 11:39:43 -04:00
Zbigniew Jędrzejewski-Szmek
b972115c97 path-util: also check for existence of binary when given absolute path
In contrast to a filename-only argument, find_binary() did not
actually check if an path exists, allowing the code to fail later on.
This was OK, but it seems nicer to treat both paths identically.

Also take advantage of path_make_absolute_cwd doing strdup() by itself
if necessary to simplify.
2014-04-12 17:23:13 -04:00
Mike Gilbert
eb66db55fc fsck: Search for fsck.type in PATH
Modifies find_binary() to accept NULL in the second argument.

fsck.type lookup logic moved to new fsck_exists() function, with a test.
2014-04-12 17:23:13 -04:00
Marcel Holtmann
b189101727 hwdb: Update database of Bluetooth company identifiers 2014-04-12 10:38:16 -07:00
Tanu Kaskinen
05a2f6fefe man: mention XDG_CONFIG_HOME in systemd.unit 2014-04-12 13:12:32 -04:00
Cristian Rodríguez
aca33b078c build: if -fstack-protector-strong is available, use it. 2014-04-12 11:56:07 -04:00
Thomas Bächler
472fc28fda core: Make sure a stamp file exists for all Persistent=true timers
If a persistent timer has no stamp file yet, it behaves just like a normal
timer until it runs for the first time. If the system is always shut down
while the timer is supposed to run, a stamp file is never created and
Peristent=true has no effect.

This patch fixes this by creating a stamp file with the current time
when the timer is first started.
2014-04-12 10:20:55 -04:00
Zbigniew Jędrzejewski-Szmek
baf167ee0a journal: properly detect language specified in line
... it turns out that the duplicates in our own catalog were not real
duplicates, but translations.
2014-04-12 10:20:55 -04:00
Zbigniew Jędrzejewski-Szmek
e3b9d9c802 journal: cleanup up error handling in update_catalog()
- Negative/positive errno mixup caused duplicates not to be detected properly.
  Now we get a warning about some duplicate entries in our own catalogs...
- Errors in update_catalog would be ignored, but they should not be.
2014-04-12 10:20:55 -04:00
Zbigniew Jędrzejewski-Szmek
6e00a80641 test-dhcp-client: unref lease objects to make valgrind happy
Also unref client objects in test code, and initalize logging,
to DEBUG by default.
2014-04-12 10:20:55 -04:00