chiark / gitweb /
6 years agonetworkd: integrate LLDP
Susant Sahani [Sun, 23 Nov 2014 04:26:14 +0000 (09:56 +0530)]
networkd: integrate LLDP

This patch integrates LLDP with networkd.

Example conf:
file :



6 years agonetworkd: Introduce Link Layer Discovery Protocol (LLDP)
Susant Sahani [Sun, 23 Nov 2014 04:16:36 +0000 (09:46 +0530)]
networkd: Introduce Link Layer Discovery Protocol (LLDP)

This patch introduces LLDP support to networkd. it implements the
receiver side of the protocol.

The Link Layer Discovery Protocol (LLDP) is an industry-standard,
vendor-neutral method to allow networked devices to advertise
capabilities, identity, and other information onto a LAN. The Layer 2
protocol, detailed in IEEE 802.1AB-2005.LLDP allows network devices
that operate at the lower layers of a protocol stack (such as
Layer 2 bridges and switches) to learn some of the capabilities
and characteristics of LAN devices available to higher
layer protocols.

6 years agonetworkctl: port to verbs helper
Tom Gundersen [Fri, 19 Dec 2014 02:16:45 +0000 (03:16 +0100)]
networkctl: port to verbs helper

6 years agosystemd-hwdb: port to new verbs helper
Tom Gundersen [Fri, 19 Dec 2014 02:01:27 +0000 (03:01 +0100)]
systemd-hwdb: port to new verbs helper

6 years agoimport: dck - fix curl error handling
Tom Gundersen [Fri, 19 Dec 2014 02:00:56 +0000 (03:00 +0100)]
import: dck - fix curl error handling

6 years agoupdate TODO
Lennart Poettering [Fri, 19 Dec 2014 01:07:35 +0000 (02:07 +0100)]
update TODO

6 years agoimport: add new minimal tool "systemd-import" for pulling down foreign containers...
Lennart Poettering [Fri, 19 Dec 2014 00:59:52 +0000 (01:59 +0100)]
import: add new minimal tool "systemd-import" for pulling down foreign containers and install them locally

This adds a simply but powerful tool for downloading container images
from the most popular container solution used today. Use it like

       # systemd-import pull-dck mattdm/fedora
       # systemd-nspawn -M fedora

This will donwload the layers for "mattdm/fedora", and make them
available locally as /var/lib/container/fedora.

The tool is pretty complete, as long as it's only about pulling down
images, or updating them. Pushing or searching is not supported yet.

6 years agoutil: add generalization of verb parsing for command line tools
Lennart Poettering [Fri, 19 Dec 2014 00:48:05 +0000 (01:48 +0100)]
util: add generalization of verb parsing for command line tools

We should move loginctl, timedatectl, machinectl over to use this new
API instead of a manual one.

6 years agoutil: make sure rm_rf() can be called on symlinks (with the effect of deleting it)
Lennart Poettering [Fri, 19 Dec 2014 00:47:19 +0000 (01:47 +0100)]
util: make sure rm_rf() can be called on symlinks (with the effect of deleting it)

6 years agostrv: ass new strv_is_uniq() and strv_reverse() calls
Lennart Poettering [Fri, 19 Dec 2014 00:31:59 +0000 (01:31 +0100)]
strv: ass new strv_is_uniq() and strv_reverse() calls

6 years agoexecute: the runtime directory can only be on tmpfs, hence don't use rm_rf_dangerous...
Lennart Poettering [Fri, 19 Dec 2014 00:31:27 +0000 (01:31 +0100)]
execute: the runtime directory can only be on tmpfs, hence don't use rm_rf_dangerous() needlessly

6 years agonss-myhostname: introduce is_gateway() similar to the existing is_hostname()
Lennart Poettering [Thu, 18 Dec 2014 00:44:34 +0000 (01:44 +0100)]
nss-myhostname: introduce is_gateway() similar to the existing is_hostname()

6 years agoload-fragment: allow quoting in command name and document allowed escapes
Zbigniew Jędrzejewski-Szmek [Thu, 18 Dec 2014 23:08:13 +0000 (18:08 -0500)]
load-fragment: allow quoting in command name and document allowed escapes

The handling of the command name and other arguments is unified. This
simplifies things and should make them more predictable for users.
Incidentally, this makes ExecStart handling match the .desktop file
specification, apart for the requirment for an absolute path.

