summaryrefslogtreecommitdiff
path: root/src/shared
Commit message (Collapse)AuthorAge
* shared: untabifyLennart Poettering2015-02-10
|
* shared/log: read /proc/cmdline only in daemonsZbigniew Jędrzejewski-Szmek2015-02-05
| | | | http://lists.freedesktop.org/archives/systemd-devel/2015-February/027960.html
* shared/capabilities: simplify assertions about bitsZbigniew Jędrzejewski-Szmek2015-02-04
| | | | | The assert added in 7d328b5446 was wrong. Also update the comments and make sure we don't try to shift by type size.
* shared/util: drop duplicate log2u64 functionZbigniew Jędrzejewski-Szmek2015-02-04
|
* shared/capability: don't be too frugal on space for capsTom Gundersen2015-02-04
| | | | | | We were dropping the most significant bit. Add an assert to make sure it does not happen again. Fixes a bug introduced in 7d328b544621d4b1bec936dec612947ad8bfb65a.
* cg_path_get_user_unit(): Did not correctly parse user-unit templates.Luke Shumaker2015-02-04
| | | | | | | It ran either skip_session() or skip_user_manager(), then ran skip_slices() iff skip_session() ran. It needs to run skip_slices() in either case. Included is a test case demonstrating why.
* core: don't reset log level to NOTICE if we get quiet on the kernel cmdlineLennart Poettering2015-02-04
| | | | | | | | | | | | | | | | quiet should really just have an effect on the stuff we dump on the console, not what we log elsewhere. Hence: debug on kernel cmdline → interpreted by every tool, turns up log levels to "debug" everywhere. quiet on kernel cmdline → interpreted only by PID 1 (and obviously the kernel) no alteration of the max log level, but turns off status output. http://lists.freedesktop.org/archives/systemd-devel/2014-December/026271.html
* virt: add detect_vm_devicetree for powerpc archesChris J Arges2015-02-04
| | | | | Check sysfs devicetree values in order to detect if we are running on a KVM hypervisor on a powerpc architecture.
* core: use some nice macros where appropriateLennart Poettering2015-02-03
|
* shared/async: simplify asynchronous_job a bitZbigniew Jędrzejewski-Szmek2015-02-02
|
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* time-util: let's make xstrftime() useful for everybody, even if we only have ↵Lennart Poettering2015-02-02
| | | | a single user so far.
* macro: document that DECIMAL_STR_MAX contains space for the trailing NUL byteLennart Poettering2015-02-02
|
* shared/capability: go frugal on space for capsZbigniew Jędrzejewski-Szmek2015-02-01
|
* Fix dropping of all capabilitiesZbigniew Jędrzejewski-Szmek2015-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From fd.o bug 88898: systemd-resolved fails to start: Failed to drop capabilities: Operation not permitted Broken in f11943c53ec181829a821c6b27acf828bab71caa. Drop all capabilities: 1. prctl(PR_SET_KEEPCAPS, keep_capabilities != 0) // 0 when we drop all capabilities 2. setresuid() // bye bye capabilities 3. Add CAP_SETPCAP // fails because we have no capabilities 4. Reduce capability bounding set 5. Drop capabilities 6. prctl(PR_SET_KEEPCAPS, 0) Capabilites should always be kept after setresuid() so that the capability bounding set can be reduced. Based-on-a-patch-by: mustrumr97@gmail.com https://bugs.freedesktop.org/show_bug.cgi?id=88898 We must be careful not to leave PR_SET_KEEPCAPS on. We could use the setresuid() call to drop capabilities, but the rules when capabilities are dropped are fairly complex, since a transition to non-zero uid must happen. Let's instead keep the capabilities during setresuid(), and drop them later.
* Add a snprinf wrapper which checks that the buffer was big enoughZbigniew Jędrzejewski-Szmek2015-02-01
| | | | | | | | | | If we scale our buffer to be wide enough for the format string, we should expect that the calculation was correct. char_array_0() invocations are removed, since snprintf nul-terminates the output in any case. A similar wrapper is used for strftime calls, but only in timedatectl.c.
* coredump: drop caps while we are processing the coredumpLennart Poettering2015-01-29
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=87354
* util: add comment explaining hostname_is_valid()Lennart Poettering2015-01-28
|
* list: properly skip over first item in LIST_FOREACH_OTHERSLennart Poettering2015-01-28
|
* list: add macro for iterating through a list an item is in, skipping the itemLennart Poettering2015-01-28
|
* missing: define correct syscall numbers for memfd_create() and getrandom() ↵Michael Olbrich2015-01-27
| | | | on aarch64
* tmpfiles: do not bump access times of directories we are cleaning upZbigniew Jędrzejewski-Szmek2015-01-24
| | | | | | | | | | | | | Both plain opendir() and glob() will bump access time. Privileged option O_NOATIME can be used to prevent the access time from being updated. We already used it for subdirectories of the directories which we were cleaning up. But for the directories specified directly in the config files, we wouldn't do that. This means that, paradoxically, our own temporary directories for PrivateTmp would stay around forever, as long as one let systemd-tmpfiles-clean.service run regularly, because they had their own glob patterns specified. https://bugzilla.redhat.com/show_bug.cgi?id=1183684
* #pragma once here and thereZbigniew Jędrzejewski-Szmek2015-01-23
|
* build-sys: fix build on compilers without static_assertZbigniew Jędrzejewski-Szmek2015-01-23
| | | | | | | Build would fail when assert was used on the same line in different files #included together. https://bugs.freedesktop.org/show_bug.cgi?id=87339
* core: add a property that shows the current memory usage of a unitLennart Poettering2015-01-23
| | | | | This is exposed the memory.usage_in_bytes cgroup property on the bus, and makes "systemctl status" show it in its default output.
* cgroup-show: remove duplicated checkZbigniew Jędrzejewski-Szmek2015-01-22
| | | | After 3637713a20 it is not necessary anymore.
* importd: when listing transfers, show progress percentageLennart Poettering2015-01-23
| | | | | | | | With this change the pull protocol implementation processes will pass progress data to importd which then passes this information on via the bus. We use sd_notify() as generic transport for this communication, making importd listen to them, while matching the incoming messages to the right transfer.
* cgroup-show: don't hit assert, when the extra pids array is emptyLennart Poettering2015-01-22
|
* import: only define the _to_string() enum mapping function, thus making gcc ↵Lennart Poettering2015-01-22
| | | | shut up
* import: rename --verify=sum to --verify=checksumLennart Poettering2015-01-22
| | | | This is how we call it internally, and also a bit more descriptive.
* shared/acl-util: add mask only when needed, always add base ACLsZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | | | | For ACLs to be valid, a set of entries for user, group, and other must be always present. Always add those entries. While at it, only add the mask ACL if it is actually required, i.e. when at least on ACL for non-owner group or user exists.
* tmpfiles: implement augmenting of existing ACLsZbigniew Jędrzejewski-Szmek2015-01-22
| | | | This is much more useful in practice (equivalent to setfacl -m).
* tmpfiles: add 'a' type to set ACLsZbigniew Jędrzejewski-Szmek2015-01-22
|
* shared/cgroup-show: simplify show_pid_array()Zbigniew Jędrzejewski-Szmek2015-01-22
| | | | | | int[] should not be used as pid_t[], even if happens to be same thing. Also deduplicating in a quadratic loop right before sorting is unnecessary. Remove custom greedy_realloc implementation.
* Assorted format fixesZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | Types used for pids and uids in various interfaces are unpredictable. Too bad.
* Fix some format strings for enums, they are signedZbigniew Jędrzejewski-Szmek2015-01-22
|
* shared/util: use signed printf format for PIDsZbigniew Jędrzejewski-Szmek2015-01-22
| | | | gcc 5 started warning about this.
* import: introduce new mini-daemon systemd-importd, and make machinectl a ↵Lennart Poettering2015-01-22
| | | | | | | | | | | | | | client to it The old "systemd-import" binary is now an internal tool. We still use it as asynchronous backend for systemd-importd. Since the import tool might require some IO and CPU resources (due to qcow2 explosion, and decompression), and because we might want to run it with more minimal priviliges we still keep it around as the worker binary to execute as child process of importd. machinectl now has verbs for pulling down images, cancelling them and listing them.
* log: add new log output mode, that prints to console, but prefixes with ↵Lennart Poettering2015-01-22
| | | | | | | syslog priority This is useful when we execute our own programs, reading output from its STDERR, and want to retain priority information.
* util: Add some missing hidden_file() suffixesMartin Pitt2015-01-21
| | | | | dpkg itself also uses *.dpkg-dist, while .dpkg-{bak,backup,remove} are being used by dpkg-maintscript-helper.
* import: add image verification using gpgLennart Poettering2015-01-21
| | | | | | This also adds an initial keyring for the verification, that contains Ubuntu's and Fedora's key. We should probably add more entries sooner or later.
* import: port pull-raw to helper tools implemented for pull-tarLennart Poettering2015-01-20
| | | | | This allows us to reuse a lot more code, and simplify pull-raw drastically.
* util: make http url validity checks more generic, and move them to util.cLennart Poettering2015-01-20
|
* networkd: netdev - add ipvlan supportTom Gundersen2015-01-19
|
* nspawn: support dissecting GPT images that contain only a single generic ↵Lennart Poettering2015-01-19
| | | | | | | linux partition This should allow running Ubuntu UEFI GPT Images with nspawn, unmodified.
* machined: refer to the disk space allocated for an image to "usage" rather ↵Lennart Poettering2015-01-19
| | | | | | | than "size" After all, it's closer to the "du"-reported value than to the file sizes...
* qcow2: when dissecting qcow2, use btrfs clone ioctls for reflinking blocks ↵Lennart Poettering2015-01-19
| | | | to target
* import-raw: when downloading raw images, generate sparse files if we canLennart Poettering2015-01-19
|
* Move DEFINE_TRIVIAL_CLEANUP_FUNC to macro.hZbigniew Jędrzejewski-Szmek2015-01-18
| | | | | This remove the need for various header files to include the (relatively heavyweight) util.h.
* Add initialization helper for file_handle_unionZbigniew Jędrzejewski-Szmek2015-01-18
|