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

20094 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
0f90839754 core: fix spurious warning about cpuacct-usage-base deserialization
The key was parsed properly, but the warning was still generated.
2015-04-16 08:12:02 -04:00
Zbigniew Jędrzejewski-Szmek
38b9855bfa udev-builtin-usb_id: fix inverted condition
Fix for 4beac74e69.

Thanks, Ronny!
2015-04-15 08:28:19 -04:00
Zbigniew Jędrzejewski-Szmek
17af49f248 selinux: use different log priorites for log messages
When selinux calls our callback with a log message, it specifies the
type as AVC or INFO/WARNING/ERROR. The question is how to map this to
audit types and/or log priorities. SELINUX_AVC maps to AUDIT_USER_AVC
reasonably, but for the other messages we have no idea, hence we use
AUDIT_USER_AVC for everything. When not using audit logging, we can
map those selinux levels to LOG_INFO/WARNING/ERROR etc.

Also update comment which was not valid anymore in light of journald
sucking in audit logs, and was actually wrong from the beginning —
libselinux uses the callback for everything, not just avcs.

This stemmed out of https://bugzilla.redhat.com/show_bug.cgi?id=1195330,
but does not solve it.
2015-04-14 21:47:20 -04:00
Zbigniew Jędrzejewski-Szmek
40acc203c0 systemctl: avoid bumping NOFILE rlimit unless needed
We actually only use the journal when showing status. Move setrlimit call
so it is only called for status.

https://bugzilla.redhat.com/show_bug.cgi?id=1184712
2015-04-14 21:47:20 -04:00
Zbigniew Jędrzejewski-Szmek
813a71a206 sd-device: fix typo 2015-04-14 20:16:02 -04:00
Zbigniew Jędrzejewski-Szmek
4beac74e69 udev-builtin-usb_id: simplification 2015-04-14 12:39:14 -04:00
Thomas Hindoe Paaboel Andersen
70c79983e1 test-dhcp6-client: don't unref the event twice 2015-04-14 18:33:31 +02:00
Thomas Hindoe Paaboel Andersen
8283c71b71 sd-dhcp6-client: unref lease when freeing the client 2015-04-14 18:32:58 +02:00
Tom Gundersen
5a917c064b sd-devcie: fix typo 2015-04-14 16:55:18 +02:00
Tom Gundersen
85091685af sd-device: fix reading of subsystem 2015-04-14 16:19:37 +02:00
Tom Gundersen
bba061662b sd-device: allow uevent files to be write-only 2015-04-14 16:19:37 +02:00
Lennart Poettering
8d8ce9e2cd udev: downgrade a few warnings to debug messages
https://bugs.freedesktop.org/show_bug.cgi?id=89885
2015-04-14 15:53:33 +02:00
Hans de Goede
37186823f3 input_id: Identify scroll-wheel device on Trust TB7300 tablet as keyboard
The Trust TB7300 (relabelled Waltop?) tablet has a scrollwheel which shows
up as a /dev/input/event# node all by itself. Currently input_id does not
set any ID_INPUT_FOO attr on this causing it it to not be recognized by
Xorg / libinput.

This commit fixes this by marking it with ID_INPUT_KEY.

Reported-by: Sjoerd Timmer <themba@randomdata.nl>
2015-04-14 09:51:41 +10:00
Hans de Goede
941a2aca3d udev: input_id: Make test_pointer / test_keys return if they've found anything
Make test_pointer / test_keys return a boolean indicating whether or not
they've set any properties on the device.
2015-04-14 09:51:07 +10:00
Peter Hutterer
b914418a15 udev: input_id: whitespace fixes
Remove whitespaces before opening parentheses, mostly before test_bit.
2015-04-14 09:40:19 +10:00
Thomas Hindoe Paaboel Andersen
a64edefacb test-ipv4ll: clean up the event
shuts up valgrind/sanitizers
2015-04-13 23:38:02 +02:00
Goffredo Baroncelli
3a92e4ba47 tmpfiles: Add +C attrib to the journal files directories
Add the +C file attribute (NOCOW) to the journal directories, so that
the flag is inherited automatically for new journal files created in
them. The journal write pattern is problematic on btrfs file systems as
it results in badly fragmented files when copy-on-write (COW) is used:
the performances decreases substantially over time.

