summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* test-unit-file: add test for semicolon escapingZbigniew Jędrzejewski-Szmek2014-12-18
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=87393
* load-fragment: properly unescape \;tomsod-m ya ru2014-12-17
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=87393
* path: make the check for unsupported name_to_handle_at symmetricZbigniew Jędrzejewski-Szmek2014-12-17
| | | | | | | 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.
* path: follow symbolic link for parent path (2)Umut Tezduyar Lindskog2014-12-17
| | | | | c0e57ba9e22ee937722958d8b912ade2a37f206d fixed the fallback path. We should do the same for name_to_handle_at().
* machinectl: add new commands for copying files from/to containersLennart Poettering2014-12-18
|
* util: in make_stdio() use dup2() rather than dup3()Lennart Poettering2014-12-18
| | | | | | | | | 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.
* machinectl: implement "bind" command to create additional bind mounts from ↵Lennart Poettering2014-12-18
| | | | host to container during runtime
* nspawn: fix invocation of the raw clone() system call on s390 and crisKen Werner2014-12-17
| | | | | 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.
* path: follow symbolic link for parent pathUmut Tezduyar Lindskog2014-12-16
| | | | | | [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.]
* shared: strv - add strv_clear()Tom Gundersen2014-12-17
| | | | This frees the elements of the strv without freeing the strv itself.
* shared: path-util - memory leakTom Gundersen2014-12-16
|
* udev: net_setup - fix warningTom Gundersen2014-12-16
|
* test-json: use fabsThomas Hindoe Paaboel Andersen2014-12-16
|
* fix compiler warningSusant Sahani2014-12-16
| | | | | | src/shared/utf8.c:268:13: warning: unused variable 'd' [-Wunused-variable] int d;
* systemctl: fix argument handling when invoked as "shutdown"Jan Synacek2014-12-16
|
* nss-myhostname: also recognize "gateway."Harald Hoyer2014-12-16
| | | | | "gateway." skips adding the domain search path and saves some queries to the nameserver.
* systemctl: refuse to edit runtime dropins when they already exist in /etcZbigniew Jędrzejewski-Szmek2014-12-16
| | | | | | The check for existing unit files and dropins is unified. path_join() is updated to not insert duplicate separators.
* systemctl: share path lookup between 'cat' and 'edit'Zbigniew Jędrzejewski-Szmek2014-12-16
| | | | | | | | | | | | | | | | | | | | | | | '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: Now: $ 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
* systemctl: split out LookupPaths initializationZbigniew Jędrzejewski-Szmek2014-12-16
|
* systemctl: move two functions upZbigniew Jędrzejewski-Szmek2014-12-16
| | | | No functional change.
* systemctl: unify warning about unit files changed on diskZbigniew Jędrzejewski-Szmek2014-12-16
|
* systemctl: do not use -1 for return codeZbigniew Jędrzejewski-Szmek2014-12-16
| | | | | Also make the error messages more specific to give a hint to the user how to solve the problem.
* Move dropin listing to sharedZbigniew Jędrzejewski-Szmek2014-12-16
| | | | | No functional change. This is in preparation for using this in systemctl in the future.
* shared: add minimal JSON tokenizerLennart Poettering2014-12-15
|
* udev: builtin-hwdb - port to sd-hwdbTom Gundersen2014-12-15
|
* udevadm: port to sd-hwdbTom Gundersen2014-12-15
|
* networkctl: port from libudev to sd-hwdbTom Gundersen2014-12-15
|
* unit: handle nicely of certain unit types are not supported on specific systemsLennart Poettering2014-12-15
| | | | | | | | | | | | 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.
* networkd: failing to track links is a serious problem so log at warning ↵Tom Gundersen2014-12-15
| | | | level rather than debug
* shared: time-dst: Avoid buffer overflowMartin Pitt2014-12-15
| | | | | Commit 681f9718 introduced an additional null terminator for the zone names. Increase the allocation of "transitions" to actually make room for this.
* blkid: Warn when rejecting a superblock with a bad csumGabriel de Perthuis2014-12-14
| | | | | Bump libblkid requirement from 2.20 to 2.24. util-linux 2.25 is actually required since fdbbad981cc5da8bb4ed7e9b6646e7a114745ec5
* delta: fix output alignment of [REDIRECTED] entriesIvan Shapovalov2014-12-14
|
* systemctl: handle correctly template units for edit verbRonny Chevalier2014-12-13
| | | | | | | | | | | | | | | | 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)
* test-unit-name: add more testsRonny Chevalier2014-12-13
| | | | | | | | | | Add more test cases for: - unit_name_is_instance - unit_name_to_instance Add tests for: - unit_name_template - unit_name_is_template
* journal: replace contexts hashmap with a plain arrayMichal Schmidt2014-12-13
| | | | | | | | | | | | | | | | | | | | 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
* journal: delete unused function mmap_cache_close_contextMichal Schmidt2014-12-13
| | | | | This never had any callers. Contexts are freed when the MMapCache is freed.
* journal: push type_to_context conversion down to journal_file_move_to()Michal Schmidt2014-12-13
|
* journal: have a named enum ObjectTypeMichal Schmidt2014-12-13
|
* journal: consistently use OBJECT_<type> names instead of numbersMichal Schmidt2014-12-13
| | | | | | 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).
* journal: consistently allow type==0 to mean "any type"Michal Schmidt2014-12-13
| | | | | | | | | | 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.
* journal: move type_to_context() to journal-file.cMichal Schmidt2014-12-13
| | | | It has no other callers. It does not need to be in the header file.
* journal: remove journal_file_object_keep/release functionsMichal Schmidt2014-12-13
| | | | | | | | | | | | | | | | | 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.
* journal: map objects to context set by caller, not by actual object typeMichal Schmidt2014-12-13
| | | | | | | | | | | | | | | | | | | | | | 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.
* journal: add debug mode for mmap-cache (--enable-debug=mmap-cache)Michal Schmidt2014-12-13
| | | | | | | | | | 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 */
* configure.ac: add a generic --enable-debug, replace --enable-hashmap-debugMichal Schmidt2014-12-13
| | | | | | | | 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.
* shared/hashmap.h: fix commentMichal Schmidt2014-12-13
| | | | | An early version used underscore prefixes for internal functions, but the current version uses the prefix "internal_".
* networkctl: remove unused variableThomas Hindoe Paaboel Andersen2014-12-12
|
* wrap a few *_FOREACH macros in curly bracesThomas Hindoe Paaboel Andersen2014-12-12
| | | | | | cppcheck would give up with "syntax error" without them. This led to reports of syntax errors in unrelated locations and potentially hid other errors
* core: retry unmounting until we are done, in case of stacked mountsLennart Poettering2014-12-12
|
* networkctl: also draw a nice unicode cirlce when "networkctl status" is run ↵Lennart Poettering2014-12-12
| | | | without parameters