summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-12-13journal: remove journal_file_object_keep/release functionsMichal Schmidt
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.
2014-12-13journal: map objects to context set by caller, not by actual object typeMichal Schmidt
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.
2014-12-13journal: add debug mode for mmap-cache (--enable-debug=mmap-cache)Michal Schmidt
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 */
2014-12-13configure.ac: add a generic --enable-debug, replace --enable-hashmap-debugMichal Schmidt
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.
2014-12-13shared/hashmap.h: fix commentMichal Schmidt
An early version used underscore prefixes for internal functions, but the current version uses the prefix "internal_".
2014-12-12networkctl: remove unused variableThomas Hindoe Paaboel Andersen
2014-12-12wrap a few *_FOREACH macros in curly bracesThomas Hindoe Paaboel Andersen
cppcheck would give up with "syntax error" without them. This led to reports of syntax errors in unrelated locations and potentially hid other errors
2014-12-12core: retry unmounting until we are done, in case of stacked mountsLennart Poettering
2014-12-12networkctl: also draw a nice unicode cirlce when "networkctl status" is run ↵Lennart Poettering
without parameters
2014-12-12networkctl: show interface names next to IP addresses if we dump adresses ↵Lennart Poettering
from all interfaces
2014-12-12networkctl: also show gateway address when "networkctl status" without ↵Lennart Poettering
further arguments is passed
2014-12-12networkctl: show MAC address OUI vendor next to MAC addressesLennart Poettering
2014-12-12test-cap-list: always check libcap comes to the same names as we do, for the ↵Lennart Poettering
names it knows
2014-12-12cap-list: return lower-case capability names, similar to libcap's ↵Lennart Poettering
cap_to_name(), for compat reasons
2014-12-12nspawn: when booting in ephemeral mode, append random token to machine nameLennart Poettering
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.
2014-12-12nspawn: allow spawning ephemeral nspawn containers based on the root file ↵Lennart Poettering
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!
2014-12-12nspawn: don't link journals in ephemeral modeLennart Poettering
2014-12-12nspawn: properly unset arg_link_journal_try, when --link-journal= is specifiedLennart Poettering
2014-12-12copy: use btrfs reflinking only whe we know we copy full filesLennart Poettering
2014-12-12bus: send attach flags on BUS_MAKEDavid Herrmann
Make sure to set send-attach-flags on BUS_MAKE. These control which information is revealed about the bus-owner.
2014-12-12bus: fix assert() on HELLO error-pathDavid Herrmann
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.
2014-12-12nspawn: beef up nspawn with some btrfs magicLennart Poettering
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.
2014-12-12copy: teach copy_bytes() btrfs reflink magicLennart Poettering
2014-12-12gpt-auto-generator: make use of new btrfs-util.h APIsLennart Poettering
2014-12-12shared: add new btrfs-util.[ch] helpers for doing common btrfs operationLennart Poettering
2014-12-12shared: missing.h should include btrfs.h, before redefining some of its ↵Lennart Poettering
definitions
2014-12-12util: minor simplification for loop_write() and loop_read()Lennart Poettering
2014-12-12nspawn: properly validate machine namesLennart Poettering
2014-12-12seccomp-util.h: make sure seccomp-util.h can be included aloneLennart Poettering
2014-12-12path-util: no need to check whether p is absolute twiceLennart Poettering
2014-12-12udev-builtin-btrfs: properly initialize ioctl struct to zeroesLennart Poettering
2014-12-12util: document why we have alloca_align()Lennart Poettering
2014-12-12util: when using basename() for creating temporary files, verify the ↵Lennart Poettering
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.
2014-12-12journal: fix dangling 'else' ambiguityDavid Herrmann
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
2014-12-12hwdb: fix dangling 'else' ambuguityDavid Herrmann
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.
2014-12-12hwdb: FOREACH_HWDB_PROPERTY -> SD_HWDB_FOREACH_PROPERTYDavid Herrmann
Lets not pollute the global namespace. Prefix all our exported names and macros with SD_HWDB_*.
2014-12-11use correct format typesThomas Hindoe Paaboel Andersen
2014-12-11test-condition: add more test casesRonny Chevalier
2014-12-11test-strv: add test for strv_equalRonny Chevalier
2014-12-11test-execute: add tests for UMask directiveRonny Chevalier
2014-12-11test-unit-name: add tests for %fRonny Chevalier
2014-12-11bus: sync with kdbus.gitDavid Herrmann
Changes: * bloom parameters are returned in an offset via HELLO * FREE now takes items just like any other ioctl
2014-12-11tree-wide: use our memset() macros instead of memset() itselfLennart Poettering
2014-12-11treewide: correct spacing near eol in code commentsTorstein Husebø
2014-12-11core: correct spacing near eol in code commentsTorstein Husebø
2014-12-11shared: correct spacing near eol in code commentsTorstein Husebø
2014-12-11journald: correct spacing near eol code commentsTorstein Husebø
2014-12-11sd-bus: correct spacing near eol in code commentsTorstein Husebø
2014-12-11networkd/resolved: correct spacing near eol in code commentsTorstein Husebø
2014-12-11sd-dhcp-client: log if we fail to set up lease timersTom Gundersen