mirror of https://github.com/neutrinolabs/xrdp
Remove wtmp updating code
This commit is contained in:
parent
bc9b35c38c
commit
bf53a76ea1
|
@ -1,4 +1,3 @@
|
||||||
#%PAM-1.0
|
|
||||||
auth include system-remote-login
|
auth include system-remote-login
|
||||||
-auth optional pam_gnome_keyring.so
|
-auth optional pam_gnome_keyring.so
|
||||||
-auth optional pam_kwallet5.so
|
-auth optional pam_kwallet5.so
|
||||||
|
@ -8,5 +7,8 @@ account include system-remote-login
|
||||||
password include system-remote-login
|
password include system-remote-login
|
||||||
|
|
||||||
session include system-remote-login
|
session include system-remote-login
|
||||||
|
# For wtmp/lastlog support uncomment one of the following lines:-
|
||||||
|
#session optional pam_lastlog.so quiet
|
||||||
|
#session optional pam_lastlog2.so silent
|
||||||
-session optional pam_gnome_keyring.so auto_start
|
-session optional pam_gnome_keyring.so auto_start
|
||||||
-session optional pam_kwallet5.so auto_start
|
-session optional pam_kwallet5.so auto_start
|
||||||
|
|
|
@ -11,6 +11,8 @@ auth required pam_env.so readenv=1 envfile=/etc/default/locale
|
||||||
|
|
||||||
# Set the loginuid process attribute.
|
# Set the loginuid process attribute.
|
||||||
session required pam_loginuid.so
|
session required pam_loginuid.so
|
||||||
|
# Update wtmp/lastlog
|
||||||
|
session optional pam_lastlog.so quiet
|
||||||
@include common-session
|
@include common-session
|
||||||
-session optional pam_gnome_keyring.so auto_start
|
-session optional pam_gnome_keyring.so auto_start
|
||||||
-session optional pam_kwallet5.so auto_start
|
-session optional pam_kwallet5.so auto_start
|
||||||
|
|
|
@ -4,5 +4,8 @@ account include password-auth
|
||||||
|
|
||||||
# Set the loginuid process attribute.
|
# Set the loginuid process attribute.
|
||||||
session required pam_loginuid.so
|
session required pam_loginuid.so
|
||||||
|
# Update wtmp/lastlog
|
||||||
|
session optional pam_lastlog.so quiet
|
||||||
|
|
||||||
session include password-auth
|
session include password-auth
|
||||||
password include password-auth
|
password include password-auth
|
||||||
|
|
|
@ -4,5 +4,8 @@ account include common-account
|
||||||
|
|
||||||
# Set the loginuid process attribute.
|
# Set the loginuid process attribute.
|
||||||
session required pam_loginuid.so
|
session required pam_loginuid.so
|
||||||
|
# Update lastlog database
|
||||||
|
session optional pam_lastlog2.so silent
|
||||||
|
|
||||||
session include common-session
|
session include common-session
|
||||||
password include common-password
|
password include common-password
|
||||||
|
|
|
@ -2,4 +2,8 @@
|
||||||
auth include system-auth
|
auth include system-auth
|
||||||
account include system-auth
|
account include system-auth
|
||||||
password include system-auth
|
password include system-auth
|
||||||
|
|
||||||
|
# For wtmp/lastlog support uncomment one of the following lines:-
|
||||||
|
#session optional pam_lastlog.so quiet
|
||||||
|
#session optional pam_lastlog2.so silent
|
||||||
session include system-auth
|
session include system-auth
|
||||||
|
|
|
@ -19,7 +19,10 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @file sessionrecord.c
|
* @file sessionrecord.c
|
||||||
* @brief utmp/wtmp handling code
|
* @brief utmp handling code
|
||||||
|
*
|
||||||
|
* wtmp/lastlog/btmp is handled by PAM or (on FreeBSD) UTX
|
||||||
|
*
|
||||||
* Idea: Only implement actual utmp, i.e. utmpx for 99%.
|
* Idea: Only implement actual utmp, i.e. utmpx for 99%.
|
||||||
* See http://80386.nl/unix/utmpx/
|
* See http://80386.nl/unix/utmpx/
|
||||||
*/
|
*/
|
||||||
|
@ -28,7 +31,6 @@
|
||||||
#include <config_ac.h>
|
#include <config_ac.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <paths.h>
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -52,34 +54,6 @@ typedef struct utmp _utmp;
|
||||||
|
|
||||||
#define XRDP_LINE_FORMAT "xrdp:%d"
|
#define XRDP_LINE_FORMAT "xrdp:%d"
|
||||||
|
|
||||||
/*
|
|
||||||
* update the wtmp file on UTMPX platforms (~ Linux)
|
|
||||||
* but no on FreeBSD : FreeBSD uses utx to do the job
|
|
||||||
*/
|
|
||||||
#ifdef HAVE_UTMPX_H
|
|
||||||
#if !defined(__FreeBSD__)
|
|
||||||
static inline void
|
|
||||||
_updwtmp(const _utmp *ut)
|
|
||||||
{
|
|
||||||
updwtmpx(_PATH_WTMP, ut);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static inline void
|
|
||||||
_updwtmp(const _utmp ut)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#elif defined(HAVE_UTMP_H)
|
|
||||||
/* Does such system still exist ? */
|
|
||||||
_updwtmp(const _utmp *ut)
|
|
||||||
{
|
|
||||||
log_message(LOG_LEVEL_DEBUG,
|
|
||||||
"Unsupported system: HAVE_UTMP_H defined without HAVE_UTMPX_H");
|
|
||||||
updwtmp("/var/log/wtmp", ut);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prepare the utmp struct and write it.
|
* Prepare the utmp struct and write it.
|
||||||
* this can handle login and logout at once with the 'state' parameter
|
* this can handle login and logout at once with the 'state' parameter
|
||||||
|
@ -109,10 +83,6 @@ add_xtmp_entry(int pid, const char *display_id, const char *user, const char *rh
|
||||||
pututxline(&ut);
|
pututxline(&ut);
|
||||||
/* closes utmp */
|
/* closes utmp */
|
||||||
endutxent();
|
endutxent();
|
||||||
|
|
||||||
/* update the wtmp file if needed */
|
|
||||||
|
|
||||||
_updwtmp(&ut);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -121,7 +91,7 @@ utmp_login(int pid, int display, const char *user, const char *rhostname)
|
||||||
char str_display[16];
|
char str_display[16];
|
||||||
|
|
||||||
log_message(LOG_LEVEL_DEBUG,
|
log_message(LOG_LEVEL_DEBUG,
|
||||||
"adding login info for utmp/wtmp: %d - %d - %s - %s",
|
"adding login info for utmp: %d - %d - %s - %s",
|
||||||
pid, display, user, rhostname);
|
pid, display, user, rhostname);
|
||||||
g_snprintf(str_display, 15, XRDP_LINE_FORMAT, display);
|
g_snprintf(str_display, 15, XRDP_LINE_FORMAT, display);
|
||||||
|
|
||||||
|
@ -134,7 +104,7 @@ utmp_logout(int pid, int display, const char *user, const char *rhostname)
|
||||||
char str_display[16];
|
char str_display[16];
|
||||||
|
|
||||||
log_message(LOG_LEVEL_DEBUG,
|
log_message(LOG_LEVEL_DEBUG,
|
||||||
"adding logout info for utmp/wtmp: %d - %d - %s - %s",
|
"adding logout info for utmp: %d - %d - %s - %s",
|
||||||
pid, display, user, rhostname);
|
pid, display, user, rhostname);
|
||||||
g_snprintf(str_display, 15, XRDP_LINE_FORMAT, display);
|
g_snprintf(str_display, 15, XRDP_LINE_FORMAT, display);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue