summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Prep v227: Add missing Makefile symlinksSven Eden2017-04-12
|
* Prep v227: Removed src/shared/cgroup-show.[hc], it is not needed.Sven Eden2017-04-10
|
* Prep v227: Clean up some headers in src/systemdSven Eden2017-04-09
| | | | | | - src/systemd/sd-bus.h - src/systemd/sd-daemon.h - src/systemd/sd-event.h
* Prep v227: Clean up various *-util.[hc] filesSven Eden2017-04-09
| | | | | | | | - src/basic/cgroup-util.[hc] - src/basic/memfd-util.[hc] - src/basic/path-util.[hc] - src/basic/process-util.[hc] - src/basic/smack-util.[hc]
* Fix assertion failure when resuming from sleep/suspendSven Eden2017-04-04
|
* [5/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* [4/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* [3/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* [2/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* [1/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* missing.h : add bridge paramsSusant Sahani2017-03-29
|
* siphash24: expose the internal helper functionsTom Gundersen2017-03-29
|
* siphash24: make siphash24_compress decomposableTom Gundersen2017-03-29
| | | | | | This allows the input to siphash24_compress to be decomposed into smaller chunks and the function to be called on each individual chunk.
* siphash24: move last compression iteration from compression step to ↵Tom Gundersen2017-03-29
| | | | | | | finalization step The last compression is special as it deals with the length byte, and padding. Move it to the finalization step in preparation for making compression decomposable.
* siphash24: split out the compression stepTom Gundersen2017-03-29
|
* siphash24: split out the finalization stepTom Gundersen2017-03-29
|
* siphash24: introduce state structTom Gundersen2017-03-29
| | | | | Encapsulate the four state variables in a struct so we can more easily pass them around.
* log: properly return -EINVAL from log_set_max_level_from_string()Lennart Poettering2017-03-29
| | | | | | | | If we just return the value we got from log_level_from_string() on failure we'll return -1, which is not a proper error code. log_set_target_from_string() did get this right already, hence let's fix this here too.
* sd-event: don't provide priority stabilityDavid Herrmann2017-03-29
| | | | | | | | | | | | | | Currently, we guarantee that if two event-sources with the same priority fire at the same time, they're always dispatched in the same order. While this might sound nice in theory, there's is little benefit in providing stability on that level. We have no control over the order the events are reported, hence, we cannot guarantee that we get notified about both at the same time. By dropping the stability guarantee, we loose roughly 10% Heap swaps in the prioq on a desktop cold-boot. Krzysztof Kotlenga even reported up to 20% on his tests. This sounds worth optimizing, so drop the stability guarantee.
* prioq: never shuffle identical entriesDavid Herrmann2017-03-29
| | | | | Skip shuffling identical entries in shuffle_up(), just like we already do in shuffle_down().
* sd-event: fix prepare priority queue comparison functionKrzysztof Kotlenga2017-03-29
| | | | | | | Otherwise a disabled event source can get swapped with an enabled one and cause a severe sd-event malfunction. http://lists.freedesktop.org/archives/elogind-devel/2015-September/034356.html
* mising: add __NR_memfd_create syscall number for s390Hendrik Brueckner2017-03-29
|
* mount: propagate error codes correctlyDavid Herrmann2017-03-29
| | | | | | | | | | Make sure to propagate error codes from mount-loops correctly. Right now, we return the return-code of the first mount that did _something_. This is not what we want. Make sure we return an error if _any_ mount fails (and then make sure to return the first error to not hide proper errors due to consequential errors like -ENOTDIR). Reported by cee1 <fykcee1@gmail.com>.
* util: clean-ups to enum parsersLennart Poettering2017-03-29
| | | | | | | | | | | | Never log when we fail due to OOM when translating enums, let the caller do that. Translating basic types like enums should be something where the caller logs, not the translatior functions. Return -1 when NULL is passed to all enum parser functions. The non-fallback versions of the enum translator calls already handle NULL as failure, instead of hitting an assert, and we should do this here, too.
* util: minor cleanups for loop_read() and friendsLennart Poettering2017-03-29
| | | | | | | | When 0 bytes are to be written, make sure to go into read() at least once, in order to validate the parameters, such as the passed fd. Return error on huge values, add a couple of asserts and casts where appropriate.
* pam: elogind-user - call selinux moduleKay Sievers2017-03-29
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1262933
* sd-id128: make size constraints a bit more obviousLennart Poettering2017-03-29
|
* sd-bus: correct size calculation in DBus fd receiveMichal Schmidt2017-03-29
| | | | | | | The size of the allocated array for received file descriptors was incorrectly calculated. This did not matter when a single file descriptor was received, but for more descriptors the allocation was insufficient.
* Add fallback for kcmp() in case __NR_kcmp is undefinedMike Gilbert2017-03-29
| | | | | IA64 is missing this syscall as of linux-4.2. This works around it until the necessary kernel patch gets merged.
* basic: make sure argument of ELEMENTSOF is an arrayMichal Schmidt2017-03-29
| | | | Using ELEMENTSOF on a pointer will result in a compilation error.
* basic: nicer assert messagesMichal Schmidt2017-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the assert expression is not macro-expanded before stringification. This makes several assertion failure messages more readable. As an example: assert(streq("foo", "bar")); I'd rather see this: Assertion 'streq("foo", "bar")' failed at foo.c:5, function main(). Aborting. ...than this, though awesome, incomprehensible truncated mess: Assertion '(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (( "foo")) && __builtin_constant_p (("bar")) && (__s1_len = strlen (("foo")), __s2_ len = strlen (("bar")), (!((size_t)(const void *)((("foo")) + 1) - (size_t)(cons t void *)(("foo")) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((("bar") ) + 1) - (size_t)(const void *)(("bar")) == 1) || __s2_len >= 4)) ? __builtin_st rcmp (("foo"), ("bar")) : (__builtin_constant_p (("foo")) && ((size_t)(const voi d *)((("foo")) + 1) - (size_t)(const void *)(("foo")) == 1) && (__s1_len = strle n (("foo")), __s1_len < 4) ? (__builtin_constant_p (("bar")) && ((size_t)(const void *)((("bar")) + 1) - (size_t)(const void *)(("bar")) == 1) ? __builtin_strcm p (("foo"), ("bar")) : (__extension__ ({ const unsigned char *__s2 = (const unsi gned char *) (const char *) (("bar")); int __result = (((const unsigned char *) (const char *) (("foo")))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __ result = (((const unsigned char *) (const char *) (("foo")))[1] - __s2[1]); if ( __s1_len > 1 && __result == 0) { __result = (((const unsigned char *) (const cha r *) (("foo")))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = ((( const unsigned char *) (const char *) (("foo")))[3] - __s2[3]); } } __result; }) )) : (__builtin_constant_p (("bar")) && ((size_t)(const void *)((("bar")) + 1) - (size_t)(const void *)(("bar")) == 1) && (__s2_len = strlen (("bar")), __s2_len < 4) ? (__builtin_constant_p (("foo")) && ((size_t)(const void *)((("foo")) + 1 ) - (size_t)(const void *)(("foo")) == 1) ? __builtin_strcmp (("foo"), ("bar")) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (cons t char *) (("foo")); int __result = (((const unsigned char *) (const char *) ((" bar")))[0] - __s2[0]); if (__s2_len > 0 && __result == 0) { __result = (((const unsigned char *) (const char *) (("bar")))[1] - __s2[1]); if (__s2_len > 1 && __ result == 0) { __result = (((const unsigned char *) (const char *) (("bar")))[2] - __s2[2]); if (__s2_len > 2 && __result == 0)
* loginctl: print nontrivial properties in logictl show-*Lukas Nykryn2017-03-29
|
* login: support more than just power-gpio-keydoubleodoug2017-03-29
| | | | | | | | | | | | | | | | | | | | | Adding additional keys prevents this gpio-keys powerswitch from working, e.g. this wouldn't poweroff: button@23 { label = "power-switch"; linux,code = <116>; gpios = <&gpio 23 1>; }; button@25 { label = "KEY_A"; linux,code = <30>; gpios = <&gpio 25 1>; }; Changing ATTRS{keys}=="116" to ATTRS{keys}=="*116*" makes the power-switch and the A key both work properly. (David: rephrase and merge-commits)
* sd-bus: drop weird empty linesDavid Herrmann2017-03-29
| | | | | We should never put empty lines between `if` and `else if`, unless we use braces.
* tree-wide: drop redundant if checks before safe_close()Lennart Poettering2017-03-29
| | | | | | | | | | | Replace this: if (fd >= 0) safe_close(fd); by this: safe_close(fd);
* tree-wide: make more code use safe_close()Lennart Poettering2017-03-29
| | | | | | | | | | | Replace this: close(fd); fd = -1; write this: fd = safe_close(fd);
* sd_pid_notify_with_fds: fix computing msg_controllenMaciej Wereski2017-03-29
| | | | | CMSG_SPACE(0) may return value other than 0. This caused sendmsg to fail with EINVAL, when have_pid or n_fds was 0.
* smack: bugfix the smack label of symlink when '--with-smack-run-label' is setSangjung Woo2017-03-29
| | | | | | | | | | | | | | | | | | | Even though elogind has its own smack label since '--with-smack-run-label' configuration is set, the smack label of each CGROUP root directory should have the star (i.e. *) label. This is mainly because current Linux Kernel set the label in this way. (Refer to smack_d_instantiate() in security/smack/smack_lsm.c) However, if elogind has its own smack label and arg_join_controllers is explicitly set or initialized by initialize_join_controllers() function, current elogind creates the symlink in CGROUP root directory with its own smack label as below. lrwxrwxrwx. 1 root root System 11 Dec 31 16:00 cpu -> cpu,cpuacct dr-xr-xr-x. 4 root root * 0 Dec 31 16:01 cpu,cpuacct lrwxrwxrwx. 1 root root System 11 Dec 31 16:00 cpuacct -> cpu,cpuacct This patch fixes that bug by copying the smack label from the origin.
* smack: introduce new mac_smack_copy() functionSangjung Woo2017-03-29
| | | | | This adds a new mac_smack_copy() function in order to read the smack label from the source and apply it to the destination.
* sd-daemon: fix sd_is_mq for non-mq fdsZbigniew Jędrzejewski-Szmek2017-03-29
| | | | | | | | | mq_getattr returns -1/EBADF for file descriptors which are not mq. But we should return 0 in this case. We first check that fd is a valid fd, so we can assume that if mq_getattr returns EBADF, it is simply a non-mq fd. There is a slight race, but there doesn't seem to be a nice way to fix it.
* sd-login: rework error handlingLennart Poettering2017-03-29
| | | | | | Makre sure we always return sensible errors for the various, following the same rules, and document them in a comment in sd-login.c. Also, update all relevant man pages accordingly.
* logind: Listen to WMI hotkeys to catch SW_DOCK state/eventsMartin Pitt2017-03-29
| | | | | | | | | | On Dell and HP laptops the dock state/events (SW_DOCK) come from the "{Dell,HP} WMI hotkeys" input devices. Tag them as power-switch so that login actually considers them. Use a general match in case this affects other vendors, too. Thanks to Andreas Schultz for debugging this! https://launchpad.net/bugs/1450009
* sd-login: improve error handlingLennart Poettering2017-03-29
| | | | | | | let's return ENXIO whenever we don't know something rather than ENOENT. ENOENT suggests this was really about a file or directory, while ENXIO is a more generic "not found" indicator.
* pager: set $LESSCHARSET when we output UTF8 charsLennart Poettering2017-03-29
| | | | | | | | | This way we can be sure that less has the same idea of the terminal as we do. This solves issues in systems that have locale uninitalized, where elogind would output UTF-8 but less wouldn't allow it and show them as control characters.
* pager: also redirect stderrLennart Poettering2017-03-29
| | | | | | It's really confusing if stdout goes to the pager, but stderr is written directly to the screen. Hence, make sure both stdout and stderr are passed to the pager when doing autopaging.
* logind: add standard gpio power button supportKefeng Wang2017-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many boards like hisilicon D02 board use standard gpio key to power down system. A description of gpio-key in dts shown below, gpio_keys { compatible = "gpio-keys"; #address-cells = <1>; #size-cells = <0>; pwrbutton { label = "Power Button"; gpios = <&porta 8 1>; linux,code = <116>; // KEY_POWER, used by SC System Power Down }; }; -bash-4.3# udevadm info -a /dev/input/event3 Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device. looking at device '/devices/platform/gpio_keys/input/input3/event3': KERNEL=="event3" SUBSYSTEM=="input" DRIVER=="" looking at parent device '/devices/platform/gpio_keys/input/input3': KERNELS=="input3" SUBSYSTEMS=="input" DRIVERS=="" ATTRS{name}=="gpio_keys" ATTRS{phys}=="gpio-keys/input0" ATTRS{uniq}=="" ATTRS{properties}=="0" looking at parent device '/devices/platform/gpio_keys': KERNELS=="gpio_keys" SUBSYSTEMS=="platform" DRIVERS=="gpio-keys" ATTRS{keys}=="116" ATTRS{switches}=="" ATTRS{driver_override}=="(null)" ATTRS{disabled_keys}=="" ATTRS{disabled_switches}=="" looking at parent device '/devices/platform': KERNELS=="platform" SUBSYSTEMS=="" DRIVERS==""
* include sys/sysmacros.h in more placesMike Frysinger2016-03-14
| | | | | | Since glibc is moving away from implicitly including sys/sysmacros.h all the time via sys/types.h, include the header directly in more places. This seems to cover most makedev/major/minor usage.
* basic/musl_missing.h : __compar_fn_t was defined twice - fixed.Sven Eden2017-03-17
|
* Rename ELOGIND_CGROUP_CONTROLLER back to SYSTEMD_CGROUP_CONTROLLERSven Eden2017-03-14
| | | | | Although it is nice to have it read ELOGIND instead of SYSTEMD, all diffs just show too many irrelevant (false) positives.
* Major cleanup of all leftovers after rebasing on master.Sven Eden2017-03-14
| | | | | | | | The patching of elogind in several steps with only partly rebasing on a common commit with upstream, left the tree in a state, that was unmergeable with master. By rebasing on master and manually cleaning up all commits, this merge is now possible. However, this process left some orphans, that are cleanup now.