version 1.24, 2015/10/18 03:54:22 |
version 1.25, 2015/10/26 16:57:13 |
|
|
err(1, "pledge"); |
err(1, "pledge"); |
|
|
(void)time(&now); |
(void)time(&now); |
setpassent(1); |
|
if (!*argv) { |
if (!*argv) { |
/* |
/* |
* Assign explicit "small" format if no names given and -l |
* Assign explicit "small" format if no names given and -l |
|
|
if (!freopen(_PATH_UTMP, "r", stdin)) |
if (!freopen(_PATH_UTMP, "r", stdin)) |
err(2, _PATH_UTMP); |
err(2, _PATH_UTMP); |
name[UT_NAMESIZE] = '\0'; |
name[UT_NAMESIZE] = '\0'; |
|
setpassent(1); |
while (fread((char *)&user, sizeof(user), 1, stdin) == 1) { |
while (fread((char *)&user, sizeof(user), 1, stdin) == 1) { |
if (!user.ut_name[0]) |
if (!user.ut_name[0]) |
continue; |
continue; |
|
|
} |
} |
enter_where(&user, pn); |
enter_where(&user, pn); |
} |
} |
|
endpwent(); |
for (pn = phead; lflag && pn != NULL; pn = pn->next) |
for (pn = phead; lflag && pn != NULL; pn = pn->next) |
enter_lastlog(pn); |
enter_lastlog(pn); |
} |
} |
|
|
* traverse the list of possible login names and check the login name |
* traverse the list of possible login names and check the login name |
* and real name against the name specified by the user. |
* and real name against the name specified by the user. |
*/ |
*/ |
|
setpassent(1); |
if ((mflag - Mflag) > 0) { |
if ((mflag - Mflag) > 0) { |
for (i = 0; i < argc; i++) |
for (i = 0; i < argc; i++) |
if (used[i] >= 0 && (pw = getpwnam(argv[i]))) { |
if (used[i] >= 0 && (pw = getpwnam(argv[i]))) { |
|
|
enter_person(pw); |
enter_person(pw); |
used[i] = 1; |
used[i] = 1; |
} |
} |
|
endpwent(); |
|
|
/* list errors */ |
/* list errors */ |
for (i = 0; i < argc; i++) |
for (i = 0; i < argc; i++) |