summaryrefslogtreecommitdiff
path: root/src/shared
Commit message (Collapse)AuthorAge
* util: check asprintf return valueZbigniew Jędrzejewski-Szmek2015-03-15
| | | | CID #1237546.
* sysv-generator: initialize LookupPaths just onceZbigniew Jędrzejewski-Szmek2015-03-14
| | | | | | | | With debugging on, sysv-generator would print the full set of lookup paths for *every* sysv script. While at it, pass LookupPaths as a pointer in sysv-generator, and constify it everywhere.
* util: remove redundant debug messageZbigniew Jędrzejewski-Szmek2015-03-14
| | | | | | | mar 14 20:05:34 fedora22 systemd[4058]: /usr/lib/systemd/system-generators/kdump-dep-generator.sh will be executed. mar 14 20:05:34 fedora22 systemd[4058]: Spawned /usr/lib/systemd/system-generators/kdump-dep-generator.sh as 4059. The second line already says everything.
* selinux: fix SEGV during switch-root if SELinux policy loadedWill Woods2015-03-13
| | | | | | | | | | | | | | | | | | If you've got SELinux policy loaded, label_hnd is your labeling handle. When systemd is shutting down, we free that handle via mac_selinux_finish(). But: switch_root() calls mkdir_p_label(), which tries to look up a label using that freed handle, and so we get a bunch of garbage and eventually SEGV in libselinux. (This doesn't happen in the switch-root from initramfs to real root because there's no SELinux policy loaded in initramfs, so label_hnd is NULL and we never attempt any lookups.) So: make sure that mac_selinux_finish() actually sets label_hnd to NULL, so nobody tries to use it after it becomes invalid. https://bugzilla.redhat.com/show_bug.cgi?id=1185604
* Use space after a silencing (void)Zbigniew Jędrzejewski-Szmek2015-03-13
| | | | | We were using a space more often than not, and this way is codified in CODING_STYLE.
* Check that EWOULDBLOCK is the same as EAGAINZbigniew Jędrzejewski-Szmek2015-03-13
| | | | | | It certainly is everywhere on Linux, but as a courtesy to people doing some strange cross-compilation, check that the assumption holds.
* tree-wide: there is no ENOTSUP on linuxDavid Herrmann2015-03-13
| | | | Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
* socket-util: refactor error handling in sockaddr_prettyZbigniew Jędrzejewski-Szmek2015-03-11
|
* sysctl: move property handling to shared/Kay Sievers2015-03-11
|
* util: add rename_noreplaceAlban Crequy2015-03-10
| | | | | | | | | renameat2() exists since Linux 3.15 but btrfs support for the flag RENAME_NOREPLACE was added later. This patch implements a fallback when renameat2() returns EINVAL. EINVAL is the error returned when the filesystem does not support one of the flags.
* path-util: fix path_is_mount_point() for symlinksHarald Hoyer2015-03-10
| | | | | | | | | path_is_mount_point() compares the mount_id of a directory and the mount_id of the parent directory. When following symlinks, the function to get the parent directory does not take the symlink into account. /bin -> /usr/bin with /usr being a mountpoint: mount_id of /bin with AT_SYMLINK_FOLLOW != mount_id of /
* shared: the btrfs quota field is called "referenced" not "referred"Lennart Poettering2015-03-10
|
* add REMOTE_ADDR and REMOTE_PORT for Accept=yesShawn Landden2015-03-10
|
* Add type specifier for intThomas Hindoe Paaboel Andersen2015-03-10
|
* logs-show: fix check of loop_read_exactThomas Hindoe Paaboel Andersen2015-03-10
| | | | just a typo fix
* Introduce loop_read_exact helperZbigniew Jędrzejewski-Szmek2015-03-09
| | | | | | | | Usually when using loop_read(), we want to read the full buffer. Add a helper that mirrors loop_write(), and returns 0 when full buffer was read, and an error otherwise. Use -ENODATA for the short read, to distinguish it from a read error.
* efivars: itialize variableZbigniew Jędrzejewski-Szmek2015-03-09
| | | | Introduced a few commits ago.
* Add missing includesZbigniew Jędrzejewski-Szmek2015-03-09
| | | | | audit.h uses uint32_t and bool. log.h uses abs.
* efivars: use greedy_reallocZbigniew Jędrzejewski-Szmek2015-03-09
|
* efivars: use more _cleanup_Zbigniew Jędrzejewski-Szmek2015-03-09
| | | | Also rename r to buf, since r is customarily reserved for the return value.
* efivars: do binary and before converting to boolZbigniew Jędrzejewski-Szmek2015-03-09
| | | | I'm pretty sure that this is what was meant here.
* efivars: rename last remaining err to rZbigniew Jędrzejewski-Szmek2015-03-09
|
* efivars: modernizationZbigniew Jędrzejewski-Szmek2015-03-09
| | | | Fix return value if unlink fails.
* importd: add API for exporting container/VM imagesLennart Poettering2015-03-09
| | | | Also, expose it in machinectl.
* tree-wide: use _packed_ macro instead of raw gcc __attribute__Lennart Poettering2015-03-09
|
* missing.h: add NDA_*Michael Olbrich2015-03-09
| | | | | This is necessary to build with older kernel headers. NDA_VLAN was introduced in v3.9 and NDA_PORT, NDA_VNI and NDA_IFINDEX in v3.10
* shared/machine-pool: remove unnecessary checkZbigniew Jędrzejewski-Szmek2015-03-07
| | | | CID #128739.
* Use correct uname identifiers in arch_map for SuperH architectureJohn Paul Adrian Glaubitz2015-03-04
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=89421
* importd: add new bus calls for importing local tar and raw imagesLennart Poettering2015-03-05
| | | | | | | | This also adds "machinectl import-raw" and "machinectl import-tar" to wrap these new bus calls. THe commands basically do for local files that "machinectl pull-raw" and friends do for remote files.
* shared/util: assume ac when /sys/class/power_supply is missingZbigniew Jędrzejewski-Szmek2015-03-03
| | | | | On s390 (at least) /sys/class/power_supply is not present. We should treat this like if this directory was empty, and not an error.
* importd: automatically grow /var/lib/machines/ loopback filesystem during ↵Lennart Poettering2015-03-03
| | | | | | | | | | | downloads If /var/lib/machines is mounted as btrfs loopback file system in /var/lib/machines.raw with this change we automatically grow the file system as it fills up. After each 10M we write to it during imports, we check the free disk space, and if the fill level grows beyond 66% we increase the size of the file system to 3x the fill level (thus lowering it to 33%).
* machined: also set up /var/lib/machines as btrfs, if "machinectl set-limit" ↵Lennart Poettering2015-03-02
| | | | is called
* importd: take a lock while we set up /var/lib/machines/Lennart Poettering2015-03-02
| | | | | This way, we can safely set up the directories from two processes at the same time, including machined and importd simultaneously.
* importd: split out setup logic for /var/lib/machines into its own API fileLennart Poettering2015-03-02
|
* shared: AFS is also a network filesystemCristian Rodríguez2015-03-01
|
* shared/condition: fix gcc5 warningDaniel Mack2015-02-27
| | | | | | | | | | | | | | | | | | Fixes the warning below. src/shared/condition.c: In function ‘condition_new’: src/shared/condition.c:47:27: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] assert(!parameter == (type == CONDITION_NULL)); ^ src/shared/macro.h:42:44: note: in definition of macro ‘_unlikely_’ #define _unlikely_(x) (__builtin_expect(!!(x),0)) ^ src/shared/macro.h:226:22: note: in expansion of macro ‘assert_se’ #define assert(expr) assert_se(expr) ^ src/shared/condition.c:47:9: note: in expansion of macro ‘assert’ assert(!parameter == (type == CONDITION_NULL)); ^
* machined: if /var/lib/machines is backed by a loop file, resize it on ↵Lennart Poettering2015-02-26
| | | | | | | | | "machinectl set-limit" When the pool size limit is altered with "machinectl set-limit", then not only set the subvolume quota of the /var/lib/machine subvolume, but also resize the backing loop file and the btrfs file system on it dynamically.
* machined,machinectl: add calls for changing container/VM quotasLennart Poettering2015-02-25
|
* systemd: add getrandom syscall numbers for MIPSAaro Koskinen2015-02-24
| | | | | | Add getrandom syscall numbers for MIPS. Based on Linux 3.17 kernel (commit 42944521af97a3b25516f15f3149aec3779656dc, "MIPS: Wire up new syscalls getrandom and memfd_create").
* acl-util: avoid freeing uninitialized pointerThomas Hindoe Paaboel Andersen2015-02-24
| | | | CID#1271344/1271345
* importd: enable btrfs quota in /var/lib/machines, if necessaryLennart Poettering2015-02-24
|
* shared: fix wrong assertion in barrier_set_role()Cristian Rodríguez2015-02-24
| | | | | | | | assert(b->pipe[0] >= 0 && b->pipe[0] >= 0); Test the same condition twice, pretty sure we mean assert(b->pipe[0] >= 0 && b->pipe[1] >= 0);
* shared/unit-name: fix gcc5 warningDaniel Mack2015-02-24
| | | | | | | | | | Fix the following gcc5 warning: CC src/shared/libsystemd_shared_la-unit-name.lo src/shared/unit-name.c: In function 'unit_name_is_valid': src/shared/unit-name.c:102:34: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] if (!template_ok == TEMPLATE_VALID && at+1 == e) ^
* shared/time-util: fix gcc5 warningDaniel Mack2015-02-24
| | | | | | | | CC src/shared/libsystemd_shared_la-time-util.lo src/shared/time-util.c: In function 'parse_nsec': src/shared/time-util.c:789:25: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] if (!*s != 0) ^
* tmpfiles: avoid creating duplicate acl entriesZbigniew Jędrzejewski-Szmek2015-02-23
| | | | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=89202 https://bugs.debian.org/778656 Status quo ante can be restored with: getfacl -p /var/log/journal/`cat /etc/machine-id`|grep -v '^#'|sort -u|sudo setfacl --set-file=- /var/log/journal/`cat /etc/machine-id`
* sd-bus, shared: fix includesDaniel Mack2015-02-24
| | | | | | | | | | | | | | | | Include <sys/socket.h> from util.h and bus-message.h in order to build errors like the ones below on kdbus enabled systems. ./src/shared/util.h:976:32: warning: its scope is only this definition or declaration, which is probably not what you want In file included from src/libsystemd/sd-bus/bus-kernel.c:37:0: ./src/shared/util.h:1081:28: warning: 'struct msghdr' declared inside parameter list void cmsg_close_all(struct msghdr *mh); ^ CC src/libsystemd/sd-bus/libsystemd_la-bus-creds.lo In file included from src/libsystemd/sd-bus/bus-creds.c:25:0: ./src/shared/util.h:976:32: warning: 'struct ucred' declared inside parameter list int getpeercred(int fd, struct ucred *ucred); ^
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* shared: handle unnamed sockets in socket_address_equal()Michal Schmidt2015-02-20
| | | | | | Make sure we don't inspect sun_path of unnamed sockets. Since we cannot know if two unnamed sockets' adresses refer to the same socket, just return false.
* shared: avoid semi-duplicating socket_address_equal()Michal Schmidt2015-02-20
| | | | | Just call socket_address_equal() from socket_address_matches_fd() instead of implementing similar comparing of addresses.
* shared: use SocketAddress in socket_address_matches_fd()Michal Schmidt2015-02-20
| | | | Cleanup. No behavior change.