summaryrefslogtreecommitdiff
path: root/login.c
diff options
context:
space:
mode:
Diffstat (limited to 'login.c')
-rw-r--r--login.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/login.c b/login.c
index aa01aac45..ddd58ff67 100644
--- a/login.c
+++ b/login.c
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20#include "includes.h" 20#include "includes.h"
21RCSID("$Id: login.c,v 1.3 1999/11/24 13:26:22 damien Exp $"); 21RCSID("$Id: login.c,v 1.4 1999/11/25 00:54:59 damien Exp $");
22 22
23#include <utmp.h> 23#include <utmp.h>
24#include "ssh.h" 24#include "ssh.h"
@@ -30,12 +30,16 @@ RCSID("$Id: login.c,v 1.3 1999/11/24 13:26:22 damien Exp $");
30# include <lastlog.h> 30# include <lastlog.h>
31#endif 31#endif
32 32
33/* Returns the time when the user last logged in. Returns 0 if the 33/*
34 information is not available. This must be called before record_login. 34 * Returns the time when the user last logged in. Returns 0 if the
35 The host the user logged in from will be returned in buf. */ 35 * information is not available. This must be called before record_login.
36 * The host the user logged in from will be returned in buf.
37 */
36 38
37/* Returns the time when the user last logged in (or 0 if no previous login 39/*
38 is found). The name of the host used last time is returned in buf. */ 40 * Returns the time when the user last logged in (or 0 if no previous login
41 * is found). The name of the host used last time is returned in buf.
42 */
39 43
40unsigned long 44unsigned long
41get_last_login_time(uid_t uid, const char *logname, 45get_last_login_time(uid_t uid, const char *logname,
@@ -64,8 +68,10 @@ get_last_login_time(uid_t uid, const char *logname,
64 return ll.ll_time; 68 return ll.ll_time;
65} 69}
66 70
67/* Records that the user has logged in. I these parts of operating systems 71/*
68 were more standardized. */ 72 * Records that the user has logged in. I these parts of operating systems
73 * were more standardized.
74 */
69 75
70void 76void
71record_login(int pid, const char *ttyname, const char *user, uid_t uid, 77record_login(int pid, const char *ttyname, const char *user, uid_t uid,
@@ -95,9 +101,10 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid,
95 101
96 /* Update lastlog unless actually recording a logout. */ 102 /* Update lastlog unless actually recording a logout. */
97 if (strcmp(user, "") != 0) { 103 if (strcmp(user, "") != 0) {
98 /* It is safer to bzero the lastlog structure first 104 /*
99 because some systems might have some extra fields in it 105 * It is safer to bzero the lastlog structure first because
100 (e.g. SGI) */ 106 * some systems might have some extra fields in it (e.g. SGI)
107 */
101 memset(&ll, 0, sizeof(ll)); 108 memset(&ll, 0, sizeof(ll));
102 109
103 /* Update lastlog. */ 110 /* Update lastlog. */