View | Details | Raw Unified | Return to bug 5091
Collapse All | Expand All

(-)modules/pam_lastlog/pam_lastlog.c (-3 / +7 lines)
Lines 1-7 Link Here
1
/* pam_lastlog module */
1
/* pam_lastlog module */
2
2
3
/*
3
/*
4
 * $Id: pam_lastlog.c,v 1.4 2001/10/12 05:56:26 agmorgan Exp $
4
 * $Id: pam_lastlog.c,v 1.5 2003/11/25 09:00:06 kukuk Exp $
5
 *
5
 *
6
 * Written by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
6
 * Written by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
7
 *
7
 *
Lines 254-263 Link Here
254
254
255
	if (!(announce & LASTLOG_QUIET)) {
255
	if (!(announce & LASTLOG_QUIET)) {
256
	    if (last_login.ll_time) {
256
	    if (last_login.ll_time) {
257
		time_t ll_time;
257
		char *the_time;
258
		char *the_time;
258
		char *remark;
259
		char *remark;
259
260
260
		the_time = ctime(&last_login.ll_time);
261
		ll_time = last_login.ll_time;
262
		the_time = ctime(&ll_time);
261
		the_time[-1+strlen(the_time)] = '\0';    /* delete '\n' */
263
		the_time[-1+strlen(the_time)] = '\0';    /* delete '\n' */
262
264
263
		remark = malloc(LASTLOG_MAXSIZE);
265
		remark = malloc(LASTLOG_MAXSIZE);
Lines 319-331 Link Here
319
321
320
	/* write latest value */
322
	/* write latest value */
321
	{
323
	{
324
	    time_t ll_time;
322
	    const char *remote_host=NULL
325
	    const char *remote_host=NULL
323
		, *terminal_line=DEFAULT_TERM;
326
		, *terminal_line=DEFAULT_TERM;
324
327
325
	    /* set this login date */
328
	    /* set this login date */
326
	    D(("set the most recent login time"));
329
	    D(("set the most recent login time"));
327
330
328
	    (void) time(&last_login.ll_time);    /* set the time */
331
	    (void) time(&ll_time);    /* set the time */
332
            last_login.ll_time = ll_time;
329
333
330
	    /* set the remote host */
334
	    /* set the remote host */
331
	    (void) pam_get_item(pamh, PAM_RHOST, (const void **)&remote_host);
335
	    (void) pam_get_item(pamh, PAM_RHOST, (const void **)&remote_host);

Return to bug 5091