6 years agoTreat a trailing backslash as an error
Zbigniew Jędrzejewski-Szmek [Thu, 18 Dec 2014 22:51:38 +0000 (17:51 -0500)]
Treat a trailing backslash as an error

Commit a2a5291b3f5 changed the parser to reject unfinished quoted
strings. Unfortunately it introduced an error where a trailing
backslash would case an infinite loop. Of course this must fixed, but
the question is what to to instead. Allowing trailing backslashes and
treating them as normal characters would be one option, but this seems
suboptimal. First, there would be inconsistency between handling of
quoting and of backslashes. Second, a trailing backslash is most
likely an error, at it seems better to point it out to the user than
to try to continue.

Updated rules:
ExecStart=/bin/echo \\ → OK, prints a backslash
ExecStart=/bin/echo \ → error
ExecStart=/bin/echo "x → error
ExecStart=/bin/echo "x"y → error

6 years agotest-strv: use STRV_MAKE
Zbigniew Jędrzejewski-Szmek [Thu, 18 Dec 2014 22:01:42 +0000 (17:01 -0500)]
test-strv: use STRV_MAKE

6 years agotree-wide: make condition_free_list return NULL
Zbigniew Jędrzejewski-Szmek [Thu, 18 Dec 2014 17:33:05 +0000 (12:33 -0500)]
tree-wide: make condition_free_list return NULL

6 years agocore: make exec_command_free_list return NULL
Zbigniew Jędrzejewski-Szmek [Thu, 18 Dec 2014 17:29:24 +0000 (12:29 -0500)]
core: make exec_command_free_list return NULL

6 years agohwdb: move Logitech mouse to the right spot
Zbigniew Jędrzejewski-Szmek [Thu, 18 Dec 2014 23:42:04 +0000 (18:42 -0500)]
hwdb: move Logitech mouse to the right spot

6 years agohwdb: Logitech, Inc. RX 250 Optical Mouse DPI data
Erik Auerswald [Thu, 18 Dec 2014 23:46:29 +0000 (18:46 -0500)]
hwdb: Logitech, Inc. RX 250 Optical Mouse DPI data

6 years agohwdb: Logitech, Inc. RX 300 Optical Mouse DPI data
Tim JP [Thu, 18 Dec 2014 23:40:44 +0000 (18:40 -0500)]
hwdb: Logitech, Inc. RX 300 Optical Mouse DPI data

6 years agotest-cap-list: allow mismatch in case
Zbigniew Jędrzejewski-Szmek [Thu, 18 Dec 2014 22:40:32 +0000 (17:40 -0500)]
test-cap-list: allow mismatch in case

6 years agopath-util: fix breakage in path_is_mount_point
Dave Reisner [Thu, 18 Dec 2014 23:10:46 +0000 (18:10 -0500)]
path-util: fix breakage in path_is_mount_point

This fixes 2 problems introduced by 6feeeab0bc:

1) If name_to_handle_at returns ENOSYS for the child, we'll wrongly
return -ENOSYS when it returns the same for the parent. Immediately
jump to the fallback logic when we get ENOSYS.

2) If name_to_handle_at returns EOPNOTSUPP for the child but suceeds
for the parent, we'll be comparing an uninitialized value (mount_id) to
an initialized value (mount_id_parent). Initialize the mount_id
variables to invalid mount_ids to avoid this.

6 years agosystemd-hwdb: introduce new tool
Tom Gundersen [Mon, 15 Dec 2014 23:48:24 +0000 (00:48 +0100)]
systemd-hwdb: introduce new tool

This pulls out the hwdb managment from udevadm into an independent tool.

The old code is left in place for backwards compatibility, and easy of
testing, but all documentation is dropped to encourage use of the new
tool instead.

6 years agonetworkd: add FDB support
Alin Rauta [Wed, 17 Dec 2014 15:35:36 +0000 (07:35 -0800)]
networkd: add FDB support

6 years agojournal: next_with_matches() now does not need a mapped object as input
Michal Schmidt [Wed, 17 Dec 2014 14:46:30 +0000 (15:46 +0100)]
journal: next_with_matches() now does not need a mapped object as input

Now that journal_file_next_entry() does not need a pointer to the
current object, next_with_matches() does not need it either.

6 years agojournal: journal_file_next_entry() does not need pointer to current Object
Michal Schmidt [Wed, 17 Dec 2014 14:45:10 +0000 (15:45 +0100)]
journal: journal_file_next_entry() does not need pointer to current Object