To avoid this issue, this tmpfile.d snippet sets the NOCOW attribute to
the journal files directories, so newly created journal files inherit
the NCOOW attribute that disables copy-on-write.

Be aware that the NOCOW file attribute also disables btrfs checksumming
for these files, and thus prevents btrfs from rebuilding corrupted files
on a RAID filesystem.

In a single disk filesystems (or filesystems without redundancy) it is
safe to use the NOCOW flags without drawbacks, since the journal files
contain their own checksumming.
2015-04-13 16:37:52 +02:00
Lennart Poettering
48e6d6a6e9 update TODO 2015-04-13 15:23:53 +02:00
Lennart Poettering
1ae705fb3d man: slightly fewer paragraphs can help readability 2015-04-13 15:23:53 +02:00
Lennart Poettering
bd1100898d man: fix examples indentation in tmpfiles.d(5) 2015-04-13 15:23:52 +02:00
Lennart Poettering
0ac0b1e720 man: add information about more lines to explanation of argument field 2015-04-13 15:23:52 +02:00
Lennart Poettering
6a9171d2ec man: document which tmpfiles line types follow symlinks
Generally, we will not follow symlinks, except for "w".

Avoid documentation for now for fifo, device node, directory lines,
which currently follow symlinks but better shouldn't.
2015-04-13 15:23:52 +02:00
Lennart Poettering
48b8aaa827 tmpfiles: don't follow symlinks when adjusting ACLs, fille attributes, access modes or ownership 2015-04-13 15:23:52 +02:00
Martin Pitt
0e336347de hwdb: Fix wireless switch on Dell Latitude
It does not generate a release event.

https://launchpad.net/bugs/1441849
2015-04-13 06:34:14 -05:00
Zbigniew Jędrzejewski-Szmek
e51728b047 journal-gatewayd: use (void) to silence coverity
CID #996297.
2015-04-12 22:46:37 -04:00
Zbigniew Jędrzejewski-Szmek
4a61c3e51e journal: use (void) to silence coverity
This shouldn't really fail and anyway not much we can do about it.

CID #996292, #996294, #996295.
2015-04-12 22:45:06 -04:00
Zbigniew Jędrzejewski-Szmek
2ae4842b6c pam_system: use (void) to silence coverity
CID #996284.
2015-04-12 22:41:20 -04:00
Zbigniew Jędrzejewski-Szmek
c268628a20 man: add link to glib in sd_event_run(3) 2015-04-12 21:47:58 -04:00
Piotr Drąg
304e64e638 po: update Polish translation
https://bugs.freedesktop.org/show_bug.cgi?id=89989
2015-04-12 16:59:04 -04:00
Zbigniew Jędrzejewski-Szmek
8fba1c8d4e sysv-generator: free memory allocated for service stubs 2015-04-12 16:59:04 -04:00
Zbigniew Jędrzejewski-Szmek
3ef11dcfde shared/hashmap: normalize whitespace 2015-04-12 16:59:04 -04:00
Zbigniew Jędrzejewski-Szmek
e987f2a809 sysv-generator: always log on oom
This code appears to follow the following convention:
- all errors are logged at point of origin
- oom errors abort execution, non-oom errors are logged but
  execution continues.

