summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Fix lookup_errno by adding a gperf length parameter detection.Sven Eden2017-03-14
| | | | | | | | | build-sys: add check for gperf lookup function signature (#5055) gperf-3.1 generates lookup functions that take a size_t length parameter instead of unsigned int. Test for this at configure time. Fixes: https://github.com/systemd/systemd/issues/5039
* Remove kmodSven Eden2017-03-14
|
* Remove cgroups-agent, it is not really needed.Sven Eden2017-03-14
|
* Remove SysV compatSven Eden2017-03-14
|
* Remove utmp stuff that has found it's way back in.Sven Eden2017-03-14
|
* Prep 4xx6: Fix logind_gperf_lookup declarationSven Eden2017-03-14
|
* Prep v226: Mask all unneeded functionsSven Eden2017-03-14
|
* Prep v226: loginctl.c: Fix call to (changed) cg_is_empty_recursive().Sven Eden2017-03-14
|
* Prep v226: Fix some function prototypes in bus-util.hSven Eden2017-03-14
|
* Prep v226: Add src/basic/copy.[hc] to libbasic, the function copy_bytes() is ↵Sven Eden2017-03-14
| | | | needed by pager.c
* Prep v220: Fix src/basic/time-util.h, unmask timezone_is_valid, mask ↵Sven Eden2017-03-14
| | | | unneeded functions.
* Prep v226: Apply missing fixes and changes to src/sharedSven Eden2017-03-14
|
* Prep v226: Apply missing fixes and changes to src/loginSven Eden2017-03-14
|
* Prep v226: Apply missing fixes and changes to src/libelogindSven Eden2017-03-14
|
* Prep v226: Apply missing fixes and changes to src/basicSven Eden2017-03-14
|
* sd-bus: when connecting to a container AF_UNIX bus, return errorLennart Poettering2017-03-14
| | | | | | | | When forking of a child process for connecting to a container, pass the preicse connection error to the calling process. We already did this correctly for kdbus busses, let's do so for dbus1 busses, too.
* logind: make scope of wall message handling smallerLennart Poettering2017-03-14
|
* sd-bus: make introspection data non-recursiveDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, our introspection data looks like this: <node> <interface name="org.freedesktop.DBus.Peer"> ... </interface> <interface name="org.freedesktop.DBus.Introspectable"> ... </interface> <interface name="org.freedesktop.DBus.Properties"> ... </interface> <node name="org"/> <node name="org/freedesktop"/> <node name="org/freedesktop/login1"/> <node name="org/freedesktop/login1/user"/> <node name="org/freedesktop/login1/user/self"/> <node name="org/freedesktop/login1/user/_1000"/> <node name="org/freedesktop/login1/seat"/> <node name="org/freedesktop/login1/seat/self"/> <node name="org/freedesktop/login1/seat/seat0"/> <node name="org/freedesktop/login1/session"/> <node name="org/freedesktop/login1/session/self"/> <node name="org/freedesktop/login1/session/c1"/> </node> (ordered alphabetically for better visibility) This is grossly incorrect. The spec says that we're allowed to return non-directed children, however, it does not allow us to return data recursively in multiple parents. If we return "org", then we must not return anything else that starts with "org/". It is unclear, whether we can include child-nodes as a tree. Moreover, it is usually not what the caller wants. Hence, this patch changes sd-bus to never return introspection data recursively. Instead, only a single child-layer is returned. This patch relies on enumerators to never return hierarchies. If someone registers an enumerator via sd_bus_add_enumerator, they better register sub-enumerators if they support *TRUE* hierarchies. Each enumerator is treated as a single layer and not filtered. Enumerators are still allowed to return nested data. However, that data is still required to be a single hierarchy. For instance, returning "/org/foo" and "/com/bar" is fine, but including "/com" or "/org" in that dataset is not. This should be the default for enumerators and I see no reason to filter in sd-bus. Moreover, filtering that data-set would require to sort the strv by path and then do prefix-filtering. This is O(n log n), which would be fine, but still better to avoid. Fixes #664.
* sd-bus: derive uid from cgroup if possibleDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | | | | | Whenever we run in a user context, sd_bus_{default_user,open_user}() and friends should always connect to the user-bus of the current context, instead of deriving the uid from getuid(). This allows us running programs via sudo/su, without the nasty side-effect of accidentally connecting to the root user-bus. This patch enforces the idea of making su/sudo *not* opening sessions by default. That is, all they do is raising privileges, but keeping everything set as before. You can still use su/sudo to open real sessions by requesting a login-session (or loading pam_elogind otherwise). However, in this case XDG_RUNTIME_DIR= will not be set (as usual in these cases), hence, you will not be able to connect to *any* user-bus. Long story short: With this patch applied, both: - ./busctl --user - sudo ./busctl --user ..will successfully connect to the user-bus of the local user. Fixes #390.
* login: fix NULL-deref on wall_messageDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | We treat an empty wall-message equal to a NULL wall-message since: commit 5744f59a3ee883ef3a78214bd5236157acdc35ba Author: Lennart Poettering <lennart@poettering.net> Date: Fri Sep 4 10:34:47 2015 +0200 logind: treat an empty wall message like a NULL one Fix the shutdown scheduler to not deref a NULL pointer, but properly check for an empty wall-message. Fixes: #1120
* logind: when parsing a boolean via sd-bus the type must be "int"Lennart Poettering2017-03-14
| | | | And not bool.
* logind: treat an empty wall message like a NULL oneLennart Poettering2017-03-14
|
* sd-login: minor header commenting improvementsLennart Poettering2017-03-14
|
* sd-login: add new sd_pid_get_cgroup() APILennart Poettering2017-03-14
| | | | | | | | | | This adds a new sd_pid_get_cgroup() call to sd-login which may be used to query the control path of a process. This is useful for programs when making use of delegation units, in order to figure out which subtree has been delegated. In light of the unified control group hierarchy this is finally safe to do, hence let's add a proper API for it, to make it easier to use this.
* sd-login: rework error handlingLennart Poettering2017-03-14
| | | | | | 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.
* cgroup: when comparing agent paths, use path_equal()Lennart Poettering2017-03-14
| | | | | After all a path is a path is a path and we should use path_equal() to comapre those.
* audit: audit calls should return ENODATA when process are not in an audit ↵Lennart Poettering2017-03-14
| | | | | | | session ENODATA is how we usually indicate such "missing info" cases, so we should do this here, too.
* util: add new uid_is_valid() callLennart Poettering2017-03-14
| | | | | | This simply factors out the uid validation checks from parse_uid() and uses them everywhere. This simply verifies that the passed UID is neither 64bit -1 nor 32bit -1.
* sd-bus: when connecting to a container, don't fall back to host busLennart Poettering2017-03-14
| | | | | | We should never connect to the host bus as fallback if connecting to a container failed via one method. Otherwise connecting to a dbus1 container will always result in a connection to the host.
* sd-bus: when connecting to a kdbus container bus pass error upLennart Poettering2017-03-14
| | | | | | We rely on the correct error used when opening the kdbus device node, hence let's make sure we pass it up from the namespaced child process to the process which actually wants to connect.
* cgroup: don't allow hidden cgroupsLennart Poettering2017-03-14
| | | | We really should care for all cgroups, and not allow hidden ones.
* cgroup: never migrate kernel threads out of the root cgroupLennart Poettering2017-03-14
| | | | It won't work anyway.
* set: return NULL on destructorsLennart Poettering2017-03-14
| | | | Like we do it pretty much everywhere else.
* logind: Listen to WMI hotkeys to catch SW_DOCK state/eventsMartin Pitt2017-03-14
| | | | | | | | | | 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-14
| | | | | | | 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.
* login: support user-bus on dbus1David Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | | | | | dbus-1.10 was just released, including systemd units to run `dbus-daemon --session` as systemd user unit. This allows using a user-bus with dbus1, just like we do per default with kdbus. All the dbus libraries have already been fixed long ago to use the user-bus as default. Hence, there's no need to set DBUS_SESSION_BUS_ADDRESS= if we use the user-bus. However, gdm and friends continue to spawn a session bus if this variable is not set (instead of checking for the existence of the user-bus). Hence, we force the user-bus, if it is available, in pam_elogind. Once gdm and friends are fixed, we can continue to drop this again. However, that might take a while. With this in place, all that is needed to make the user-bus work is: `systemctl --global enable dbus.socket` If dbus.socket is not enabled, the legacy session-bus is still used. Based on a patch by: Jan Alexander Steffens <jan.steffens@gmail.com>
* sd-event: improve debug message when we fail to remove and fd from an epollLennart Poettering2017-03-14
| | | | | Let's help users to debug issues with epoll fd removal by printing the name of the event source.
* extract_first_word: Refactor EXTRACT_DONT_COALESCE_SEPARATORS handlingFilipe Brandenburger2017-03-14
| | | | | | | | | | | | | | Refactor allocation of the result string to the top, since it is currently done in both branches of the condition. Remove unreachable code checking for EXTRACT_DONT_COALESCE_SEPARATORS when state == SEPARATOR (the only place where SEPARATOR is assigned to state follows a check for EXTRACT_DONT_COALESCE_SEPARATORS that jumps to the end of the function.) Tested by running test-util successfully. Follow up to: 206644aedeb8859801051ac170ec562c6a113a79
* extract_first_word: Refactor allocation in empty argument caseFilipe Brandenburger2017-03-14
| | | | | | | | | | | | This covers the case where an argument is an empty string, such as ''. Instead of allocating the empty string in the individual conditions when state == VALUE, just always allocate it at the end of state == START, at which point we know we will have an argument. Tested that test-util keeps passing after the refactor. Follow up to: 14e685c29d5b317b815e3e9f056648027852b07e
* util: make malloc0 ask calloc for one block of size nThomas Hindoe Paaboel Andersen2017-03-14
| | | | | | ... instead of an array of n individual bytes. Silences a lot of warnings in smatch.
* process-util: trivial optimizationLennart Poettering2017-03-14
|
* util: treat 'C' and 'POSIX' locale identicalLennart Poettering2017-03-14
|
* pager: set $LESSCHARSET when we output UTF8 charsLennart Poettering2017-03-14
| | | | | | | | | 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 systemd would output UTF-8 but less wouldn't allow it and show them as control characters.
* pager: also redirect stderrLennart Poettering2017-03-14
| | | | | | 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.
* cgroup-show: unescape cgroups on presentationLennart Poettering2017-03-14
| | | | | Let's unescape cgroups on presentation, so that we show literal unit names.
* pager: port fallback pager to use copy_bytes()Lennart Poettering2017-03-14
|
* sd-bus: it's not a user error to query the error contained in a bus messageLennart Poettering2017-03-14
| | | | | It's an OK way to check whether a message contains an erro, let's not consider this a loggable assertion event.
* basic: document that people shouldn't use refcnt.h without reasonLennart Poettering2017-03-14
| | | | | | | refcnt.h only exists for cases where objects are simultaneously handled by different threads. Otherwise it should not be used. The only case where this applies is sd_bus, really, and pretty much none of our APIs, since we do not claim thread-safety for them.
* Prep v225: Added needed udev support and re-enabled some masked cgroup ↵Sven Eden2017-03-14
| | | | functions.
* Prep v225: Applying various fixes and changes to src/systemd that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.