summaryrefslogtreecommitdiff
path: root/src/login/logind.c
Commit message (Collapse)AuthorAge
* logind: fix borked r checkZbigniew Jędrzejewski-Szmek2018-08-24
| | | | CID #1390947, #1390952.
* logind: (void)ify all things we knowingly ignoreLennart Poettering2018-08-24
|
* logind: terminate cleanly on SIGTERM/SIGINTLennart Poettering2018-08-24
| | | | | | | Let's properly terminate on SIGTERM or SIGINT. Previously we'd just rely on the implicit process clean-up logic on UNIX. By shutting down properly on SIGTERM/SIGINT we make it easier to track down memory leaks by employing valgrind.
* logind: modernize Manager object allocation and freeingLennart Poettering2018-08-24
| | | | | | Let's propagate errors correctly, and stick to the usual naming and behaviour of these functions. Or in other words, make this closer to the matching code in machined.
* login: drop unnecessary headersYu Watanabe2018-08-24
|
* logind: move two functions to logind_core utility libZbigniew Jędrzejewski-Szmek2018-08-24
| | | | In preparation to reusing them later in other places...
* tree-wide: drop redundant _cleanup_ macros (#8810)Lennart Poettering2018-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | This drops a good number of type-specific _cleanup_ macros, and patches all users to just use the generic ones. In most recent code we abstained from defining type-specific macros, and this basically removes all those added already, with the exception of the really low-level ones. Having explicit macros for this is not too useful, as the expression without the extra macro is generally just 2ch wider. We should generally emphesize generic code, unless there are really good reasons for specific code, hence let's follow this in this case too. Note that _cleanup_free_ and similar really low-level, libc'ish, Linux API'ish macros continue to be defined, only the really high-level OO ones are dropped. From now on this should really be the rule: for really low-level stuff, such as memory allocation, fd handling and so one, go ahead and define explicit per-type macros, but for high-level, specific program code, just use the generic _cleanup_() macro directly, in order to keep things simple and as readable as possible for the uninitiated. Note that before this patch some of the APIs (notable libudev ones) were already used with the high-level macros at some places and with the generic _cleanup_ macro at others. With this patch we hence unify on the latter.
* logind: enable limiting of user session scopes using pam context objects (#8397)Jan Synacek2018-08-24
|
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* macro: introduce TAKE_PTR() macroLennart Poettering2018-08-24
| | | | | | | | | | | | | | | | This macro will read a pointer of any type, return it, and set the pointer to NULL. This is useful as an explicit concept of passing ownership of a memory area between pointers. This takes inspiration from Rust: https://doc.rust-lang.org/std/option/enum.Option.html#method.take and was suggested by Alan Jenkins (@sourcejedi). It drops ~160 lines of code from our codebase, which makes me like it. Also, I think it clarifies passing of ownership, and thus helps readability a bit (at least for the initiated who know the new macro)
* Fix elogind debug mode:Sven Eden2018-06-29
| | | | | | | | | | | | | | When switched from autotools to meson, config.h changed fundamentally. Although enabled values are still #define HAVE_FOO 1 the disabled values are nolonger undef, but now #define HAVE_FOO 0 Therefore all instances of #ifdef ENABLE_DEBUG_ELOGIND have been changed to #if ENABLE_DEBUG_ELOGIND
* Prep v238: Uncomment now needed headers and unmask now needed functions in ↵Sven Eden2018-06-05
| | | | src/login (4/6)
* logind: check file is device node before using .st_rdevLennart Poettering2018-05-30
|
* logind: trivial improvementsLennart Poettering2018-05-30
| | | | | Just some addition whitespace, some additional assert()s, and removal of redundant variables.
* Add some handling to remaining unlinkat callsZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | | | | | Coverity now started warning about this ("Calling unlinkat without checking return value (as is done elsewhere 12 out of 15 times).", and it is right: most of the time we should at list print a log message so people can figure out something is wrong when this happens. v2: - use warning level in journald too (this is unlikely to happen ever, so it should be safe to something that is visible by default).
* login,user-sessions: always warn when we fail to remove nologin fileZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | This usually is very annoying to users who then cannot log in, so make sure we always warn if that happens (selinux, or whatever other reason). This reverts a790812cb349c5cef95d1b4a20fc80ca08d3a145.
* logind: change check_gc to may_gc everywhereZbigniew Jędrzejewski-Szmek2018-05-30
|
* Suspend on lid close based on power status. (#8016)Simon Fowler2018-05-30
| | | | | | | | This change adds support for controlling the suspend-on-lid-close behaviour based on the power status as well as whether the machine is docked or has an external monitor. For backwards compatibility the new configuration file variable is ignored completely by default, and must be set explicitly before being considered in any decisions.
* log: minimize includes in log.hLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | log.h really should only include the bare minimum of other headers, as it is really pulled into pretty much everything else and already in itself one of the most basic pieces of code we have. Let's hence drop inclusion of: 1. sd-id128.h because it's entirely unneeded in current log.h 2. errno.h, dito. 3. sys/signalfd.h which we can replace by a simple struct forward declaration 4. process-util.h which was needed for getpid_cached() which we now hide in a funciton log_emergency_level() instead, which nicely abstracts the details away. 5. sys/socket.h which was needed for struct iovec, but a simple struct forward declaration suffices for that too. Ultimately this actually makes our source tree larger (since users of the functionality above must now include it themselves, log.h won't do that for them), but I think it helps to untangle our web of includes a tiny bit. (Background: I'd like to isolate the generic bits of src/basic/ enough so that we can do a git submodule import into casync for it)
* tree-wide: make the Subscribe() method calls asynchronous tooLennart Poettering2018-05-30
|
* tree-wide: install matches asynchronouslyLennart Poettering2018-05-30
| | | | | | | | | Let's remove a number of synchronization points from our service startups: let's drop synchronous match installation, and let's opt for asynchronous instead. Also, let's use sd_bus_match_signal() instead of sd_bus_add_match() where we can.
* tree-wide: make name requesting asynchronous in all our servicesLennart Poettering2018-05-30
| | | | | This optimizes service startup a bit, and makes it less prone to deadlocks.
* Move /var/lib/systemd/linger to /var/lib/elogind/.Sven Eden2018-04-23
|
* Prep v236 : Add missing SPDX-License-Identifier (5/9) src/loginSven Eden2018-03-26
|
* check_tree.pl: Do not allow commented out includes to be moved under our ↵Sven Eden2018-03-08
| | | | elogind block.
* Apply updates from upstreamSven Eden2017-12-07
|
* cgroup, unit, fragment parser: make use of new firewall functionsDaniel Mack2017-11-21
|
* Add abstraction model for BPF programsDaniel Mack2017-11-20
| | | | | This object takes a number of bpf_insn members and wraps them together with the in-kernel reference id. Will be needed by the firewall code.
* Prep v235: Catch and react on SIGINT, SIGQUIT and SIGTERMSven Eden2017-08-31
|
* Prep v235: Fix startup order and add debug logging.Sven Eden2017-08-31
|
* Prep v235: optimize elogind extra startup functionalitySven Eden2017-08-30
|
* Prep v235: Set defaults for the sleep config *after* loading the config file.Sven Eden2017-08-29
|
* Prep v235: Allow elogind to daemonize itself with "-D|--daemon".Sven Eden2017-08-16
|
* Prep v234: Eventually fix the cgroup stuff. elogind is not init.Sven Eden2017-07-27
|
* Prep v234: Apply missing upstream fixes in src/login (3/6)Sven Eden2017-07-25
|
* tree-wide: fix wrong indent (#5757)Yu Watanabe2017-07-25
| | | | Fixes wrong indent introduced by the commit 43688c49d1fdb585196d94e2e30bb29755fa591b.
* logind: save/restore session devices and their respective file descriptorsFranck Bui2017-07-25
| | | | | | | | | | | | | | | | | | | This patch ensures that session devices are saved for each session. In order to make the revokation logic work when logind is restarted, the session devices are now saved in the session state files and their respective file descriptors sent to PID1's fdstore in order to keep them open accross restart. This is mandatory in order to keep the revokation logic working. Indeed in case of input-devices, the same file descriptors must be shared by logind and a given session controller in order EVIOCREVOKE to work otherwise multiple sessions can have device access in parallel. This should be the only remaining and missing piece for making logind fully restartable. Fixes: #1163
* Rename formats-util.h to format-util.hZbigniew Jędrzejewski-Szmek2017-07-17
| | | | | | We don't have plural in the name of any other -util files and this inconsistency trips me up every time I try to type this file name from memory. "formats-util" is even hard to pronounce.
* Prep v232: Apply missing updates from upstreamSven Eden2017-07-05
|
* logind: don't hit assert when we try to free NULL manager objectLennart Poettering2017-07-05
| | | | Fixes: #4431
* Prep v231.2: Make sure logs go to syslog or kmsg if elogind was started in ↵Sven Eden2017-06-28
| | | | debug mode, even if it was started from a tty.
* Prep v231.2: Apply some minor style fixesSven Eden2017-06-19
|
* logind: don't hit assert when we try to free NULL manager objectLennart Poettering2017-06-19
| | | | | Fixes: #4431 (cherry picked from commit 84a4e6608dbda38c724ab196a226db209a50b224)
* Prep v231: Move elogind specific code in login/logind.c to login/elogind.cSven Eden2017-06-16
|
* logind: change TasksMax= value for user logins to 33%Lennart Poettering2017-06-16
| | | | | | | | | | | | | | | | | | | | Let's change from a fixed value of 12288 tasks per user to a relative value of 33%, which with the kernel's default of 32768 translates to 10813. This is a slight decrease of the limit, for no other reason than "33%" sounding like a nice round number that is close enough to 12288 (which would translate to 37.5%). (Well, it also has the nice effect of still leaving a bit of room in the PID space if there are 3 cooperating evil users that try to consume all PIDs... Also, I like my bikesheds blue). Since the new value is taken relative, and machined's TasksMax= setting defaults to 16384, 33% inside of containers is usually equivalent to 5406, which should still be ample space. To summarize: | on the host | in the container old default | 12288 | 12288 new default | 10813 | 5406
* util: introduce physical_memory_scale() to unify how we scale by physical memoryLennart Poettering2017-06-16
| | | | | The various bits of code did the scaling all different, let's unify this, given that the code is not trivial.
* Prep v230: src/logind.c: Do not call manager_free(m) if an error lead to m ↵Sven Eden2017-06-16
| | | | still being NULL.
* Prep v230: Apply missing upstream fixes and updates (6/8) src/login.Sven Eden2017-06-16
|
* logind: process session/inhibitor fds at higher priorityLennart Poettering2017-06-16
| | | | | | | Let's make sure we process session and inhibitor pipe fds (that signal sessions/inhibtors going away) at a higher priority than new bus calls that might create new sessions or inhibitors. This helps ensuring that the number of open sessions stays minimal.
* selinux: always try to load the full selinux dbZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | https://github.com/elogind/elogind/pull/2508#issuecomment-190901170 Maybe fixes https://bugzilla.redhat.com/show_bug.cgi?id=1308771.