Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion loginrec.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,9 @@ construct_utmp(struct logininfo *li,
# ifdef HAVE_TYPE_IN_UTMP
/* This is done here to keep utmp constants out of struct logininfo */
switch (li->type) {
case LTYPE_FAILED:
ut->ut_type = LOGIN_PROCESS;
break;
case LTYPE_LOGIN:
ut->ut_type = USER_PROCESS;
break;
Expand Down Expand Up @@ -1732,7 +1735,7 @@ record_failed_login(struct ssh *ssh, const char *username, const char *hostname,

/* Construct a logininfo and turn it into a utmp */
memset(&li, 0, sizeof(li));
li.type = LTYPE_LOGIN;
li.type = LTYPE_FAILED;
li.pid = getpid();
strlcpy(li.line, "ssh:notty", sizeof(li.line));
strlcpy(li.username, username, sizeof(li.username));
Expand Down
1 change: 1 addition & 0 deletions loginrec.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ union login_netinfo {
*/
/* types - different to utmp.h 'type' macros */
/* (though set to the same value as linux, openbsd and others...) */
#define LTYPE_FAILED 6
#define LTYPE_LOGIN 7
#define LTYPE_LOGOUT 8

Expand Down
Loading