summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
| * 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==""
* Version bump to v226.5Sven Eden2017-03-29
|
* 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.
* Version bump to 226.4Sven Eden2017-03-21
|
* Merge pull request #3 from elogind/dev_v226-r1Sven Eden2017-03-21
|\ | | | | Full upgrade path via upstream to v226
| * basic/musl_missing.h : __compar_fn_t was defined twice - fixed.Sven Eden2017-03-17
| |
| * Version bump to 226.3Sven Eden2017-03-14
| |
| * 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.
| * Unifiy free() usageSven Eden2017-03-14
| | | | | | | | | | | | | | | | This commit substitutes all occurrences of free(foo); foo = NULL; with foo = mfree(foo);
| * Fix bug that program_invocation_name is NULL when backgroundingSven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a weird issue. When elogind is started from a tty, everything works just fine. But since adding the fixes to build elogind against the musl libc, which does not provide program_invocation_name and program_invocation_short_name, glibc does not set them when elogind is background. Neither when done manually, nor when doing it using a system init tool like openrc /sbin/start-stop-daemon. The "workaround" is to allow elogind_set_program_name() to (re-)set both globals if they are either NULL, or not set to the correct value. This should work fine with both glibc and musl-libc.
| * Add mounting of a name=elogind cgroup if no init controller is found.Sven Eden2017-03-14
| | | | | | | | | | This is done for systems, which init systems are no cgroup controllers. One example is runit on Void Linux.
| * Add support for building elogind against musl libcSven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Check whether printf.h is available and define/undef HAVE_PRINTF_H accordingly. * Added src/shared/parse-printf-format.[hc] by Emil Renner Berthing <systemd@esmil.dk> that provides parse_printf_format() if printf.h is unavailable * Added src/basic/musl_missing.h by Juergen Buchmueller <pullmoll@t-online.de> that implements glibc functions missing in musl libc as macros. * Extended src/basic/musl_missing.h and added src/basic/musl_missing.c providing - program_invocation_name - program_invocation_short_name and - elogind_set_program_name() to set the two where appropriate. * Added calls to elogind_set_program_name() to all main() functions where needed. * A few other fixes to work nicely with musl libc.
| * Fixed gawk script for git-tar target.Sven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous variant was nice and sleek. But unfortunately, there are constructs like: #if 0 (... old code ...) #else (... alternative code for elogind ...) #endif // 0 These fragments couldn't be handled by the old code, but can by the new one. To make this work, the precompiler macros must be set like shown above. Apart from that, all lines like: /// Any doxygen one-line-comments with elogind in it are removed are removed, too. Please note the three slashes. And finally, all commented out #include directives are removed as well.
| * Makefile.am: Add a git-tar target, that removes all elogind masks from the ↵Sven Eden2017-03-14
| | | | | | | | sources before packing the tar.
| * configure.ac: Do not allow -Werror in gperf length test.Sven Eden2017-03-14
| |
| * Remove (non.existent) support for logging to journald.Sven Eden2017-03-14
| |
| * Cleaned up more unneeded functions and types in:Sven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - src/basic/ioprio.h - removed - src/basic/ring.h - removed - src/basic/capability.[hc] - cleaned - src/basic/cgroup-util.[hc] - cleaned - src/basic/hostname-util.[hc] - cleaned - src/basic/path-util.[hc] - cleaned - src/basic/socket-util.h - cleaned - src/basic/strv.[hc] - cleaned - src/basic/time-util.[hc] - cleaned - src/basic/unit-name.[hc] - cleaned - src/basic/util.[hc] - cleaned - src/libelogind/sd-bus/bus-introspect.c - cleaned - src/login/loginctl.c - cleaned - src/login/logind-dbus.c - cleaned - src/login/logind.h - cleaned - src/shared/conf-parser.[hc] - cleaned
| * elogind_cgroup_agent registers as elogind.Agent, not systemd1.Agent.Sven Eden2017-03-14
| |
| * Version bump to 226.2Sven Eden2017-03-14
| |
| * Updated man pages.Sven Eden2017-03-14
| |
| * Cleaned up more unneeded types and functions.Sven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - src/shared/install.h - removed - src/basic/unit-name.[hc] - cleaned - src/core/cgroup.[hc] - cleaned - src/libelogind/libelogind.sym - cleaned - src/libelogind/sd-daemon/sd-daemon.c - cleaned - src/shared/acl-util.[hc] - cleaned - src/shared/bus-util.[hc] - cleaned - src/shared/output-mode.h - cleaned - src/shared/path-lookup.h - cleaned - src/systemd/sd-daemon.h - cleaned
| * Fix libelogind.pc.inSven Eden2017-03-14
| |
| * Version bump to 226.1Sven Eden2017-03-14
| |
| * user_start_slice() : The slice name must end with .slice:Sven Eden2017-03-14
| |
| * cg_shift_path(): Do not shift if cgroup and root are equalSven Eden2017-03-14
| |
| * Add --enable-debug=elogind configure option and fix cgroup pathSven Eden2017-03-14
| | | | | | | | | | | | | | a) Add some debugging messages to track what's going on with eloginds cgroup handling. b) Do not create a cgroup path "/elogind" if our cgroup root is already "/elogind".
| * Makefile.am: Fixed paths and cleaned up unneeded values.Sven Eden2017-03-14
| |
| * Allow NULL session parameter for manager_get_session_by_pid()Sven Eden2017-03-14
| | | | | | | | | | The reason is, that method_create_session() calls that function to detect whether there is already a running session.
| * Detect running cgroup controller.Sven Eden2017-03-14
| | | | | | | | | | | | | | | | elogind has to run on any system, no matter which init system is in control of the cgroups. So instead of hardcoding "name=foo", configure now greps 1: in /proc/self/cgroup - which is hopefully the right choice. (Well, to be honest, if it isn't, something is really wrong with the running system...)
| * Emit PrepareForSleep when resuming and clear pending action after resume ↵Sven Eden2017-03-14
| | | | | | | | from delayed sleep.
| * Classify processes from sessions into cgroupsSven Eden2017-03-14
| | | | | | | | | | | | | | Create a private cgroup tree associated with no controllers, and use it to map PIDs to sessions. Since we use our own path structure, remove internal cgroup-related helpers that interpret the cgroup path structure to pull out users, slices, and scopes.
| * Update READMESven Eden2017-03-14
| |
| * Stop sessions on ReleaseSessionSven Eden2017-03-14
| |