The current offset is sufficient information.

6 years agojournal: optimize iteration by returning previously found candidate entry
Michal Schmidt [Wed, 17 Dec 2014 14:07:25 +0000 (15:07 +0100)]
journal: optimize iteration by returning previously found candidate entry

In next_beyond_location() when the JournalFile's location type is
LOCATION_SEEK, it means there's nothing to do, because we already have
the location of the candidate entry. Do an early return. Note that now
next_beyond_location() does not anymore guarantee on return that the
entry is mapped, but previous patches made sure the caller does not

This optimization is at least as good as "journal: optimize iteration:
skip files that cannot improve current candidate entry" was.

Timing results on my workstation, using:
$ time ./journalctl -q --since=2014-06-01 --until=2014-07-01 > /dev/null

Before "Revert "journal: optimize iteration: skip files that cannot
improve current candidate entry":

real    0m5.349s
user    0m5.166s
sys     0m0.181s


real    0m3.901s
user    0m3.724s
sys     0m0.176s

6 years agojournal: optimize iteration by skipping exhausted files
Michal Schmidt [Thu, 18 Dec 2014 13:21:55 +0000 (14:21 +0100)]
journal: optimize iteration by skipping exhausted files

If from a previous iteration we know we are at the end of a journal
file, don't bother looking into the file again. This is complicated by
the fact that the EOF does not have to be permanent (think of
"journalctl -f"). So we also check if the number of entries in the
journal file changed.

This optimization has a similar effect as "journal: optimize iteration:
skip whole files behind current location" had.

6 years agojournal: drop unnecessary parameters of next_beyond_location()
Michal Schmidt [Wed, 17 Dec 2014 14:37:52 +0000 (15:37 +0100)]
journal: drop unnecessary parameters of next_beyond_location()

offset is redundant, because the caller can rely on f->current_offset.
The object pointer the function saves in *ret is thrown away by the caller.

6 years agojournal: remove redundant variable new_offset
Michal Schmidt [Thu, 18 Dec 2014 08:56:04 +0000 (09:56 +0100)]
journal: remove redundant variable new_offset

The file's current_offset is already updated at this point, so let's use

6 years agojournal: compare candidate entries using JournalFiles' locations
Michal Schmidt [Wed, 17 Dec 2014 13:06:28 +0000 (14:06 +0100)]
journal: compare candidate entries using JournalFiles' locations

When comparing the locations of candidate entries, we can rely on the
location information stored in struct JournalFile.

6 years agojournal: simplify set_location()
Michal Schmidt [Tue, 16 Dec 2014 21:38:09 +0000 (22:38 +0100)]
journal: simplify set_location()

set_location() is called from real_journal_next() when a winning entry
has been picked from among the candidates in journal files.

The location type is always set to LOCATION_DISCRETE. No need to pass
it as a parameter.
The per-JournalFile location information is already updated at this
point. No need for having the direction and offset here.

6 years agojournal: keep per-JournalFile location info during iteration
Michal Schmidt [Tue, 16 Dec 2014 20:03:36 +0000 (21:03 +0100)]
journal: keep per-JournalFile location info during iteration

In next_beyond_location() when we find a candidate entry in a journal
file, save its location information in struct JournalFile.

The purpose of remembering the locations of candidate entries is to be
able to save work in the next iteration. This patch does only the
remembering part.

LOCATION_SEEK means the location identifies a candidate entry.
When a winner is picked from among candidates, it becomes
LOCATION_TAIL here signifies we've iterated the file to the end (or the
beginning in the case of reversed direction).

6 years agojournal: abstract the resetting of JournalFile's location
Michal Schmidt [Tue, 16 Dec 2014 19:54:56 +0000 (20:54 +0100)]
journal: abstract the resetting of JournalFile's location

6 years agojournal: move definition of LocationType to journal-file.h
Michal Schmidt [Tue, 16 Dec 2014 19:51:58 +0000 (20:51 +0100)]
journal: move definition of LocationType to journal-file.h

In preparation for individual JournalFiles maintaining a location
of their own.

6 years agoRevert "journal: optimize iteration: skip whole files behind current location"
Michal Schmidt [Tue, 16 Dec 2014 19:32:41 +0000 (20:32 +0100)]
Revert "journal: optimize iteration: skip whole files behind current location"

This reverts commit b7c88ab8cc7d55a43450bf3dea750f95f2e910d6.

