summaryrefslogtreecommitdiff
path: root/src/login/loginctl.c
Commit message (Collapse)AuthorAge
* Prep v227: Removed src/shared/cgroup-show.[hc], it is not needed.Sven Eden2017-04-10
|
* [4/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* loginctl: print nontrivial properties in logictl show-*Lukas Nykryn2017-03-29
|
* 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.
* 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.
* 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
* Add poweroff, suspend etc. loginctl commandsSven Eden2017-03-14
| | | | | | | * src/login/loginctl.c: Add poweroff, reboot, suspend, hibernate, and hybrid-sleep commands. Normally these are handled by systemctl but since elogind is targeted at the no-systemd use case, we incorporate them here.
* Prep v226: loginctl.c: Fix call to (changed) cg_is_empty_recursive().Sven Eden2017-03-14
|
* Prep v225: Applying various fixes and changes to src/login that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.
* Prep v222: Update build system:Sven Eden2017-03-14
| | | | | | | | - The content of the man pages directory has been overhauled - Makefile-man.am was regenerated - Makefile.am and configure.ac needed a few addtitions and fixes - Some masked functions had to be unmasked - Now superfluous files have been removed
* Prep v221: Some more cleanup and a few fixesSven Eden2017-03-14
| | | | | | | | | The files - src/core/org.freedesktop.systemd.policy.in.in and - src/core/systemd.pc.in have been deleted as they are not needed. The other changes are some minor fixes.
* Prep v220: Use new cgroups functionsSven Eden2017-03-14
| | | | | Prep v220: Update logind and loginctl to upstream version. Prep v220: src/shared/rm-rf.c does not need to be able to handle btrfs subvolumes for elogind.
* sd-bus: introduce new sd_bus_flush_close_unref() callLennart Poettering2017-03-14
| | | | | | | | | | | | | | | | sd_bus_flush_close_unref() is a call that simply combines sd_bus_flush() (which writes all unwritten messages out) + sd_bus_close() (which terminates the connection, releasing all unread messages) + sd_bus_unref() (which frees the connection). The combination of this call is used pretty frequently in systemd tools right before exiting, and should also be relevant for most external clients, and is hence useful to cover in a call of its own. Previously the combination of the three calls was already done in the _cleanup_bus_close_unref_ macro, but this was only available internally. Also see #327
* tree-wide: fix memory leaks in users of bus_map_all_properties()David Herrmann2017-03-14
| | | | | | | | | | If you use bus_map_all_properties(), you must be aware that it might touch output variables even though it may fail. This is, because we parse many different bus-properties and cannot tell how to clean them up, in case we fail deep down in the parser. Fix all callers of bus_map_all_properties() to correctly cleanup any context structures at all times.
* util: split out signal-util.[ch] from util.[ch]Lennart Poettering2017-03-14
| | | | No functional changes.
* shared: add terminal-util.[ch]Ronny Chevalier2017-03-14
|
* shared: add process-util.[ch]Ronny Chevalier2017-03-14
|
* Fix argument order when checking inhibitorsAndy Wingo2015-09-01
|
* Add poweroff, suspend etc. loginctl commandsAndy Wingo2015-08-29
| | | | | | | * src/login/loginctl.c: Add poweroff, reboot, suspend, hibernate, and hybrid-sleep commands. Normally these are handled by systemctl but since elogind is targeted at the no-systemd use case, we incorporate them here.
* Compiling.Andy Wingo2015-04-08
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* logind: open up most bus calls for unpriviliged processes, using PolicyKitLennart Poettering2015-02-18
| | | | | | Also, allow clients to alter their own objects without any further priviliges. i.e. this allows clients to kill and lock their own sessions without involving PK.
* loginctl: fix misuse compound literalsLennart Poettering2015-01-14
| | | | | The lifetime of compound literals is bound to the local scope, we hence cannot refernce them outside of it.
* loginctl: make session/user arguments optional for a number commands, and ↵Lennart Poettering2015-01-09
| | | | | | | | imply calling session/user instead This turns "lock-session", "activate", "unlock-session", "enable-linger", "disable-linger" into commands that take no argument, optionally in which case the callers session/user is implied.
* loginctl: make "loginctl session-status" without session ID show the ↵Lennart Poettering2015-01-09
| | | | | | caller's session status Similar for user-status and seat-status.
* loginctl: port to generic verbs.h APILennart Poettering2015-01-08
|
* systemctl,loginctl: start polkit agent for all polkit enabled operationsLennart Poettering2015-01-08
|
* loginctl: show the 10 most recent log user/session log lines in "loginctl ↵Lennart Poettering2015-01-08
| | | | user-status" and "loginctl session-status"
* loginctl: reindent --help textLennart Poettering2014-12-26
|
* loginctl: add more --help sectionsLennart Poettering2014-12-26
|
* sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering2014-12-24
| | | | | | | Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
* use correct format typesThomas Hindoe Paaboel Andersen2014-12-11
|
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-28
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* bus: always explicitly close bus from main programsLennart Poettering2014-08-04
| | | | | | | | | | | | | | Since b5eca3a2059f9399d1dc52cbcf9698674c4b1cf0 we don't attempt to GC busses anymore when unsent messages remain that keep their reference, when they otherwise are not referenced anymore. This means that if we explicitly want connections to go away, we need to close them. With this change we will no do so explicitly wherver we connect to the bus from a main program (and thus know when the bus connection should go away), or when we create a private bus connection, that really should go away after our use. This fixes connection leaks in the NSS and PAM modules.
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-03
| | | | | | | | | | | | | | | | getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
* man: introduce new "Desktop" property for sessionsLennart Poettering2014-02-05
| | | | | | This is initialized from XDG_SESSION_DESKTOP and is useful for GNOME to recognize its own sessions. It's supposed to be set to a short string identifying the session, such as "kde" or "gnome".
* loginctl: fix output of type with classMantas Mikulėnas2013-12-22
|
* loginctl: correctly show session IDs on session-statusDjalal Harouni2013-12-21
| | | | | | | | | | | | | | | | | | | | | | | | Commit f8f14b3654bcd introduced a regression that makes loginctl session-status to not show the correct session ID(s) In print_session_status_info() the map[] array, element "Seat" receives the offset of the "id" in "SessionStatusInfo" struct instead of the offset of the "seat" member. This will cause prop_map_first_of_struct() function to overwrite the SessionStatusInfo.id memory with seats if there are any. Fix this typo by using the "seat" member. Before: - tixxdz (1000) Since: Sat 2013-12-21 10:07:23 CET; 5h 26min ago Leader: 1265 (sshd) After: 1 - tixxdz (1000) Since: Sat 2013-12-21 10:07:23 CET; 5h 26min ago Leader: 1265 (sshd)
* loginctl,shell-completions: fix listing of sessions/users/seatsZbigniew Jędrzejewski-Szmek2013-12-21
|
* loginctl: improve print_{session|user|seat}_status_info() functionsDjalal Harouni2013-12-18
| | | | | | | | | | | | | | 1) Instead of checking if we need to print a new line on each iteration, pass the "new_line" as a pointer to those functions, so they can use it to check if a new line is needed. This makes the code more consistent as it is done in other places: machinectl, systemctl... 2) Move the error messages from show_{session|user|seat}() to their appropriate print_{session|user|seat}_status_info() functions, this will prevent from logging an error message twice in case show_properties() fails and it will improve code readability. 3) Also do not ignore error codes on these functions.
* loginctl: use show_properties() to get login1 propertiesDjalal Harouni2013-12-18
| | | | | | | | Commit f8f14b3654bcd introduced a regression that makes loginctl ignore the "--property" option. This patch fixes the bug, it uses a new show_properties() function to query and filter properties.
* loginctl: replace strv_append() by strv_extend()Djalal Harouni2013-12-18
|
* Help output spring cleaningZbigniew Jędrzejewski-Szmek2013-12-08
| | | | | Use [brackets] only for optional elements. Use <optional> in XML sources.
* logind: make VT numbers unsignedDavid Herrmann2013-11-28
| | | | | | | | | | Fix the whole code to use "unsigned int" for vtnr. 0 is an invalid vtnr so we don't need negative numbers at all. Note that most code already assumes it's unsigned so in case there's a negative vtnr, our code may, under special circumstances, silently break. So this patch makes sure all sources of vtnrs verify the validity. Also note that the dbus api already uses unsigned ints.
* bus: log message parsing errors everywhere with a generalized ↵Lennart Poettering2013-11-07
| | | | bus_log_parse_error()
* polkit: don't spawn local client if we access a remote systemLennart Poettering2013-11-07
|
* loginctl: convert to sd-busSimon Peeters2013-11-07
| | | | | | NOTE: the show-* subcommands do not print some properties: this are those with types like (so), a(so), (uo),... we need to fix this, but I'm not sure how