Make sure all ooms result in a log message, and remove warning which could
not be reached. Downgrade non-fatal errors to warnings.
2015-04-12 16:59:04 -04:00
Zbigniew Jędrzejewski-Szmek
1e2fee5f75 sysv-generator: split out two nested blocks into functions
No functional change intended. Just splitting this out to make
it easier to edit in the future.
2015-04-12 16:59:04 -04:00
Lennart Poettering
dd168445f8 dhcp: yes, infiniband has the larger MAC address length, but let the compuler figure that out... 2015-04-12 20:15:08 +02:00
Lennart Poettering
3d8dcaf1da efi-boot-generator: need need to proceed if /boot is already a mount point 2015-04-12 20:01:07 +02:00
Tobias Hunger
eafe88e34a gpt-generator: Find device on a stateless system
A stateless system has a tmpfs as root file system. That obviously
does not have any block device associated with it. So try falling back
to the device of the /usr filesystem if the root filesystem fails.
2015-04-12 20:00:21 +02:00
Simon Farnsworth
9f1a574d50 python-systemd: fix is_socket_inet to cope with ports
Just a couple of trivial oversights.
2015-04-12 10:20:36 -04:00
Tobias Hunger
776c441941 efi-boot-generator: Continue if /boot does not exist
/boot does not exist on a stateless system, so do not get
confused by that.
2015-04-12 10:20:36 -04:00
Zbigniew Jędrzejewski-Szmek
a61cc460e8 bus-util: add articles to explanation messages
We are talking about one member of a group of things (resource limits, signals,
timeouts), without specifying which one. An indenfinite article is in order.

When we are talking about the control process, it's a specific one, so the
definite article is used.
2015-04-12 10:20:36 -04:00
Zbigniew Jędrzejewski-Szmek
f8bc41822b sysv-generator: free LookupPaths also on error
Followup for 7a03974a6f.
2015-04-12 10:20:36 -04:00
Zbigniew Jędrzejewski-Szmek
c89280f811 udev-builtin-keyboard: make error messages more standard
- No need to add "Error, " prefix, we already have that as metadata.
- Also use double quotes for path names, as in most other places.
- Remove stray newline at end of message.
- Downgrade error messages after which we continue to warnings.
2015-04-12 10:20:36 -04:00
Zbigniew Jędrzejewski-Szmek
c7e3c3ecac rules: finish incomplete rename
Fixup for 51c0c28698.
2015-04-12 10:20:24 -04:00
Zbigniew Jędrzejewski-Szmek
dd449aca61 tmpfiles: use qsort_safe 2015-04-12 10:20:24 -04:00
Thomas Hindoe Paaboel Andersen
7a03974a6f sysv-generator: fix mem leaks 2015-04-11 13:47:56 +02:00
David Herrmann
98a4c30ba1 bus: implement bus_path_{en,de}code_unique()
Whenever we provide a bus API that allows clients to create and manage
server-side objects, we need to provide a unique name for these objects.
There are two ways to provide them:
  1) Let the server choose a name and return it as method reply.
  2) Let the client pass its name of choice in the method arguments.

The first method is the easiest one to implement. However, it suffers from
a race condition: If a client creates an object asynchronously, it cannot
destroy that object until it received the method reply. It cannot know the
name of the new object, thus, it cannot destroy it. Furthermore, this
method enforces a round-trip. If the client _depends_ on the method call
to succeed (eg., it would close() the connection if it failed), the client
usually has no reason to wait for the method reply. Instead, the client
can immediately schedule further method calls on the newly created object
(in case the API guarantees in-order method-call handling).

The second method fixes both problems: The client passes an object name
with the method-call. The server uses it to create the object. Therefore,
the client can schedule object destruction even if the object-creation
hasn't finished, yet (again, requiring in-order method-call handling).
Furthermore, the client can schedule further method calls on the newly
created object, before the constructor returned.

There're two problems to solve, though:
  1) Object names are usually defined via dbus object paths, which are
     usually globally namespaced. Therefore, multiple clients must be able
     to choose unique object names without interference.
  2) If multiple libraries share the same bus connection, they must be
     able to choose unique object names without interference.