This optimization will be made redundant by the following patches.

6 years agoRevert "journal: optimize iteration: skip files that cannot improve current candidate...
Michal Schmidt [Tue, 16 Dec 2014 19:32:34 +0000 (20:32 +0100)]
Revert "journal: optimize iteration: skip files that cannot improve current candidate entry"

This reverts commit f8b5a3b75fb55f0acb85c21424b3893c822742e9.

This optimization will be made redundant by the following patches.

6 years agojournal: delete unused function journal_file_skip_entry()
Michal Schmidt [Tue, 16 Dec 2014 14:47:01 +0000 (15:47 +0100)]
journal: delete unused function journal_file_skip_entry()

Its only caller is a test.

6 years agojournal: delete unused function journal_file_move_to_entry_by_offset()
Michal Schmidt [Tue, 16 Dec 2014 18:06:30 +0000 (19:06 +0100)]
journal: delete unused function journal_file_move_to_entry_by_offset()

6 years agocore: use raw_clone instead of fork in signal handler
Zbigniew Jędrzejewski-Szmek [Wed, 17 Dec 2014 04:53:23 +0000 (23:53 -0500)]
core: use raw_clone instead of fork in signal handler

fork() is not async-signal-safe and calling it from the signal handler
could result in a deadlock when at_fork() handlers are called. Using
the raw clone() syscall sidesteps that problem.

The tricky part is that raise() does not work, since getpid() does not
work. Add raw_getpid() to get the real pid, and use kill() instead of

6 years agotest-unit-file: add test for semicolon escaping
Zbigniew Jędrzejewski-Szmek [Thu, 18 Dec 2014 05:52:28 +0000 (00:52 -0500)]
test-unit-file: add test for semicolon escaping

6 years agoload-fragment: properly unescape \;
tomsod-m ya ru [Thu, 18 Dec 2014 04:01:06 +0000 (23:01 -0500)]
load-fragment: properly unescape \;

6 years agopath: make the check for unsupported name_to_handle_at symmetric
Zbigniew Jędrzejewski-Szmek [Thu, 18 Dec 2014 02:05:58 +0000 (21:05 -0500)]
path: make the check for unsupported name_to_handle_at symmetric

If child supports, but the parent does not, or when the child does
not support, but the parent does, assume the child is a mount point.

Only if neither supports use the fallback.

6 years agopath: follow symbolic link for parent path (2)
Umut Tezduyar Lindskog [Thu, 18 Dec 2014 00:43:58 +0000 (19:43 -0500)]
path: follow symbolic link for parent path (2)

c0e57ba9e22ee937722958d8b912ade2a37f206d fixed the fallback path.
We should do the same for name_to_handle_at().

6 years agomachinectl: add new commands for copying files from/to containers
Lennart Poettering [Thu, 18 Dec 2014 00:35:58 +0000 (01:35 +0100)]
machinectl: add new commands for copying files from/to containers

6 years agoutil: in make_stdio() use dup2() rather than dup3()
Lennart Poettering [Wed, 17 Dec 2014 20:54:00 +0000 (21:54 +0100)]
util: in make_stdio() use dup2() rather than dup3()

dup3() allows setting O_CLOEXEC which we are not interested in. However,
it also fails if called with the same fd as input and output, which is
something we don't want. Hence use dup2().

Also, we need to explicitly turn off O_CLOEXEC for the fds, in case the
input fd was O_CLOEXEC and < 3.

6 years agoupdate TODO
Lennart Poettering [Wed, 17 Dec 2014 20:53:54 +0000 (21:53 +0100)]
update TODO

6 years agomachinectl: implement "bind" command to create additional bind mounts from host to...
Lennart Poettering [Wed, 17 Dec 2014 20:51:45 +0000 (21:51 +0100)]
machinectl: implement "bind" command to create additional bind mounts from host to container during runtime

6 years agonspawn: fix invocation of the raw clone() system call on s390 and cris
Ken Werner [Tue, 16 Dec 2014 17:06:41 +0000 (18:06 +0100)]
nspawn: fix invocation of the raw clone() system call on s390 and cris

Since the order of the first and second arguments of the raw clone() system
call is reversed on s390 and cris it needs to be invoked differently.

6 years agohwdb: add Lenovo 3000 N200 special key
Marc Schmitzer [Wed, 17 Dec 2014 03:14:40 +0000 (22:14 -0500)]
hwdb: add Lenovo 3000 N200 special key

