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

(-)man/last.1.orig (-2 / +4 lines)
Lines 12-18 last, lastb \- show listing of last logg Link Here
12
.RB [ \-R ]
12
.RB [ \-R ]
13
.RB [ \-\fInum\fP ]
13
.RB [ \-\fInum\fP ]
14
.RB "[ \-\fBn\fP \fInum\fP ]"
14
.RB "[ \-\fBn\fP \fInum\fP ]"
15
.RB [ \-adiox ]
15
.RB [ \-adFiox ]
16
.RB "[ \-\fBf\fP \fIfile\fP ]"
16
.RB "[ \-\fBf\fP \fIfile\fP ]"
17
.RB "[ \-\fBt\fP \fIYYYYMMDDHHMMSS\fP ]"
17
.RB "[ \-\fBt\fP \fIYYYYMMDDHHMMSS\fP ]"
18
.RI [ name... ]
18
.RI [ name... ]
Lines 23-29 last, lastb \- show listing of last logg Link Here
23
.RB [ \-\fInum\fP ]
23
.RB [ \-\fInum\fP ]
24
.RB "[ \-\fBn\fP \fInum\fP ]"
24
.RB "[ \-\fBn\fP \fInum\fP ]"
25
.RB "[ \-\fBf\fP \fIfile\fP ]"
25
.RB "[ \-\fBf\fP \fIfile\fP ]"
26
.RB [ \-adiox ]
26
.RB [ \-adFiox ]
27
.RI [ name... ]
27
.RI [ name... ]
28
.RI [ tty... ]
28
.RI [ tty... ]
29
.\"}}}
29
.\"}}}
Lines 69-74 with the next flag. Link Here
69
For non-local logins, Linux stores not only the host name of the remote
69
For non-local logins, Linux stores not only the host name of the remote
70
host but its IP number as well. This option translates the IP number
70
host but its IP number as well. This option translates the IP number
71
back into a hostname.
71
back into a hostname.
72
.IP \fB\-F\fP
73
Print full login and logout times and dates.
72
.IP \fB\-i\fP
74
.IP \fB\-i\fP
73
This option is like \fB-d\fP in that it displays the IP number of the remote
75
This option is like \fB-d\fP in that it displays the IP number of the remote
74
host, but it displays the IP number in numbers-and-dots notation.
76
host, but it displays the IP number in numbers-and-dots notation.
(-)src/last.c.orig (-11 / +32 lines)
Lines 70-75 int showhost = 1; /* Show hostname too? Link Here
70
int altlist = 0;	/* Show hostname at the end. */
70
int altlist = 0;	/* Show hostname at the end. */
71
int usedns = 0;		/* Use DNS to lookup the hostname. */
71
int usedns = 0;		/* Use DNS to lookup the hostname. */
72
int useip = 0;		/* Print IP address in number format */
72
int useip = 0;		/* Print IP address in number format */
73
int fulltime = 0;	/* Print full dates and times */
73
int oldfmt = 0;		/* Use old libc5 format? */
74
int oldfmt = 0;		/* Use old libc5 format? */
74
char **show = NULL;	/* What do they want us to show */
75
char **show = NULL;	/* What do they want us to show */
75
char *ufile;		/* Filename of this file */
76
char *ufile;		/* Filename of this file */
Lines 388-396 int list(struct utmp *p, time_t t, int w Link Here
388
	 */
389
	 */
389
	tmp = (time_t)p->ut_time;
390
	tmp = (time_t)p->ut_time;
390
	strcpy(logintime, ctime(&tmp));
391
	strcpy(logintime, ctime(&tmp));
391
	logintime[16] = 0;
392
	if (fulltime)
392
	sprintf(logouttime, "- %s", ctime(&t) + 11);
393
		sprintf(logouttime, "- %s", ctime(&t));
393
	logouttime[7] = 0;
394
	else {
395
		logintime[16] = 0;
396
		sprintf(logouttime, "- %s", ctime(&t) + 11);
397
		logouttime[7] = 0;
398
	}
394
	secs = t - p->ut_time;
399
	secs = t - p->ut_time;
395
	mins  = (secs / 60) % 60;
400
	mins  = (secs / 60) % 60;
396
	hours = (secs / 3600) % 24;
401
	hours = (secs / 3600) % 24;
Lines 409-421 int list(struct utmp *p, time_t t, int w Link Here
409
			break;
414
			break;
410
		case R_NOW:
415
		case R_NOW:
411
			length[0] = 0;
416
			length[0] = 0;
412
			sprintf(logouttime, "  still");
417
			if (fulltime)
413
			sprintf(length, "logged in");
418
				sprintf(logouttime, "  still logged in");
419
			else {
420
				sprintf(logouttime, "  still");
421
				sprintf(length, "logged in");
422
			}
414
			break;
423
			break;
415
		case R_PHANTOM:
424
		case R_PHANTOM:
416
			length[0] = 0;
425
			length[0] = 0;
417
			sprintf(logouttime, "   gone");
426
			if (fulltime)
418
			sprintf(length, "- no logout");
427
				sprintf(logouttime, "  gone - no logout");
428
			else {
429
				sprintf(logouttime, "   gone");
430
				sprintf(length, "- no logout");
431
			}
419
			break;
432
			break;
420
		case R_REBOOT:
433
		case R_REBOOT:
421
			logouttime[0] = 0;      /* Print machine uptime */
434
			logouttime[0] = 0;      /* Print machine uptime */
Lines 451-468 int list(struct utmp *p, time_t t, int w Link Here
451
#endif
464
#endif
452
		if (!altlist) {
465
		if (!altlist) {
453
			snprintf(final, sizeof(final),
466
			snprintf(final, sizeof(final),
454
				"%-8.8s %-12.12s %-16.16s "
467
				fulltime ?
455
				"%-16.16s %-7.7s %-12.12s\n",
468
				"%-8.8s %-12.12s %-16.16s %-24.24s %-26.26s %-12.12s\n" :
469
				"%-8.8s %-12.12s %-16.16s %-16.16s %-7.7s %-12.12s\n",
456
				p->ut_name, utline,
470
				p->ut_name, utline,
457
				domain, logintime, logouttime, length);
471
				domain, logintime, logouttime, length);
458
		} else {
472
		} else {
459
			snprintf(final, sizeof(final), 
473
			snprintf(final, sizeof(final), 
474
				fulltime ?
475
				"%-8.8s %-12.12s %-24.24s %-26.26s %-12.12s %s\n" :
460
				"%-8.8s %-12.12s %-16.16s %-7.7s %-12.12s %s\n",
476
				"%-8.8s %-12.12s %-16.16s %-7.7s %-12.12s %s\n",
461
				p->ut_name, utline,
477
				p->ut_name, utline,
462
				logintime, logouttime, length, domain);
478
				logintime, logouttime, length, domain);
463
		}
479
		}
464
	} else
480
	} else
465
		snprintf(final, sizeof(final),
481
		snprintf(final, sizeof(final),
482
			fulltime ?
483
			"%-8.8s %-12.12s %-24.24s %-26.26s %-12.12s\n" :
466
			"%-8.8s %-12.12s %-16.16s %-7.7s %-12.12s\n",
484
			"%-8.8s %-12.12s %-16.16s %-7.7s %-12.12s\n",
467
			p->ut_name, utline,
485
			p->ut_name, utline,
468
			logintime, logouttime, length);
486
			logintime, logouttime, length);
Lines 492-498 void usage(char *s) Link Here
492
{
510
{
493
	fprintf(stderr, "Usage: %s [-num | -n num] [-f file] "
511
	fprintf(stderr, "Usage: %s [-num | -n num] [-f file] "
494
			"[-t YYYYMMDDHHMMSS] "
512
			"[-t YYYYMMDDHHMMSS] "
495
			"[-R] [-a] [-d] [-i] [-o] [-x] "
513
			"[-R] [-a] [-d] [-F] [-i] [-o] [-x] "
496
			"[username..] [tty..]\n", s);
514
			"[username..] [tty..]\n", s);
497
515
498
	exit(1);
516
	exit(1);
Lines 563-569 int main(int argc, char **argv) Link Here
563
  progname = mybasename(argv[0]);
581
  progname = mybasename(argv[0]);
564
582
565
  /* Process the arguments. */
583
  /* Process the arguments. */
566
  while((c = getopt(argc, argv, "f:n:Rxadiot:0123456789")) != EOF)
584
  while((c = getopt(argc, argv, "f:n:RxadFiot:0123456789")) != EOF)
567
    switch(c) {
585
    switch(c) {
568
	case 'R':
586
	case 'R':
569
		showhost = 0;
587
		showhost = 0;
Lines 594-599 int main(int argc, char **argv) Link Here
594
	case 'a':
612
	case 'a':
595
		altlist++;
613
		altlist++;
596
		break;
614
		break;
615
	case 'F':
616
		fulltime++;
617
		break;
597
	case 't':
618
	case 't':
598
		if ((until = parsetm(optarg)) == (time_t)-1) {
619
		if ((until = parsetm(optarg)) == (time_t)-1) {
599
			fprintf(stderr, "%s: Invalid time value \"%s\"\n",
620
			fprintf(stderr, "%s: Invalid time value \"%s\"\n",

Return to bug 136978