From 8493e08667ca2708df08b3f45042151d15798897 Mon Sep 17 00:00:00 2001
From: Koichiro IWAO
Date: Fri, 6 Oct 2017 10:55:37 +0900
Subject: [PATCH] cosmetic changes
---
sesman/sessionrecord.c | 19 +++++++++++--------
sesman/sessionrecord.h | 5 +----
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/sesman/sessionrecord.c b/sesman/sessionrecord.c
index f3493380..ff06b397 100644
--- a/sesman/sessionrecord.c
+++ b/sesman/sessionrecord.c
@@ -50,16 +50,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));
+ 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));
+ 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));
/* utmp */
setutxent();
@@ -74,6 +74,7 @@ add_xtmp_entry(int pid, const char *line, const char *user, const char *rhostnam
log_message(LOG_LEVEL_DEBUG, "HAVE_UTMP_H");
updwtmp("/var/log/wtmp", &ut);
#endif
+
return 0;
}
@@ -83,9 +84,10 @@ utmp_login(int pid, int display, const char *user, const char *rhostname)
char str_display[16];
log_message(LOG_LEVEL_DEBUG,
- "adding login info for utmp/wtmp: %d - %d - %s - %s",
- pid, display, user, rhostname);
+ "adding login info for utmp/wtmp: %d - %d - %s - %s",
+ pid, display, user, rhostname);
g_snprintf(str_display, 15, XRDP_LINE_FORMAT, display);
+
return add_xtmp_entry(pid, str_display, user, rhostname, USER_PROCESS);
}
@@ -95,8 +97,9 @@ utmp_logout(int pid, int display, const char *user, const char *rhostname)
char str_display[16];
log_message(LOG_LEVEL_DEBUG,
- "adding logout info for utmp/wtmp: %d - %d - %s - %s",
- pid, display, user, rhostname);
+ "adding logout info for utmp/wtmp: %d - %d - %s - %s",
+ pid, display, user, rhostname);
g_snprintf(str_display, 15, XRDP_LINE_FORMAT, display);
+
return add_xtmp_entry(pid, str_display, user, rhostname, DEAD_PROCESS);
}
diff --git a/sesman/sessionrecord.h b/sesman/sessionrecord.h
index 1dbe9e6e..b52c3093 100644
--- a/sesman/sessionrecord.h
+++ b/sesman/sessionrecord.h
@@ -26,7 +26,6 @@
#ifndef SESSIONRECORD_H
#define SESSIONRECORD_H
-
#ifdef HAVE_UTMPX_H
#include
typedef struct utmpx _utmp;
@@ -35,10 +34,8 @@ typedef struct utmpx _utmp;
typedef struct utmp _utmp;
#endif
-
-
-
#define XRDP_LINE_FORMAT "xrdp:%d"
+
/**
*
* @brief