summaryrefslogtreecommitdiff
path: root/src/login/loginctl.c
Commit message (Collapse)AuthorAge
* 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
* clients: unify how we invoke getopt_long()Lennart Poettering2013-11-06
| | | | | Among other things this makes sure we always expose a --version command and show it in the help texts.
* loginctl: suppress cgroup tree output if cgroup is emptyLennart Poettering2013-07-11
| | | | same for machinectl
* loginctl: restore cgroup display for status outputLennart Poettering2013-07-11
| | | | Same for machinectl.
* machined: split out machine registration stuff from logindLennart Poettering2013-07-02
| | | | | | | Embedded folks don't need the machine registration stuff, hence it's nice to make this optional. Also, I'd expect that machinectl will grow additional commands quickly, for example to join existing containers and suchlike, hence it's better keeping that separate from loginctl.
* logind: add infrastructure to keep track of machines, and move to slicesLennart Poettering2013-06-20
| | | | | | | | | | | | | | | | | | | | - This changes all logind cgroup objects to use slice objects rather than fixed croup locations. - logind can now collect minimal information about running VMs/containers. As fixed cgroup locations can no longer be used we need an entity that keeps track of machine cgroups in whatever slice they might be located. Since logind already keeps track of users, sessions and seats this is a trivial addition. - nspawn will now register with logind and pass various bits of metadata along. A new option "--slice=" has been added to place the container in a specific slice. - loginctl gained commands to list, introspect and terminate machines. - user.slice and machine.slice will now be pulled in by logind.service, since only logind.service requires this slice.
* cgls,loginctl,systemctl: fix -lZbigniew Jędrzejewski-Szmek2013-06-19
| | | | | Fixup for 98a6e13 "journalctl,loginctl,systemctl,systemd-cgls: add -l as alias for --full".
* journalctl,loginctl,systemctl,systemd-cgls: add -l as alias for --fullDaniel Albers2013-06-17
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=65850
* Allow for the use of @ in remote host callsDaniel Wallace2013-06-09
| | | | | Without this you have to use %40 with the -H flag because dbus doesn't like the @ sign being unescaped.
* inhbit: show comm field of inhibiting processesLennart Poettering2013-04-24
|
* Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek2013-04-05
| | | | | | | | | | | | | | | | | | | | | | | Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert.
* logind: exploit previous cleanups and simplify returnsZbigniew Jędrzejewski-Szmek2013-03-18
|
* logind: Make more use of cleanup macrosColin Walters2013-03-18
|
* pager: introduce "jump to end" optionHarald Hoyer2013-03-07
| | | | | | | | $ journalctl -be is what you want :) https://bugzilla.redhat.com/show_bug.cgi?id=867841
* logind: add UnlockSessions() clal to complement LockSessions()Lennart Poettering2013-01-24
|
* systemctl,loginctl,cgls: do not ellipsize cgroup members when --full is ↵Lukas Nykryn2013-01-16
| | | | | | | | | | | | | | | | | | | | specified New file output.h with output flags and modes. --full parameter also for cgls and loginctl. Include 'all' parameter in flags (show_cgroup_by_path, show_cgroup, show_cgroup_and_extra, show_cgroup_and_extra_by_spec). get_process_cmdline with max_length == 0 will not ellipsize output. Replace LINE_MAX with 0 in some calls of get_process_cmdline. [zj: Default to --full when under pager for clgs. Drop '-f' since it wasn't documented and didn't actually work. Reindent a bit. ]
* build-sys: drop all distribution specfic checksLennart Poettering2013-01-04
| | | | Yay, we now have a completely generic systemd. No distribution specific checks anymore!
* time-util: also rename FORMAT_TIMESTAMP_PRETTY → _MAXLennart Poettering2012-11-23
|
* util: rename format_timestamp_pretty() to format_timestamp_relative() ↵Lennart Poettering2012-11-23
| | | | because that describes much better what it does
* enable localization for common *ctl commandsDave Reisner2012-11-12
|
* util: unify usage of on_tty() in util.cLennart Poettering2012-10-19
|
* loginctl: show pager also for status commandLennart Poettering2012-10-17
|
* timedatectl: introduce new command line client for timedatedLennart Poettering2012-10-17
| | | | | | Much like logind has a client in loginctl, and journald in journalctl introduce timedatectl, to change the system time (incl. RTC), timezones and related settings.