View | Details | Raw Unified | Return to bug 1595 | Differences between
and this patch

Collapse All | Expand All

(-)sshlogin.c (+8 lines)
Lines 93-98 store_lastlog_message(const char *user, Link Here
93
	if (!options.print_lastlog)
93
	if (!options.print_lastlog)
94
		return;
94
		return;
95
95
96
# ifdef CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG
97
	time_string = sys_auth_get_lastlogin_msg(user, uid);
98
	if (time_string != NULL) {
99
		buffer_append(&loginmsg, time_string, strlen(time_string));
100
		xfree(time_string);
101
	}
102
# else
96
	last_login_time = get_last_login_time(uid, user, hostname,
103
	last_login_time = get_last_login_time(uid, user, hostname,
97
	    sizeof(hostname));
104
	    sizeof(hostname));
98
105
Lines 107-112 store_lastlog_message(const char *user, Link Here
107
			    time_string, hostname);
114
			    time_string, hostname);
108
		buffer_append(&loginmsg, buf, strlen(buf));
115
		buffer_append(&loginmsg, buf, strlen(buf));
109
	}
116
	}
117
# endif /* CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG */
110
#endif /* NO_SSH_LASTLOG */
118
#endif /* NO_SSH_LASTLOG */
111
}
119
}
112
120
(-)openbsd-compat/port-aix.c (-5 / +14 lines)
Lines 57-62 Link Here
57
57
58
#include "port-aix.h"
58
#include "port-aix.h"
59
59
60
static char *lastlogin_msg = NULL;
61
60
# ifdef HAVE_SETAUTHDB
62
# ifdef HAVE_SETAUTHDB
61
static char old_registry[REGISTRY_SIZE] = "";
63
static char old_registry[REGISTRY_SIZE] = "";
62
# endif
64
# endif
Lines 276-298 sys_auth_record_login(const char *user, Link Here
276
    Buffer *loginmsg)
278
    Buffer *loginmsg)
277
{
279
{
278
	char *msg = NULL;
280
	char *msg = NULL;
279
	static int msg_done = 0;
280
	int success = 0;
281
	int success = 0;
281
282
282
	aix_setauthdb(user);
283
	aix_setauthdb(user);
283
	if (loginsuccess((char *)user, (char *)host, (char *)ttynm, &msg) == 0) {
284
	if (loginsuccess((char *)user, (char *)host, (char *)ttynm, &msg) == 0) {
284
		success = 1;
285
		success = 1;
285
		if (msg != NULL && loginmsg != NULL && !msg_done) {
286
		if (msg != NULL) {
286
			debug("AIX/loginsuccess: msg %s", msg);
287
			debug("AIX/loginsuccess: msg %s", msg);
287
			buffer_append(loginmsg, msg, strlen(msg));
288
			if (lastlogin_msg == NULL)
288
			xfree(msg);
289
				lastlogin_msg = msg;
289
			msg_done = 1;
290
		}
290
		}
291
	}
291
	}
292
	aix_restoreauthdb();
292
	aix_restoreauthdb();
293
	return (success);
293
	return (success);
294
}
294
}
295
295
296
char *
297
sys_auth_get_lastlogin_msg(const char *user, uid_t uid)
298
{
299
	char *msg = lastlogin_msg;
300
301
	lastlogin_msg = NULL;
302
	return msg;
303
}
304
296
#  ifdef CUSTOM_FAILED_LOGIN
305
#  ifdef CUSTOM_FAILED_LOGIN
297
/*
306
/*
298
 * record_failed_login: generic "login failed" interface function
307
 * record_failed_login: generic "login failed" interface function
(-)openbsd-compat/port-aix.h (+2 lines)
Lines 87-92 void aix_usrinfo(struct passwd *); Link Here
87
int sys_auth_allowed_user(struct passwd *, Buffer *);
87
int sys_auth_allowed_user(struct passwd *, Buffer *);
88
# define CUSTOM_SYS_AUTH_RECORD_LOGIN 1
88
# define CUSTOM_SYS_AUTH_RECORD_LOGIN 1
89
int sys_auth_record_login(const char *, const char *, const char *, Buffer *);
89
int sys_auth_record_login(const char *, const char *, const char *, Buffer *);
90
# define CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG
91
char *sys_auth_get_lastlogin_msg(const char *, uid_t);
90
# define CUSTOM_FAILED_LOGIN 1
92
# define CUSTOM_FAILED_LOGIN 1
91
#endif
93
#endif
92
94

Return to bug 1595