mirror of https://github.com/neutrinolabs/xrdp
parent
58b3989655
commit
22f17ad123
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include "log.h"
|
||||
#include "os_calls.h"
|
||||
#include "string_calls.h"
|
||||
#include "sessionrecord.h"
|
||||
|
||||
/*
|
||||
|
@ -51,16 +52,16 @@ add_xtmp_entry(int pid, const char *line, const char *user, const char *rhostnam
|
|||
_utmp ut;
|
||||
struct timeval tv;
|
||||
|
||||
memset(&ut, 0, sizeof(ut));
|
||||
g_memset(&ut, 0, sizeof(ut));
|
||||
|
||||
ut.ut_type=state;
|
||||
ut.ut_pid = pid;
|
||||
gettimeofday(&tv, NULL);
|
||||
ut.ut_tv.tv_sec = tv.tv_sec;
|
||||
ut.ut_tv.tv_usec = tv.tv_usec;
|
||||
strncpy(ut.ut_line, line , sizeof(ut.ut_line));
|
||||
strncpy(ut.ut_user, user , sizeof(ut.ut_user));
|
||||
strncpy(ut.ut_host, rhostname, sizeof(ut.ut_host));
|
||||
g_strncpy(ut.ut_line, line , sizeof(ut.ut_line));
|
||||
g_strncpy(ut.ut_user, user , sizeof(ut.ut_user));
|
||||
g_strncpy(ut.ut_host, rhostname, sizeof(ut.ut_host));
|
||||
|
||||
/* utmp */
|
||||
setutxent();
|
||||
|
|
|
@ -36,16 +36,14 @@ typedef struct utmp _utmp;
|
|||
|
||||
#define XRDP_LINE_FORMAT "xrdp:%d"
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief
|
||||
*
|
||||
* @param pid
|
||||
* @return 0
|
||||
*/
|
||||
|
||||
int add_xtmp_entry(int pid, const char *line, const char *user, const char *rhostname, short state);
|
||||
|
||||
/**
|
||||
* @brief functions for adding utmp entries. one at login, one for logout
|
||||
*
|
||||
* @param pid of the session, display, login, and hostname
|
||||
* @return 0
|
||||
*/
|
||||
int utmp_login(int pid, int display, const char *user, const char *rhostname);
|
||||
|
||||
int utmp_logout(int pid, int display, const char *user, const char *rhostname);
|
||||
|
|
Loading…
Reference in New Issue