6 years agopath: follow symbolic link for parent path
Umut Tezduyar Lindskog [Tue, 16 Dec 2014 20:58:39 +0000 (21:58 +0100)]
path: follow symbolic link for parent path

[zj: When we lstat the target path, symlinks above the last component
     will be followed by both stat and lstat. So when we look at the
     parent, we should follow symlinks.]

6 years agoshared: strv - add strv_clear()
Tom Gundersen [Wed, 17 Dec 2014 00:08:56 +0000 (01:08 +0100)]
shared: strv - add strv_clear()

This frees the elements of the strv without freeing the strv itself.

6 years agoshared: path-util - memory leak
Tom Gundersen [Tue, 16 Dec 2014 21:24:54 +0000 (22:24 +0100)]
shared: path-util - memory leak

6 years agoudev: net_setup - fix warning
Tom Gundersen [Tue, 16 Dec 2014 20:49:06 +0000 (21:49 +0100)]
udev: net_setup - fix warning

6 years agotest-json: use fabs
Thomas Hindoe Paaboel Andersen [Tue, 16 Dec 2014 19:36:40 +0000 (20:36 +0100)]
test-json: use fabs

6 years agofix compiler warning
Susant Sahani [Tue, 16 Dec 2014 03:18:34 +0000 (08:48 +0530)]
fix compiler warning

src/shared/utf8.c:268:13: warning: unused variable 'd'
         int d;

6 years agosystemctl: fix argument handling when invoked as "shutdown"
Jan Synacek [Mon, 15 Dec 2014 09:39:00 +0000 (10:39 +0100)]
systemctl: fix argument handling when invoked as "shutdown"

6 years agonss-myhostname: also recognize "gateway."
Harald Hoyer [Mon, 15 Dec 2014 10:34:24 +0000 (11:34 +0100)]
nss-myhostname: also recognize "gateway."

"gateway." skips adding the domain search path and saves some queries to
the nameserver.

6 years agoUpdate TODO
Zbigniew Jędrzejewski-Szmek [Tue, 16 Dec 2014 05:22:58 +0000 (00:22 -0500)]
Update TODO

6 years agosystemctl: refuse to edit runtime dropins when they already exist in /etc
Zbigniew Jędrzejewski-Szmek [Tue, 16 Dec 2014 04:01:05 +0000 (23:01 -0500)]
systemctl: refuse to edit runtime dropins when they already exist in /etc

The check for existing unit files and dropins is unified.

path_join() is updated to not insert duplicate separators.

6 years agosystemctl: share path lookup between 'cat' and 'edit'
Zbigniew Jędrzejewski-Szmek [Sat, 13 Dec 2014 21:38:35 +0000 (16:38 -0500)]
systemctl: share path lookup between 'cat' and 'edit'

'systemctl cat' now works for templates too.

'systemctl edit' does not refuse to edit units that have changed on
disk. That restriction didn't seem useful, actually editing units that
have changed on disk before they are started is very reasonable.

'edit' with instances and templates works again:


$ build/systemctl edit getty@
Failed to copy /etc/systemd/system/getty@.service.d/override.conf to /etc/systemd/system/getty@.service.d/.override.confdff6290408c86369: Permission denied
$ build/systemctl edit getty@tty3
Failed to create directories for /etc/systemd/system/getty@tty3.service.d/override.conf: Permission denied
$ build/systemctl edit --full getty@tty3
Failed to copy /usr/lib/systemd/system/getty@.service to /etc/systemd/system/.getty@tty3.serviced3d175087e7e439b: Permission denied
Failed to create temporary file for /etc/systemd/system/getty@tty3.service: Permission denied
$ build/systemctl edit --full getty@
Failed to copy /usr/lib/systemd/system/getty@.service to /etc/systemd/system/.getty@.servicea3caad491c0f2f3d: Permission denied
Failed to create temporary file for /etc/systemd/system/getty@.service: Permission denied

6 years agosystemctl: split out LookupPaths initialization
Zbigniew Jędrzejewski-Szmek [Tue, 16 Dec 2014 05:28:43 +0000 (00:28 -0500)]
systemctl: split out LookupPaths initialization

6 years agosystemctl: move two functions up
Zbigniew Jędrzejewski-Szmek [Tue, 16 Dec 2014 05:28:41 +0000 (00:28 -0500)]
systemctl: move two functions up

No functional change.

