summaryrefslogtreecommitdiff
path: root/src/shared
AgeCommit message (Collapse)Author
2015-04-23path-util: make use of "mnt_id" field exported in /proc/self/fdinfo/<fd> to ↵Lennart Poettering
test for mount points It's a very recent kernel addition, but certainly makes sense to support.
2015-04-23util: Fix assertion in split() on missing 'Martin Pitt
When parsing a unit with a trailing slash after an escaped line break, like ExecStart=/bin/echo 'foo \ bar' the split() function (through config_parse()) asserted and crashed pid 1: Assertion 'current[*l + 1] == quotechars[0]' failed at ../src/shared/util.c:583, function split(). Aborting. Fix this by returning an error in this case ("trailing garbage"). Add corresponding test case. Also fix the missing "unit" argument of config_parse_exec() in the comment. https://launchpad.net/bugs/1447243
2015-04-22journalctl: rework code that checks whether we have access to /var/log/journalLennart Poettering
- fix some memory leaks on error conditions - handle all error cases properly, and log about failures - move HAVE_ACL and no-HAVE_ACL code closer to each other
2015-04-22btrfs-util: support recursive removal of read-only subvolumesLennart Poettering
When deleting a read-only subsvolume with a sub-subvolume, we need to mark it writable first, otherwise the removal will not work.
2015-04-22btrfs-util: fix creating recursive read-only snapshotsLennart Poettering
When creating recursive read-only snapshots we need to mark the snapshot writable immediately before creating subsnapshots within it, otherwise the operation for it will fail.
2015-04-22btrfs-util: be more careful when invoking btrfs file system ioctlsLennart Poettering
If we get passed an fd that does not refer to a regular file or directory, we should not issue btrfs ioctls on it, since it might end up in a device driver or similar (note that DRM for example uses the same ioctl numbers as some file system ioctls). Hence, let's make sure to always check if something is a regular file or directory, or is on btrfs before invoking the respective ioctls. It's better to be safe than sorry.
2015-04-22btrfs-util: introduce btrfs_is_filesystem() and make use of it where appropriateLennart Poettering
Let's unify the code that checks whether an fd is on btrfs a bit. (Also, rename btrfs_is_snapshot() to btrfs_is_subvol(), since that's usually how this is referred to in our code)
2015-04-22util: make sure fd refers to regular file or directory when applying file ↵Lennart Poettering
attributes Before invoking file system ioctls we need to make sure that the specified fd actually refers to a file system object, and not a device node or similar. Otherwise we might by accident invoke unrelated device driver ioctls. For example, DRM ioctls use the same ioctl numbers as the various file system ioctls.
2015-04-21core: make unit deserialization more defensiveLennart Poettering
2015-04-21tree-wide: get rid of more strerror() callsLennart Poettering
2015-04-21log: move log_syntax() into src/shared/log.c, and make it more similar to ↵Lennart Poettering
the other log functions
2015-04-20util: fix typoRaul Gutierrez S
2015-04-18exit-status: Fix "NOTINSSTALLED" typoMartin Pitt
2015-04-16shared: move assert_return_errno() from libudevTom Gundersen
This should not be used for any new code, as we don't set errno in new code, but there are several legacy users, so let's keep it in shared.
2015-04-12shared/hashmap: normalize whitespaceZbigniew Jędrzejewski-Szmek
2015-04-11bus: implement bus_label_unescape_n()David Herrmann
This is like bus_label_unescape() but takes a maximum length instead of relying on NULL-terminated strings. This is highly useful to unescape labels that are not at the end of a path.
2015-04-11hashmap: return NULL from destructorDavid Herrmann
We _always_ return NULL from destructors to allow direct assignments to the variable holding the object. Especially on hashmaps, which treat NULL as empty hashmap, this is pretty neat.
2015-04-11shared: move replace_env* from util to env-utilRonny Chevalier
2015-04-11shared: add terminal-util.[ch]Ronny Chevalier
2015-04-11shared: add random-util.[ch]Ronny Chevalier
2015-04-10shared: add process-util.[ch]Ronny Chevalier
2015-04-10shared: add formats-util.hRonny Chevalier
2015-04-10efivars: fix build for non-efiThomas Hindoe Paaboel Andersen
2015-04-10shared: boot-timestamps - remove ifdefTom Gundersen
No need to ifdef out efi code as the functions are always defined.
2015-04-10shared: efivars - fix compile on non-EFI systemsTom Gundersen
systemctl and logind were unconditionally using functions that were not compiled on non-EFI systems. Add stubs returning -EOPNOTSUPP to fix compile again.
2015-04-10shared: efivars - is_efi_*() returns bool instead of intTom Gundersen
There was a bug where is_efi_*() could return a negative error value, which would be treated as 'true', just make this a bool in the helper library to avoid the problem.
2015-04-10device-nodes: minor simplificationsLennart Poettering
2015-04-10util: unify how we parse mode_t stringsLennart Poettering
2015-04-10util: remove normalize_env_assignment(), it's unusedLennart Poettering
2015-04-10shared: fix memleakRonny Chevalier
path was used for 2 purposes but it was not freed before being reused.
2015-04-10util: mark unquote() static, so that new code doesn't use this anymoreLennart Poettering
2015-04-10util: fix unicode decoding in unquote_first_word()Lennart Poettering
2015-04-10util: when unescaping C escape sequences support C++11 \u and \U unicode ↵Lennart Poettering
literals We simply recode them in utf8.
2015-04-09util: fix a typo in commentThomas Hindoe Paaboel Andersen
2015-04-09util: cunescape - fix memleak in error pathRonny Chevalier
2015-04-09util: add shell_maybe_quote() call for preparing a string for shell cmdline ↵Lennart Poettering
inclusion If necessary the passed string is enclosed in "", and all special characters escapes. This also ports over usage in bus-util.c and job.c to use this, instead of a incorrect local implementation that forgets to properly escape.
2015-04-08util: merge change_attr_fd() and chattr_fd()Lennart Poettering
2015-04-08util: add minimal OrderedSet typeLennart Poettering
OrderedSet implements a Set-like structure, but maintains insertion ordered. It is hence to Set what OrderedHashmap is for Hashmap. Internally, this is only a wrapper around OrderedHashmap for now, but this could one day be improved and be added to hashmap.c natively.
2015-04-08missing.h: Define IFA_F_NOPREFIXROUTEAlexander Sverdlin
Fixes second systemd compilation problem against Linux 3.12 uapi headers. IFA_F_NOPREFIXROUTE is a usual #define appeared in Linux 3.14, so AC_CHECK_DECLS is not necessary.
2015-04-08remove duplicated includesRonny Chevalier
2015-04-07missing.h: define IFA_FLAGS if it is missingLennart Poettering
2015-04-07logind,systemctl: add reboot to EFI firmware supportJan Janssen
2015-04-07path-util: fix more path_is_mount e792e890f falloutLennart Poettering
2015-04-07util: rework cunescape(), improve error handlingLennart Poettering
Change cunescape() to return a normal error code, so that we can distuingish OOM errors from parse errors. This also adds a flags parameter to control whether "relaxed" or normal parsing shall be done. If set no parse failures are generated, and the only reason why cunescape() can fail is OOM.
2015-04-07udev: input_id: tag accelerometers as ID_INPUT_ACCELEROMETERHans de Goede
input_id already (tries to) tag accelerometers as such, but this only works for absolute accelerometers. Recent kernels mark accelerometers through an input prop. Trust that prop and always tag devices with it with ID_INPUT_ACCELEROMETER. Note that detection by the prop bit works the same as the existing detection and will ensure that no other tags get set on the device.
2015-04-07udev: input_id: tag pointing sticks as ID_INPUT_POINTINGSTICKPeter Hutterer
Also referred to as trackpoint, trackstick. These are marked by recent kernels through an input prop. Forward that prop as udev property so userspace can easily determine whether there is a pointing stick present. These devices were previously marked as ID_INPUT_MOUSE, for backwards compatibility we keep that in place, the new property is an addition.
2015-04-06btrfs: add support for recursive btrfs snapshottingLennart Poettering
2015-04-06btrfs: missing endian conversion fixLennart Poettering
2015-04-06btrfs: make btrfs_subvol_snapshot() parameters a flags fieldLennart Poettering
2015-04-06btrfs: support recursively removing btrfs snapshotsLennart Poettering