The first problem is solved easily by prefixing a name with the
unique-bus-name of a connection. The server side must enforce this and
reject any other name.
The second problem is solved by providing unique suffixes from within
sd-bus. As long as sd-bus always returns a fresh new ID, if requested,
multiple libraries will never interfere. This implementation re-uses
bus->cookie as ID generator, which already provides unique IDs for each
bus connection.

This patch introduces two new helpers:
  bus_path_encode_unique(sd_bus *bus,
                         const char *prefix,
                         const char *sender_id,
                         const char *external_id,
                         char **ret_path);
    This creates a new object-path via the template
    '/prefix/sender_id/external_id'. That is, it appends two new labels to
    the given prefix. If 'sender_id' is NULL, it will use
    bus->unique_name, if 'external_id' is NULL, it will allocate a fresh,
    unique cookie from bus->cookie.

  bus_path_decode_unique(const char *path,
                         const char *prefix,
                         char **ret_sender,
                         char **ret_external);
    This reverses what bus_path_encode_unique() did. It parses 'path' from
    the template '/prefix/sender/external' and returns both suffix-labels
    in 'ret_sender' and 'ret_external'. In case the template does not
    match, 0 is returned and both output arguments are set to NULL.
    Otherwise, 1 is returned and the output arguments contain the decoded
    labels.

Note: Client-side allocated IDs are inspired by the Wayland protocol
      (which itself was inspired by X11). Wayland uses those IDs heavily
      to avoid round-trips. Clients can create server-side objects and
      send method calls without any round-trip and waiting for any object
      IDs to be returned. But unlike Wayland, DBus uses gobally namespaced
      object names. Therefore, we have to add the extra step by adding the
      unique-name of the bus connection.
2015-04-11 13:27:49 +02:00
David Herrmann
ad922737f7 bus: implement bus_label_unescape_n()
This is like bus_label_unescape() but takes a maximum length instead of
relying on NULL-terminated strings. This is highly useful to unescape
labels that are not at the end of a path.
2015-04-11 13:14:57 +02:00
David Herrmann
cfe561a456 hashmap: return NULL from destructor
We _always_ return NULL from destructors to allow direct assignments to
the variable holding the object. Especially on hashmaps, which treat NULL
as empty hashmap, this is pretty neat.
2015-04-11 13:14:41 +02:00
Daniel Drake
07ba8037bf udevd: fix synchronization with settle when handling inotify events
udev uses inotify to implement a scheme where when the user closes
a writable device node, a change uevent is forcefully generated.
In the case of block devices, it actually requests a partition rescan.

This currently can't be synchronized with "udevadm settle", i.e. this
is not reliable in a script:

 sfdisk --change-id /dev/sda 1 81
 udevadm settle
 mount /dev/sda1 /foo

The settle call doesn't synchronize there, so at the same time we try
to mount the device, udevd is busy removing the partition device nodes and
readding them again. The mount call often happens in that moment where the
partition node has been removed but not readded yet.

This exact issue was fixed long ago:
http://git.kernel.org/cgit/linux/hotplug/udev.git/commit/?id=bb38678e3ccc02bcd970ccde3d8166a40edf92d3

but that fix is no longer valid now that sequence numbers are no longer
used.

Fix this by forcing another mainloop iteration after handling inotify events
before unblocking settle. If the inotify event caused us to generate a
"change" event, we'll pick that up in the following loop iteration, before
we reach the end of the loop where we respond to settle's control message,
unblocking it.
2015-04-11 13:10:52 +02:00
Gavin Li
af97ebf2dd hwdb: add Samsung ATIV Book 6 / 8
This adds support for the keyboard illumination keys and fixes
Fn+F1.
2015-04-11 12:54:08 +02:00
Marc-Antoine Perennou
c4a77bcb9a build: allow setting OBJCOPY 2015-04-11 12:48:18 +02:00