Lennart Poettering [Mon, 15 Dec 2014 21:26:56 +0000 (22:26 +0100)]
shared: add minimal JSON tokenizer
Tom Gundersen [Mon, 15 Dec 2014 18:58:25 +0000 (19:58 +0100)]
udev: builtin-hwdb - port to sd-hwdb
Tom Gundersen [Mon, 15 Dec 2014 18:48:21 +0000 (19:48 +0100)]
udevadm: port to sd-hwdb
Tom Gundersen [Mon, 15 Dec 2014 19:07:34 +0000 (20:07 +0100)]
networkctl: port from libudev to sd-hwdb
Lennart Poettering [Mon, 15 Dec 2014 17:48:20 +0000 (18:48 +0100)]
update TODO
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.
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
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.
Daniel Mack [Mon, 15 Dec 2014 16:11:31 +0000 (17:11 +0100)]
hwdb: Logitech G400s
Provided by Peter Hutterer:
https://bugs.freedesktop.org/show_bug.cgi?id=87332
Harald Hoyer [Mon, 15 Dec 2014 10:26:38 +0000 (11:26 +0100)]
hwdb: Logitech MX 518
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.
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
Ivan Shapovalov [Sun, 14 Dec 2014 13:04:01 +0000 (16:04 +0300)]
delta: fix output alignment of [REDIRECTED] entries
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:
m4_ifdef(`HAVE_SMACK',
dnl Capabilities=cap_mac_admin=i
dnl SecureBits=keep-caps
)
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)
Dave Reisner [Sun, 14 Dec 2014 15:40:25 +0000 (10:40 -0500)]
build-sys: always distribute systemd-consoled.service.in
Similar to how we handle other facilities that can be flagged out at
configure time, we should always distribute this input file.
http://lists.freedesktop.org/archives/systemd-devel/2014-December/026272.html
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)
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
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.
Before:
$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null
real 0m9.445s
user 0m9.228s
sys 0m0.213s
After:
$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null
real 0m5.438s
user 0m5.266s
sys 0m0.170s
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
freed.
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()
Michal Schmidt [Wed, 10 Dec 2014 14:18:49 +0000 (15:18 +0100)]
journal: have a named enum ObjectType
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).
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.
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.
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
sd_journal_enumerate_unique
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.
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.
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 */
Michal Schmidt [Fri, 12 Dec 2014 16:48:13 +0000 (17:48 +0100)]
configure.ac: 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.
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_".
Zbigniew Jędrzejewski-Szmek [Fri, 12 Dec 2014 23:20:51 +0000 (18:20 -0500)]
hwdb: add more mice
https://bugs.freedesktop.org/show_bug.cgi?id=87271
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.
Thomas Hindoe Paaboel Andersen [Fri, 12 Dec 2014 20:53:28 +0000 (21:53 +0100)]
networkctl: remove unused variable
Thomas Hindoe Paaboel Andersen [Fri, 12 Dec 2014 18:51:41 +0000 (19:51 +0100)]
wrap a few *_FOREACH macros in curly braces
cppcheck would give up with "syntax error" without them. This led
to reports of syntax errors in unrelated locations and potentially
hid other errors
Lennart Poettering [Fri, 12 Dec 2014 19:24:35 +0000 (20:24 +0100)]
update TODO
Lennart Poettering [Fri, 12 Dec 2014 19:12:35 +0000 (20:12 +0100)]
core: retry unmounting until we are done, in case of stacked mounts
Lennart Poettering [Fri, 12 Dec 2014 18:11:35 +0000 (19:11 +0100)]
networkctl: also draw a nice unicode cirlce when "networkctl status" is run without parameters
Lennart Poettering [Fri, 12 Dec 2014 18:07:26 +0000 (19:07 +0100)]
networkctl: show interface names next to IP addresses if we dump adresses from all interfaces
Lennart Poettering [Fri, 12 Dec 2014 17:57:15 +0000 (18:57 +0100)]
networkctl: also show gateway address when "networkctl status" without further arguments is passed
Lennart Poettering [Fri, 12 Dec 2014 17:50:06 +0000 (18:50 +0100)]
networkctl: show MAC address OUI vendor next to MAC addresses
Lennart Poettering [Fri, 12 Dec 2014 17:42:19 +0000 (18:42 +0100)]
test-cap-list: always check libcap comes to the same names as we do, for the names it knows
Lennart Poettering [Fri, 12 Dec 2014 17:37:25 +0000 (18:37 +0100)]
cap-list: return lower-case capability names, similar to libcap's cap_to_name(), for compat reasons
Lennart Poettering [Fri, 12 Dec 2014 16:30:02 +0000 (17:30 +0100)]
update TODO
Lennart Poettering [Fri, 12 Dec 2014 16:29:12 +0000 (17:29 +0100)]
man: fedora 21 has been release, suggest 21 as fedora version in example yum command line
Lennart Poettering [Fri, 12 Dec 2014 16:26:31 +0000 (17:26 +0100)]
nspawn: when booting in ephemeral mode, append random token to machine name
Also, when booting up an ephemeral container of / use the system
hostname as default machine name.
This way specifiyng -M is unnecessary when booting up an ephemeral
container, while allowing any number of ephemeral containers to run from
the same tree.
Lennart Poettering [Fri, 12 Dec 2014 15:59:15 +0000 (16:59 +0100)]
nspawn: allow spawning ephemeral nspawn containers based on the root file system of the OS
This works now:
# systemd-nspawn -xb -D / -M foobar
Which boots up an ephemeral container, based on the host's root file
system. Or in other words: you can now run the very same host OS you
booted your system with also in a container, on top of it, without
having it interfere. Great for testing whether the init system you are
hacking on still boots without reboot the system!
Lennart Poettering [Fri, 12 Dec 2014 15:58:57 +0000 (16:58 +0100)]
nspawn: don't link journals in ephemeral mode
Lennart Poettering [Fri, 12 Dec 2014 15:58:30 +0000 (16:58 +0100)]
nspawn: properly unset arg_link_journal_try, when --link-journal= is specified
Lennart Poettering [Fri, 12 Dec 2014 15:24:33 +0000 (16:24 +0100)]
copy: use btrfs reflinking only whe we know we copy full files
David Herrmann [Fri, 12 Dec 2014 13:02:57 +0000 (14:02 +0100)]
bus: send attach flags on BUS_MAKE
Make sure to set send-attach-flags on BUS_MAKE. These control which
information is revealed about the bus-owner.
David Herrmann [Fri, 12 Dec 2014 13:02:05 +0000 (14:02 +0100)]
bus: fix assert() on HELLO error-path
Make sure we don't call into any bus_kernel_*() functions before
b->is_kernel is set to true. Hard-code the CMD_FREE just like the other
helpers do.
Lennart Poettering [Fri, 12 Dec 2014 02:50:59 +0000 (03:50 +0100)]
nspawn: beef up nspawn with some btrfs magic
This adds --template= to duplicate an OS tree as btrfs snpashot and run
it
This also adds --ephemeral or -x to create a snapshot of an OS tree and
boot that, removing it after exit.
Lennart Poettering [Fri, 12 Dec 2014 02:20:53 +0000 (03:20 +0100)]
copy: teach copy_bytes() btrfs reflink magic
Lennart Poettering [Fri, 12 Dec 2014 02:20:34 +0000 (03:20 +0100)]
gpt-auto-generator: make use of new btrfs-util.h APIs
Lennart Poettering [Fri, 12 Dec 2014 02:15:58 +0000 (03:15 +0100)]
shared: add new btrfs-util.[ch] helpers for doing common btrfs operation
Lennart Poettering [Fri, 12 Dec 2014 02:13:48 +0000 (03:13 +0100)]
shared: missing.h should include btrfs.h, before redefining some of its definitions
Lennart Poettering [Fri, 12 Dec 2014 02:12:58 +0000 (03:12 +0100)]
util: minor simplification for loop_write() and loop_read()
Lennart Poettering [Fri, 12 Dec 2014 01:49:40 +0000 (02:49 +0100)]
nspawn: properly validate machine names
Lennart Poettering [Fri, 12 Dec 2014 01:35:39 +0000 (02:35 +0100)]
seccomp-util.h: make sure seccomp-util.h can be included alone
Lennart Poettering [Fri, 12 Dec 2014 01:35:14 +0000 (02:35 +0100)]
path-util: no need to check whether p is absolute twice
Lennart Poettering [Fri, 12 Dec 2014 01:34:12 +0000 (02:34 +0100)]
udev-builtin-btrfs: properly initialize ioctl struct to zeroes
Lennart Poettering [Fri, 12 Dec 2014 01:33:48 +0000 (02:33 +0100)]
util: document why we have alloca_align()
Lennart Poettering [Fri, 12 Dec 2014 01:32:33 +0000 (02:32 +0100)]
util: when using basename() for creating temporary files, verify the resulting name is actually valid
Also, rename filename_is_safe() to filename_is_valid(), since it
actually does a full validation for what the kernel will accept as file
name, it's not just a heuristic.
David Herrmann [Fri, 12 Dec 2014 08:52:06 +0000 (09:52 +0100)]
journal: fix dangling 'else' ambiguity
Rework the sd-journal iterators to avoid dangling 'else' ambiguity. For a
detailed explanation, see:
commit
bff686e2a981ccd0888cdf1981977d24320f1770
Author: David Herrmann <dh.herrmann@gmail.com>
Date: Fri Dec 12 09:43:54 2014 +0100
hwdb: fix dangling 'else' ambuguity
David Herrmann [Fri, 12 Dec 2014 08:43:54 +0000 (09:43 +0100)]
hwdb: fix dangling 'else' ambuguity
Imagine the following use of hwdb:
if (condition_A)
SD_HWDB_FOREACH_PROPERTY(hwdb, modalias, key, value)
operation_A(key, value);
else
log_error("...");
This should work just fine, but but definitely does not what you would
expect. Due to how SD_HWDB_FOREACH_PROPERTY is defined, the dangling
'else' is linked to the hidden 'if' statement in the macro instead of the
outer 'if (condition_A)'. This is unexpected and really annoying to debug.
Fix this by never leaving un-finished if-statements in
SD_HWDB_FOREACH_PROPERTY(). We simply inverse the if() statement and
explicitly add an 'else'-branch. This way, the statement is closed and all
ambuguities are resolved.
David Herrmann [Fri, 12 Dec 2014 08:30:50 +0000 (09:30 +0100)]
hwdb: FOREACH_HWDB_PROPERTY -> SD_HWDB_FOREACH_PROPERTY
Lets not pollute the global namespace. Prefix all our exported names and
macros with SD_HWDB_*.
Marcel Holtmann [Thu, 11 Dec 2014 21:50:50 +0000 (22:50 +0100)]
hwdb: Update database of Bluetooth company identifiers
Thomas Hindoe Paaboel Andersen [Wed, 10 Dec 2014 19:24:18 +0000 (20:24 +0100)]
use correct format types
Ronny Chevalier [Thu, 11 Dec 2014 17:30:37 +0000 (18:30 +0100)]
test-condition: add more test cases
Ronny Chevalier [Thu, 11 Dec 2014 17:30:16 +0000 (18:30 +0100)]
test-strv: add test for strv_equal
Ronny Chevalier [Thu, 11 Dec 2014 16:59:10 +0000 (17:59 +0100)]
test-execute: add tests for UMask directive
Ronny Chevalier [Thu, 11 Dec 2014 16:58:40 +0000 (17:58 +0100)]
test-unit-name: add tests for %f
David Herrmann [Thu, 11 Dec 2014 16:25:09 +0000 (17:25 +0100)]
bus: sync with kdbus.git
Changes:
* bloom parameters are returned in an offset via HELLO
* FREE now takes items just like any other ioctl
Lennart Poettering [Thu, 11 Dec 2014 15:58:45 +0000 (16:58 +0100)]
tree-wide: use our memset() macros instead of memset() itself
Torstein Husebø [Wed, 10 Dec 2014 19:00:09 +0000 (20:00 +0100)]
treewide: correct spacing near eol in code comments
Torstein Husebø [Wed, 10 Dec 2014 19:00:08 +0000 (20:00 +0100)]
core: correct spacing near eol in code comments
Torstein Husebø [Wed, 10 Dec 2014 19:00:07 +0000 (20:00 +0100)]
shared: correct spacing near eol in code comments
Torstein Husebø [Wed, 10 Dec 2014 19:00:06 +0000 (20:00 +0100)]
journald: correct spacing near eol code comments
Torstein Husebø [Wed, 10 Dec 2014 19:00:05 +0000 (20:00 +0100)]
sd-bus: correct spacing near eol in code comments
Torstein Husebø [Wed, 10 Dec 2014 19:00:04 +0000 (20:00 +0100)]
networkd/resolved: correct spacing near eol in code comments
Lennart Poettering [Thu, 11 Dec 2014 13:56:33 +0000 (14:56 +0100)]
build-sys: fix user unit m4 logic
Lennart Poettering [Thu, 11 Dec 2014 00:53:43 +0000 (01:53 +0100)]
update TODO
Tom Gundersen [Thu, 11 Dec 2014 13:43:09 +0000 (14:43 +0100)]
sd-dhcp-client: log if we fail to set up lease timers
Tom Gundersen [Thu, 11 Dec 2014 13:17:35 +0000 (14:17 +0100)]
tests: udev - assume /etc/machine-id rather than /etc/hosts
On todays machines /etc/hosts is not mandatory. /etc/machine-id is though, so let's rely on that instead.
This makes the udev tests pass again for me.
Tom Gundersen [Wed, 3 Dec 2014 16:32:40 +0000 (17:32 +0100)]
libudev: make libudev-hwdb a wrapper around sd-hwdb
Tom Gundersen [Wed, 3 Dec 2014 16:02:34 +0000 (17:02 +0100)]
libsystemd: add sd-hwdb library
This is libudev-hwdb, but decoupled from libudev and in the libsystemd style.
The core code is unchanged, apart from the following minor changes:
- hwdb.bin located in /**/systemd/hwdb/ take preference over the ones located
in /**/udev/
- properties are stored internally in an OrderedHashmap, rather than a
linked list.
- a new API call allows individual properties to be queried directly, rather
than iterating over them all
- the iteration over properties have been moved inside the library, rather than
exposing a list directly
- the unused 'flags' parameter was dropped
David Herrmann [Thu, 11 Dec 2014 12:19:41 +0000 (13:19 +0100)]
bus: sync with kdbus.git
Sync up with recent kdbus changed:
* several ioctls gained .size and .items members (but still unused)
* CMD_SEND gained its own ioctl structure
* several members of kdbus_msg were dropped as they were only used during
SEND, not during RECV etc.
* CMD_RECV and CMD_SEND now share a kdbus_reply member which contains the
offset and size of the returned message.
David Herrmann [Thu, 11 Dec 2014 09:45:58 +0000 (10:45 +0100)]
bus: zero cmd_free before passing to ioctl
Make sure the whole cmd_free object is zeroed before passing it into the
kernel. This makes valgrind happy and makes us future proof.
David Herrmann [Thu, 11 Dec 2014 09:44:41 +0000 (10:44 +0100)]
bus: fix memfd-cache regarding memfd offsets
We must restore part->mmap_begin when poping memfds from the memfd-cache.
We rely on the memfds to be unsealed, so we can be sure that we own the
whole FD. Therefore, simply set part->mmap_begin to the same as
part->data.
This fixes test-bus-kernel-benchmark.
David Herrmann [Thu, 11 Dec 2014 08:01:34 +0000 (09:01 +0100)]
TODO: update
Drop resolved kdbus issues.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Dec 2014 05:02:54 +0000 (00:02 -0500)]
localectl,man: make it obvious that set-*-keymaps sets both keymaps
https://bugs.freedesktop.org/show_bug.cgi?id=85411
Zbigniew Jędrzejewski-Szmek [Wed, 10 Dec 2014 22:34:41 +0000 (17:34 -0500)]
zsh-completion: remove duplicate function
https://bugs.archlinux.org/task/43069
Lennart Poettering [Wed, 10 Dec 2014 22:19:55 +0000 (23:19 +0100)]
build-sys: update Lennart's private target
Lennart Poettering [Wed, 10 Dec 2014 22:17:54 +0000 (23:17 +0100)]
NEWS: minor wording improvement
Lennart Poettering [Wed, 10 Dec 2014 22:01:13 +0000 (23:01 +0100)]
build-sys: add missing file to CLEANFILES
Lennart Poettering [Wed, 10 Dec 2014 21:33:21 +0000 (22:33 +0100)]
NEWS: update contributors list
Lennart Poettering [Wed, 10 Dec 2014 21:31:27 +0000 (22:31 +0100)]
build-sys: bump package and library versions in preparation for 218 release
Lennart Poettering [Wed, 10 Dec 2014 21:10:46 +0000 (22:10 +0100)]
build-sys: turn off SMACK capabilities stuff for now, since it is incompatible with nspawn
Lennart Poettering [Wed, 10 Dec 2014 21:08:49 +0000 (22:08 +0100)]
update TODO
Lennart Poettering [Wed, 10 Dec 2014 21:06:44 +0000 (22:06 +0100)]
scope: make attachment of initial PIDs a bit more robust