6 years agosystemctl: unify warning about unit files changed on disk
Zbigniew Jędrzejewski-Szmek [Tue, 16 Dec 2014 04:28:38 +0000 (23:28 -0500)]
systemctl: unify warning about unit files changed on disk

6 years agosystemctl: do not use -1 for return code
Zbigniew Jędrzejewski-Szmek [Sat, 13 Dec 2014 17:43:07 +0000 (12:43 -0500)]
systemctl: do not use -1 for return code

Also make the error messages more specific to give a hint to the user
how to solve the problem.

6 years agoMove dropin listing to shared
Zbigniew Jędrzejewski-Szmek [Mon, 15 Dec 2014 04:12:40 +0000 (23:12 -0500)]
Move dropin listing to shared

No functional change. This is in preparation for using this in
systemctl in the future.

6 years agohwdb: Logitech MX1000, another Lenovo USB mouse
Peter Hutterer [Tue, 16 Dec 2014 05:08:07 +0000 (15:08 +1000)]
hwdb: Logitech MX1000, another Lenovo USB mouse

Provided by Benjamin Bellec

6 years agohwdb: more an entry for the MS Sculpt Ergonomic
Peter Hutterer [Thu, 11 Dec 2014 07:33:14 +0000 (17:33 +1000)]
hwdb: more an entry for the MS Sculpt Ergonomic

Note that the MS receivers likely work like the Logitech ones, i.e. all
devices connected show up with the same vid/pid/name. Full evidence remains to
be gathered.

6 years agoshared: add minimal JSON tokenizer
Lennart Poettering [Mon, 15 Dec 2014 21:26:56 +0000 (22:26 +0100)]
shared: add minimal JSON tokenizer

6 years agoudev: builtin-hwdb - port to sd-hwdb
Tom Gundersen [Mon, 15 Dec 2014 18:58:25 +0000 (19:58 +0100)]
udev: builtin-hwdb - port to sd-hwdb

6 years agoudevadm: port to sd-hwdb
Tom Gundersen [Mon, 15 Dec 2014 18:48:21 +0000 (19:48 +0100)]
udevadm: port to sd-hwdb

6 years agonetworkctl: port from libudev to sd-hwdb
Tom Gundersen [Mon, 15 Dec 2014 19:07:34 +0000 (20:07 +0100)]
networkctl: port from libudev to sd-hwdb

6 years agoupdate TODO
Lennart Poettering [Mon, 15 Dec 2014 17:48:20 +0000 (18:48 +0100)]
update TODO

6 years agounit: handle nicely of certain unit types are not supported on specific systems
Lennart Poettering [Fri, 12 Dec 2014 20:05:32 +0000 (21:05 +0100)]
unit: handle nicely of certain unit types are not supported on specific systems

Containers do not really support .device, .automount or .swap units;
Systems compiled without support for swap do not support .swap units;
Systems without kdbus do not support .busname units.

With this change attempts to start a unsupported unit types will result
in an immediate "unsupported" job result, which is a lot more
descriptive then before. Also, attempts to start device units in
containers will now immediately fail instead of causing jobs to be
enqueued that never go away.

6 years agonetworkd: failing to track links is a serious problem so log at warning level rather...
Tom Gundersen [Mon, 15 Dec 2014 16:57:51 +0000 (17:57 +0100)]
networkd: failing to track links is a serious problem so log at warning level rather than debug

6 years agohwdb: fix ordering
Daniel Mack [Mon, 15 Dec 2014 16:15:16 +0000 (17:15 +0100)]
hwdb: fix ordering

We sort by default DPI, not the first one in the list.

6 years agohwdb: Logitech G400s
Daniel Mack [Mon, 15 Dec 2014 16:11:31 +0000 (17:11 +0100)]
hwdb: Logitech G400s

Provided by Peter Hutterer:

6 years agohwdb: Logitech MX 518
Harald Hoyer [Mon, 15 Dec 2014 10:26:38 +0000 (11:26 +0100)]
hwdb: Logitech MX 518

6 years agoshared: time-dst: Avoid buffer overflow
Martin Pitt [Mon, 15 Dec 2014 12:06:48 +0000 (13:06 +0100)]
shared: time-dst: Avoid buffer overflow

Commit 681f9718 introduced an additional null terminator for the zone names.
Increase the allocation of "transitions" to actually make room for this.

