summaryrefslogtreecommitdiff
path: root/daemon/gdm-session-record.c
Commit message (Collapse)AuthorAgeFilesLines
* gdm-session-record: Use g_auto*Alessandro Bono2023-04-281-4/+1
|
* manager: Fix btmp record accountingRay Strode2022-10-271-4/+10
| | | | | | | | | | | | | Before a user logs in they don't have a display. btmp records currently need a display though, and they get written when the user can't log in. Furthermore, the display from X11 point of view is somewhat archaic. We use wayland by default now. In lieu of a display, this commit gives the btmp record the seat id instead.
* gdm-session-record: Don't use g_get_current_timeAlessandro Bono2022-10-271-4/+4
| | | | It is deprecated since GTimeVal is not year-2038 safe.
* gdm-session-record: Use memccpy() instead of strncpy()Robert Mader2019-08-131-9/+7
| | | | ...to silence build warnings. Suggested by Ray Strode
* daemon/gdm-session-record.c: open/close the utmp databaseJason Pleau2018-06-121-0/+4
| | | | | | | | | | | | | | pututxline() was used without first opening the utxmp database and without closing it, preventing the logout entry from being fully committed. This caused the number of logged-in users to increment after each login, as logging out did not correctly remove the user login record from utmp. This commit wraps pututxline() between setutxent() and endutxent(), making sure that the login/logout operation are fully flushed. Fixes #381
* manager: don't record wtmp entries when user unknownRay Strode2017-10-101-14/+1
| | | | | | | | | | | | | Right now we end up writing wtmp entries for the login screen user into /var/log/wtmp, but with a funky username of "(unknown)". The login screen session shouldn't get a wtmp entry, and we shouldn't ever add wtmp entries for sessions we don't know the username for. This commit fixes that. https://bugzilla.gnome.org/show_bug.cgi?id=788784
* session-record: write ut_line for remote logins tooPaul Szabo2015-08-141-2/+1
| | | | | | | | | We currently only write out ut_line for local logins. This commit makes sure it gets written out for remote logins as well. https://bugzilla.gnome.org/show_bug.cgi?id=599103
* session-record: don't set ut_idPaul Szabo2015-08-141-18/+0
| | | | | | | It's only 4 bytes big and it's really hard to come up with a useful, unique id. https://bugzilla.gnome.org/show_bug.cgi?id=599103
* session-record: simplify utmp updating logicPaul Szabo2015-08-141-56/+5
| | | | | | | | The code carefully iterates over all utmp entries trying to update existing records if found. This is not necessary putuxline will do that for us. https://bugzilla.gnome.org/show_bug.cgi?id=599103
* session-record: fix use after freePaul Szabo2015-08-141-2/+1
| | | | | | | | | hostname is getting freed before it's getting used if ut_syslen is available. This commit moves the free down a couple of lines https://bugzilla.gnome.org/show_bug.cgi?id=599103
* session-record: support NULL display name if tty available (for logout/failed)Ray Strode2015-07-011-0/+6
| | | | | | | | | | | | wayland sessions don't necessarily have a display name, so this commit just uses the display device instead. It's like commit 1edb0e4ae897cb1c53af3f3b2b913d5baf731580 but for logout and failed records. Discovered by Sinclair Yeh <syeh@vmware.com> https://bugzilla.gnome.org/show_bug.cgi?id=749404
* session-record: support NULL display name if tty availableRay Strode2015-04-021-0/+3
| | | | | | | wayland sessions don't necessarily have a display name, so this commit just uses the display device instead. https://bugzilla.gnome.org/show_bug.cgi?id=747169
* session-record: don't print that we are updating btmp if not supportedAntoine Jacoutot2013-10-111-0/+2
| | | | | While running with debug enabled, do not print that we are updating btmp if we do not HAVE_UPDWTMPX or HAVE_UPDWTMP.
* Trivial: Update FSF Address.Dominique Leuenberger2012-09-061-2/+2
| | | | Fix bug 683383.
* Only access ut_exit if availableDaniel Macks2009-07-161-0/+2
| | | | | | This fixes a build failure on OSX. See http://bugzilla.gnome.org/show_bug.cgi?id=568487
* Fix build on FreeBSD. Patch from: Joe Marcus Clarke <marcus@freebsd.org>William Jon McCann2007-11-191-3/+5
| | | | | | | | | | | | | | | | | | | | | | | 2007-11-19 William Jon McCann <mccann@jhu.edu> * common/gdm-common-unknown-origin.h: * configure.ac: * daemon/Makefile.am: * daemon/gdm-greeter-session.c: * daemon/gdm-server.c: (gdm_server_class_init): * daemon/gdm-session-record.c: (record_set_username), (gdm_session_record_login), (gdm_session_record_logout): * daemon/gdm-session-worker-job.c: (gdm_session_worker_job_class_init): * daemon/gdm-slave-proxy.c: (spawn_slave): * daemon/main.c: * gui/settings-daemon/plugins/xsettings/gdm-xsettings-manager.c: * gui/simple-chooser/gdm-host-chooser-widget.c: (do_ping): Fix build on FreeBSD. Patch from: Joe Marcus Clarke <marcus@freebsd.org> svn path=/trunk/; revision=5515
* Be careful about sending NULLs over DBus and etc.William Jon McCann2007-10-301-3/+7
| | | | | | | | | | | | | 2007-10-30 William Jon McCann <mccann@jhu.edu> * daemon/gdm-session-direct.c: (send_begin_verification), (send_begin_verification_for_user), (open_ck_session): * daemon/gdm-session-record.c: (record_set_host), (record_set_line): Be careful about sending NULLs over DBus and etc. svn path=/trunk/; revision=5461
* cast size_t values to int before passing to g_debug, to stop warnings onRay Strode2007-10-241-5/+5
| | | | | | | | | | | 2007-10-24 Ray Strode <rstrode@redhat.com> * daemon/gdm-slave.c: * daemon/gdm-session-record.c: * daemon/gdm-xdmcp-display-factory.c: cast size_t values to int before passing to g_debug, to stop warnings on 64-bit svn path=/trunk/; revision=5404
* Some trivial fixes. The #ifdef GETUTXENT got lost in the logout function.Brian Cameron2007-10-191-1/+4
| | | | | | | | | | | 2007-10-18 Brian Cameron <brian.cameron@sun.com> * daemon/gdm-session-record.c: Some trivial fixes. The #ifdef GETUTXENT got lost in the logout function. It should match the login function. Also make sure to set both tv_sec and tv_usec when doing logout. svn path=/trunk/; revision=5387
* Try to reduce the complexity of the utmp/wtmp recording code.William Jon McCann2007-10-191-160/+227
| | | | | | | | | | | | | | | | | | | 2007-10-18 William Jon McCann <mccann@jhu.edu> * daemon/gdm-session-record.c: (record_set_username), (record_set_timestamp), (record_set_pid), (record_set_id), (record_set_host), (record_set_line), (gdm_session_record_login), (gdm_session_record_logout), (gdm_session_record_failed): * daemon/gdm-session-record.h: * daemon/gdm-session.c: (gdm_session_user_verification_error_handler), (gdm_session_started_handler), (gdm_session_startup_error_handler), (gdm_session_exited_handler), (gdm_session_close): Try to reduce the complexity of the utmp/wtmp recording code. svn path=/trunk/; revision=5385
* Make username const. (gdm_session_record_write): not static.William Jon McCann2007-10-181-2/+2
| | | | | | | | | | | 2007-10-18 William Jon McCann <mccann@jhu.edu> * daemon/gdm-session-record.c (gdm_session_write_record): Make username const. (gdm_session_record_write): not static. svn path=/trunk/; revision=5383
* Make username const.William Jon McCann2007-10-181-5/+5
| | | | | | | | | | 2007-10-18 William Jon McCann <mccann@jhu.edu> * daemon/gdm-session-record.c (gdm_session_write_record): Make username const. svn path=/trunk/; revision=5382
* Separate session recording writing stuff.William Jon McCann2007-10-181-0/+298
2007-10-18 William Jon McCann <mccannwj@acsnb1> * daemon/Makefile.am: * daemon/gdm-session-record.c: (gdm_session_write_record): * daemon/gdm-session-record.h: * daemon/gdm-session.c: (gdm_session_user_verification_error_handler), (gdm_session_started_handler), (gdm_session_startup_error_handler), (gdm_session_exited_handler), (gdm_session_close): Separate session recording writing stuff. svn path=/trunk/; revision=5380