Changeset 40
- Timestamp:
- 05/18/07 16:09:53
(2 years ago)
- Author:
- csellers
- Message:
Initial support for multiple timestamps in the file format. This only keeps track of them and functions as before. It does not provide the new option yet.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r37 |
r40 |
|
| 516 | 516 | lock_time applies */ |
|---|
| 517 | 517 | tally->fail_cnt = oldcnt; |
|---|
| 518 | | tally->fail_time = oldtime; |
|---|
| | 518 | /* TODO check for out of fail_time bounds */ |
|---|
| | 519 | tally->fail_time[oldcnt] = 0; |
|---|
| 519 | 520 | |
|---|
| 520 | 521 | if (!(opts->ctrl & OPT_QUIET)) { |
|---|
| … | … | |
| 564 | 565 | |
|---|
| 565 | 566 | /* to remember old fail time (for locktime) */ |
|---|
| 566 | | if (oldtime) { |
|---|
| 567 | | *oldtime = (time_t)tally.fail_time; |
|---|
| | 567 | if (oldtime && tally.fail_cnt > 0) { |
|---|
| | 568 | /* TODO check for out of fail_time bounds */ |
|---|
| | 569 | *oldtime = (time_t)tally.fail_time[tally.fail_cnt-1]; |
|---|
| 568 | 570 | } |
|---|
| 569 | 571 | |
|---|
| 570 | | tally.fail_time = time(NULL); |
|---|
| | 572 | /* TODO check for out of fail_time bounds */ |
|---|
| | 573 | tally.fail_time[tally.fail_cnt] = time(NULL); |
|---|
| 571 | 574 | |
|---|
| 572 | 575 | (void) pam_get_item(pamh, PAM_RHOST, &remote_host); |
|---|
| … | … | |
| 820 | 823 | |
|---|
| 821 | 824 | pwent = getpwuid(uid); |
|---|
| 822 | | fail_time = tally->fail_time; |
|---|
| | 825 | /* TODO check for out of fail_time bounds */ |
|---|
| | 826 | fail_time = tally->fail_time[tally->fail_cnt-1]; |
|---|
| 823 | 827 | tm = localtime(&fail_time); |
|---|
| 824 | 828 | strftime (ptime, sizeof (ptime), "%D %H:%M:%S", tm); |
|---|
| … | … | |
| 832 | 836 | } |
|---|
| 833 | 837 | printf ("%-15.15s %5hu ", username, tally->fail_cnt); |
|---|
| 834 | | if (tally->fail_time) { |
|---|
| | 838 | if (fail_time) { |
|---|
| 835 | 839 | printf ("%-17.17s %s", cp, tally->fail_line); |
|---|
| 836 | 840 | } |
|---|
| r37 |
r40 |
|
| 46 | 46 | uint16_t reserved; /* reserved for future use */ |
|---|
| 47 | 47 | uint16_t fail_cnt; /* failures since last success */ |
|---|
| 48 | | uint64_t fail_time; /* time of last failure */ |
|---|
| | 48 | uint64_t fail_time[9]; /* time of previous failures */ |
|---|
| 49 | 49 | }; |
|---|
| 50 | 50 | /* 64 bytes / entry */ |
|---|
Download in other formats:
* Generating other formats may take time.