6 years agoblkid: Warn when rejecting a superblock with a bad csum
Gabriel de Perthuis [Sat, 13 Dec 2014 00:56:56 +0000 (01:56 +0100)]
blkid: Warn when rejecting a superblock with a bad csum

Bump libblkid requirement from 2.20 to 2.24.
util-linux 2.25 is actually required since fdbbad981cc5da8bb4ed7e9b6646e7a114745ec5

6 years agodelta: fix output alignment of [REDIRECTED] entries
Ivan Shapovalov [Sun, 14 Dec 2014 13:04:01 +0000 (16:04 +0300)]
delta: fix output alignment of [REDIRECTED] entries

6 years agobuild-sys: remove commented-out m4 from user@.service
Mantas Mikulėnas [Sun, 14 Dec 2014 17:12:34 +0000 (19:12 +0200)]
build-sys: remove commented-out m4 from user@.service

Otherwise this actually remains in the generated unit in /usr/lib.

If you want to keep it commented out, a m4-compatible way would be:

    dnl Capabilities=cap_mac_admin=i
    dnl SecureBits=keep-caps

6 years agobuild-sys: fix distcheck
Dave Reisner [Sun, 14 Dec 2014 15:55:16 +0000 (10:55 -0500)]
build-sys: fix distcheck

- fix misspelling in filename (intenal -> internal)
- remove deleted hwdb-related file (nuked with sd-hwdb refactor)

6 years agobuild-sys: always distribute
Dave Reisner [Sun, 14 Dec 2014 15:40:25 +0000 (10:40 -0500)]
build-sys: always distribute

Similar to how we handle other facilities that can be flagged out at
configure time, we should always distribute this input file.

6 years agosystemctl: handle correctly template units for edit verb
Ronny Chevalier [Sat, 13 Dec 2014 14:14:48 +0000 (15:14 +0100)]
systemctl: handle correctly template units for edit verb

Previously, if we provided getty@.service to systemctl edit it would
have failed when using the bus because it is an invalid unit name.
But it would have succeeded when searching in the filesystem.

Now, we check if we have a template, if we do we search in the
filesystem, if we don't have a templae and we can use the bus, we do.

Furthermore, if we provided getty@tty1.service it would not have worked
when searching the filesystem, but it would have worked with the bus.
So now, when using the filesystem we use the template name and not the
unit name, and the same when logging errors.

(Also did a refactoring to avoid a long function)

6 years agotest-unit-name: add more tests
Ronny Chevalier [Sat, 13 Dec 2014 14:12:38 +0000 (15:12 +0100)]
test-unit-name: add more tests

Add more test cases for:
- unit_name_is_instance
- unit_name_to_instance

Add tests for:
- unit_name_template
- unit_name_is_template

6 years agojournal: replace contexts hashmap with a plain array
Michal Schmidt [Wed, 3 Dec 2014 17:25:44 +0000 (18:25 +0100)]
journal: replace contexts hashmap with a plain array

try_context() is such a hot path that the hashmap lookup is expensive.

The number of contexts is small - it is the number of object types.
Using a hashmap is overkill. A plain array will do.

$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null

real    0m9.445s
user    0m9.228s
sys     0m0.213s

$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null
real    0m5.438s
user    0m5.266s
sys     0m0.170s

6 years agojournal: delete unused function mmap_cache_close_context
Michal Schmidt [Wed, 3 Dec 2014 17:23:23 +0000 (18:23 +0100)]
journal: delete unused function mmap_cache_close_context

This never had any callers. Contexts are freed when the MMapCache is

6 years agojournal: push type_to_context conversion down to journal_file_move_to()
Michal Schmidt [Fri, 12 Dec 2014 22:20:05 +0000 (23:20 +0100)]
journal: push type_to_context conversion down to journal_file_move_to()

6 years agojournal: have a named enum ObjectType
Michal Schmidt [Wed, 10 Dec 2014 14:18:49 +0000 (15:18 +0100)]
journal: have a named enum ObjectType

6 years agojournal: consistently use OBJECT_<type> names instead of numbers
Michal Schmidt [Fri, 12 Dec 2014 21:51:24 +0000 (22:51 +0100)]
journal: consistently use OBJECT_<type> names instead of numbers

Note that numbers 0 and -1 are both replaced with OBJECT_UNUSED,
because they are treated the same everywhere (e.g. type_to_context()
translates them both to 0).

6 years agojournal: consistently allow type==0 to mean "any type"
Michal Schmidt [Wed, 10 Dec 2014 15:37:29 +0000 (16:37 +0100)]
journal: consistently allow type==0 to mean "any type"

