summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* 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
* po: update Polish translationPiotr Drąg2017-03-14
|
* 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.
* Prep v225: Applying various fixes and changes to src/shared that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.
* Prep v225: Applying various fixes and changes to src/login that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.
* Prep v225: Applying various fixes and changes to src/libelogind/sd-login ↵Sven Eden2017-03-14
| | | | that got lost during git am transfer.
* Prep v225: Applying various fixes and changes to src/libelogind/sd-event ↵Sven Eden2017-03-14
| | | | that got lost during git am transfer.
* Prep v225: Applying various fixes and changes to src/libelogind/sd-bus that ↵Sven Eden2017-03-14
| | | | got lost during git am transfer.
* Prep v225: Applying various fixes and changes to src/cgroups-agent that got ↵Sven Eden2017-03-14
| | | | lost during git am transfer.
* Prep v225: Applying various fixes and changes to src/basic that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.
* Prep v225: Regenerate Makefile-man.amSven Eden2017-03-14
|
* Prep v225: Remove some orphaned filesSven Eden2017-03-14
|
* Prep v225: Sync build files with upstreamSven Eden2017-03-14
|
* bus-util: make more properties settable in --property=Lennart Poettering2017-03-14
| | | | | Add a couple of new properties to the supported set we can pass in systemd-run's and systemd-nspawn's --property= switch.
* sd-bus: don't list activators as proper peersDavid Herrmann2017-03-14
| | | | | | | | If a connection passed KDBUS_HELLO_ACTIVATOR, it cannot do I/O on the bus. Hence, we should not treat it as proper peer. To actually query it, you have to explicitly ask for activators. This makes kdbus in-line with what dbus-daemon does.
* logind: get a fresh file descriptor to clean up a VTOwen W. Taylor2017-03-14
| | | | | | | | | | | | When the controlling process exits, any existing file descriptors for that FD will be marked as hung-up and ioctls on them will file with EIO. To work around this, open a new file descriptor for the VT we want to clean up. Thanks to Ray Strode for help in sorting out the problem and coming up with a fix! https://github.com/systemd/systemd/issues/989
* logind: use open_terminal() instead of open()Owen W. Taylor2017-03-14
| | | | | | | | | | | The open_terminal() function adds retries in case a terminal is in the process of being closed when we open it, and should generally be used to open a terminal. We especially need it for code that a subsequent commit adds that reopens the terminal at session shut-down time; such races would be more likely in that case. Found by Ray Strode.
* Bug #944: Replacement of a free() call by mfree()Markus Elfring2017-03-14
| | | | | The function "mfree" should be called instead of "free" at a specific source code place.
* logind: actually fail on OOMThomas Hindoe Paaboel Andersen2017-03-14
| | | | | | | | | | | | | | | Since dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 the two OOM's are ignored as the value of r will be overwritten and we only log in the fail section anyway. This patch jumps to fail on OOM. Note that this is different behavior compared to both the current code and previous to dacd6cee76a08331b8c8616c5f30f70ee49aa2f9. Before that commit we would log that saving the inhibit data failed, but still write the file, though without the WHO/WHY section. CID# 1313545
* Coverity #1299015reverendhomer2017-03-14
| | | | bus can never be NULL due to assert
* sd-daemon: return EBADF for invalid fd numbersZbigniew Jędrzejewski-Szmek2017-03-14
| | | | This matches what open(2) and other system functions do.
* sd-bus: ignore BLOOM_FILTER kdbus itemsLennart Poettering2017-03-14
| | | | | The kernel nowadays sends these along, and that's OK, hence don't even debug log about it, but completely ignore it.
* Use getxpid syscall on alpha for raw_getpid()Matt Turner2017-03-14
| | | | | Alpha does not have a getpid syscall, but rather has getxpid to match OSF/1.
* basic: add LIST_INSERT_BEFOREAlex Crawford2017-03-14
| | | | | | Similar in function to LIST_INSERT_AFTER, this will insert a new element into the list before the specified position. If the specified position is NULL, the element is added as the tail of the list.
* terminal-util: no real reason to assert on O_CREATLennart Poettering2017-03-14
| | | | That's just handle this as a normal error.