summaryrefslogtreecommitdiff
path: root/src/shared
AgeCommit message (Collapse)Author
2016-12-30udev-builtin-input_id.c: add missing kernel header defines.Gustavo Sverzut Barbieri
Add missing defines so eudev builds for older kernels such as 2.6 Signed-off-by: Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
2016-08-06src/shared/missing.h: fix getrandom system call number on ARM64Thomas Petazzoni
The getrandom() system call number is indeed 384 on ARM, but it is not the same on ARM64. ARM64 uses the asm-generic headers, including for system call numbers, so the getrandom() system call number on ARM64 is 278. This fixes runtime issues of eudev on ARM64, such as: Populating /dev using udev: [ 6.186817] udevd[1204]: starting version 3.1.5 [ 6.191662] udevd[1204]: syscall 384 [ 6.195217] Code: aa0503e4 aa0603e5 aa0703e6 d4000001 (b13ffc1f) [ 6.201291] CPU: 4 PID: 1204 Comm: udevd Not tainted 4.7.0+ #1 [ 6.207079] Hardware name: ARM Juno development board (r2) (DT) [ 6.212954] task: ffff800976421900 task.stack: ffff800975610000 [ 6.218825] PC is at 0xffff97f12234 [ 6.222281] LR is at 0x41b15c [ 6.225214] pc : [<0000ffff97f12234>] lr : [<000000000041b15c>] pstate: 80000000 [ 6.232544] sp : 0000ffffcf9b3870 [ 6.235828] x29: 0000ffffcf9b3870 x28: 0000000000428218 [ 6.241110] x27: 0000000000000000 x26: 000000000042a7e3 [ 6.246395] x25: 0000ffffcf9b39c8 x24: 0000000000428000 [ 6.251670] x23: 0000000000449000 x22: 0000000000449678 [ 6.256946] x21: 0000000000000010 x20: 0000000000449000 [ 6.262233] x19: 0000000000449678 x18: 0000000000000000 [ 6.267507] x17: 0000ffff97f12210 x16: 0000000000449440 [ 6.272779] x15: 0000ffff97e4f730 x14: 0000ffff98050cb8 [ 6.278060] x13: 000000000000033c x12: 00000000000004b4 [ 6.283331] x11: 0000000000000000 x10: 0101010101010101 [ 6.288604] x9 : 0000000000001010 x8 : 0000000000000180 [ 6.293882] x7 : ffffffffffffffff x6 : ffffffffffffffff [ 6.299154] x5 : 00000000271e36c0 x4 : 0007061c00190d07 [ 6.304426] x3 : 00000000271e36d0 x2 : 0000000000000001 [ 6.309705] x1 : 0000000000000010 x0 : 0000000000449678 [ 6.314976] [ 6.398734] sky2 0000:08:00.0 enp8s0: renamed from eth0 Reported-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-05-31udevd: remove unnecessary cgroups handlingMurray Calavera
Signed-off-by: Murray Calavera <murray.calavera@gmail.com> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-04-24shared: remove unused file `exit-status`Murray Calavera
Signed-off-by: Murray Calavera <murray.calavera@gmail.com> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-04-24shared: remove unused function `execute_command`Murray Calavera
Signed-off-by: Murray Calavera <murray.calavera@gmail.com> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-03-21src/shared/util.c: fix typoAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-03-21src/shared/util.c: add fallback for ppoll(), issue #129.Anthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-07-31build-sys: check for strndupaRomain Naour
strndupa is a GNU extension, therefore it's not available for all libc libraries (musl). This patch is based on the one proposed by Emil Renner Berthing for systemd [1]. [1] http://lists.freedesktop.org/archives/systemd-devel/2014-September/023190.html Signed-off-by: Romain Naour <romain.naour@openwide.fr>
2015-07-31build-sys: check for mallinfoRomain Naour
mallinfo is not specified by POSIX or the C standards, therefore it's not available for all libc libraries (musl). Add the ability to disable mallinfo statistics. Fixes: selinux-util.c: In function ‘mac_selinux_init’: selinux-util.c:70:25: error: storage size of ‘before_mallinfo’ isn’t known struct mallinfo before_mallinfo, after_mallinfo; Signed-off-by: Romain Naour <romain.naour@openwide.fr>
2015-06-18Rename mkdir_p -> udev_mkdir_p to avoid symbol collisions.Anthony G. Basile
While usptream doesn't support a static libudev.a, we will try to do so. However, mkdir_p() is used in lvm2 and util-linux, so to avoid the collision, we rename it to udev_mkdir_p(). See: https://bugs.gentoo.org/show_bug.cgi?id=520450 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-29random-util.c: remove <sys/auxv.h> missing in uClibcAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-29src/shared/missing.h: O_PATH and AT_EMPTY_PATH missing in uClibc's <fcntl.h>Anthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27src/shared/util.h: update qsort_safe() for muslAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27src/shared/path-util.c: import prefix_root() from upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27nspawn: finish user namespace supportLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-27src/shared/util.h: import loop_write() from upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26udevd: make udev_ctrl_connection globalTom Gundersen
This allows us to simplify the ctrl_msg handler. Eventually all this global state should move to a Manager object or so. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-26src/shared/util.[ch]: import functions from upstream for previous commitsAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04core: rework cgroup path parse logicLennart Poettering
Various cleanups, be stricter when parsing unit paths. Most importantly: return the root slice "-.slice" when asked for slice of paths that contain no slice component. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04path-util: fix fstat fallback in fd_is_mount_pointThomas Hindoe Paaboel Andersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04sysctl: minor simplificationsLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04path-util: make use of "mnt_id" field exported in /proc/self/fdinfo/<fd> to ↵Lennart Poettering
test for mount points Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-04util: 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-05-03shared/hashmap: normalize whitespaceZbigniew Jędrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03src/shared/util.h: import xsprintf() from upstream.Anthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-15Ronny Chevalier <chevalier.ronny@gmail.com>shared: add terminal-util.[ch]Ronny Chevalier
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-14shared: add random-util.[ch]Ronny Chevalier
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-14shared: add process-util.[ch]Ronny Chevalier
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-14util: when unescaping C escape sequences support C++11 \u andLennart Poettering
\U unicode literals We simply recode them in utf8. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12path-util: fix more path_is_mount e792e890f falloutLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12path-util: don't eat up ENOENT in path_is_mount_point()Lennart Poettering
There's no reason to eat up ENOENT, it should be OK to simply report the error back. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12path-util: make sure fd_is_mount_point() returns true for root directoryLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12src/shared/Makefile.am: fix make dist-checkAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12path-util: if parent can do name_to_handle() but relevant dir not, it's a ↵Lennart Poettering
mount point Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12path-util.c: changes for rm-rf: never cross mount pointsLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12hashmap: 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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12shared: add formats-util.hRonny Chevalier
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12device-nodes: minor simplificationsLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12util.c: follow upstream's comments.Anthony G. Basile
2015-04-12shared: set - make argument to set_remove() constTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12shared/mkdir: do not set errno in addition to return valueZbigniew Jędrzejewski-Szmek
All callers look at the return value anyway.
2015-04-12strv: return NULL from strv_free()David Herrmann
We always return NULL/invalid-object from destructors, fix strv_free() to do the same. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: 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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12udev: input_id: tag pointing sticks as ID_INPUT_POINTINGSTICKAnthony G. Basile
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.y Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-27Remove hardcoded path /run and configure using --with-rootrundir=David Cortarello
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19shared: add path_compare(), an ordering path comparisonMichal Schmidt
... and make path_equal() a simple wrapper around it. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19sysctl: move property handling to shared/Kay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18selinux: fix SEGV during switch-root if SELinux policy loadedWill Woods
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 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18Check that EWOULDBLOCK is the same as EAGAINZbigniew Jędrzejewski-Szmek
It certainly is everywhere on Linux, but as a courtesy to people doing some strange cross-compilation, check that the assumption holds. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18Replace ENOTSUP with EOPNOTSUPPAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>