If type==0 and a non-NULL object were given as arguments to
journal_file_hmac_put_object(), its object type check would fail and it
would return -EBADMSG.

All existing callers use either a positive type or -1. Still, for
behavior consistency with journal_file_move_to_object() let's allow
type 0 to pass.

6 years agojournal: move type_to_context() to journal-file.c
Michal Schmidt [Fri, 12 Dec 2014 17:06:22 +0000 (18:06 +0100)]
journal: move type_to_context() to journal-file.c

It has no other callers. It does not need to be in the header file.

6 years agojournal: remove journal_file_object_keep/release functions
Michal Schmidt [Fri, 12 Dec 2014 20:52:18 +0000 (21:52 +0100)]
journal: remove journal_file_object_keep/release functions

The only user is sd_journal_enumerate_unique() and, as explained in
the previous commit (fed67c38e3 "journal: map objects to context set by
caller, not by actual object type"), the use of them there is now
superfluous. Let's remove them.

This reverts major parts of commits:
  ae97089d49 journal: fix access to munmapped memory in
  06cc69d44c sd-journal: fix sd_journal_enumerate_unique skipping values

Tested with an "--enable-debug" build and "journalctl --list-boots".
It gives the expected number of results. Additionally, if I then revert
the previous commit ("journal: map objects to context set by caller, not
to actual object type"), it crashes with SIGSEGV, as expected.

6 years agojournal: map objects to context set by caller, not by actual object type
Michal Schmidt [Fri, 12 Dec 2014 17:21:55 +0000 (18:21 +0100)]
journal: map objects to context set by caller, not by actual object type

When the caller of journal_file_move_to_object() specifies type==0,
the object header is at first mapped in context 0. Then after the header
is checked, the whole object is mapped in a context determined by
the actual object type (which is not even range-checked using
type_to_context()). This looks wrong. It should map in the
caller-specified context.

An old comment in sd_journal_enumerate_unique() supports this view:
    /* We do not use the type context here, but 0 instead,
     * so that we can look at this data object at the same
     * time as one on another file */
Clearly the expectation was that the data object will remain mapped
in context 0 without being pushed away by mapping other objects in
context OBJECT_DATA.

I suspect that this was the real bug that got fixed by ae97089d49
"journal: fix access to munmapped memory in sd_journal_enumerate_unique".
In other words, journal_file_object_keep/release are superfluous after
applying this patch.

6 years agojournal: add debug mode for mmap-cache (--enable-debug=mmap-cache)
Michal Schmidt [Fri, 12 Dec 2014 16:57:22 +0000 (17:57 +0100)]
journal: add debug mode for mmap-cache (--enable-debug=mmap-cache)

This is useful for exposing unsafe access to mmapped objects after
the context that they were mapped in was already moved.

For example:
journal_file_move_to_object(f1, OBJECT_DATA, p1, &o1);
journal_file_move_to_object(f2, OBJECT_DATA, p2, &o2);
t = o1->object.type; /* this usually works, but is unsafe */

6 years add a generic --enable-debug, replace --enable-hashmap-debug
Michal Schmidt [Fri, 12 Dec 2014 16:48:13 +0000 (17:48 +0100)] add a generic --enable-debug, replace --enable-hashmap-debug

There will be more debugging options later.
 --enable-debug will enable them all.
 --enable-debug=hashmap will enable only hashmap debugging.

Also rename the C #define to ENABLE_DEBUG_* pattern.

6 years agoshared/hashmap.h: fix comment
Michal Schmidt [Fri, 12 Dec 2014 16:42:28 +0000 (17:42 +0100)]
shared/hashmap.h: fix comment

An early version used underscore prefixes for internal functions, but
the current version uses the prefix "internal_".

6 years agohwdb: add more mice
Zbigniew Jędrzejewski-Szmek [Fri, 12 Dec 2014 23:20:51 +0000 (18:20 -0500)]
hwdb: add more mice

6 years agohwdb: sort mice by brand,type,dpi,frequency
Zbigniew Jędrzejewski-Szmek [Fri, 12 Dec 2014 23:16:45 +0000 (18:16 -0500)]
hwdb: sort mice by brand,type,dpi,frequency

This way entries from the same brand with the same dpi and frequency
can be coalesced. It is also visually easier to find the right DPI
than order hexadecimal identifiers.