* src/lastlog.c: Remove statbuf, not used.
* src/lastlog.c: Fix types, cast umin and umax to uid_t. * src/lastlog.c: (option -u) user needs to be a signed long, not uid_t (to accept rangees like -<uid>
This commit is contained in:
parent
d0de685c7a
commit
09a95ed70a
@ -1,3 +1,10 @@
|
|||||||
|
2008-01-01 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/lastlog.c: Remove statbuf, not used.
|
||||||
|
* src/lastlog.c: Fix types, cast umin and umax to uid_t.
|
||||||
|
* src/lastlog.c: (option -u) user needs to be a signed long, not
|
||||||
|
uid_t (to accept rangees like -<uid>
|
||||||
|
|
||||||
2008-01-01 Nicolas François <nicolas.francois@centraliens.net>
|
2008-01-01 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/useradd.c: Avoid ?: construct without the middle term.
|
* src/useradd.c: Avoid ?: construct without the middle term.
|
||||||
|
@ -62,7 +62,6 @@ static int uflg = 0; /* print only an user of range of users */
|
|||||||
static int tflg = 0; /* print is restricted to most recent days */
|
static int tflg = 0; /* print is restricted to most recent days */
|
||||||
static int bflg = 0; /* print excludes most recent days */
|
static int bflg = 0; /* print excludes most recent days */
|
||||||
static struct lastlog lastlog; /* scratch structure to play with ... */
|
static struct lastlog lastlog; /* scratch structure to play with ... */
|
||||||
static struct stat statbuf; /* fstat buffer for file size */
|
|
||||||
static struct passwd *pwent;
|
static struct passwd *pwent;
|
||||||
|
|
||||||
#define NOW (time ((time_t *) 0))
|
#define NOW (time ((time_t *) 0))
|
||||||
@ -133,8 +132,8 @@ static void print (void)
|
|||||||
while ((pwent = getpwent ())) {
|
while ((pwent = getpwent ())) {
|
||||||
user = pwent->pw_uid;
|
user = pwent->pw_uid;
|
||||||
if (uflg &&
|
if (uflg &&
|
||||||
((umin != -1 && user < umin) ||
|
((umin != -1 && user < (uid_t)umin) ||
|
||||||
(umax != -1 && user > umax)))
|
(umax != -1 && user > (uid_t)umax)))
|
||||||
continue;
|
continue;
|
||||||
offset = user * sizeof lastlog;
|
offset = user * sizeof lastlog;
|
||||||
|
|
||||||
@ -201,7 +200,8 @@ int main (int argc, char **argv)
|
|||||||
umax = umin;
|
umax = umin;
|
||||||
} else {
|
} else {
|
||||||
char *endptr = NULL;
|
char *endptr = NULL;
|
||||||
uid_t user = strtol(optarg, &endptr, 10);
|
long int user;
|
||||||
|
user = strtol(optarg, &endptr, 10);
|
||||||
if (*optarg != '\0' && *endptr == '\0') {
|
if (*optarg != '\0' && *endptr == '\0') {
|
||||||
if (user < 0) {
|
if (user < 0) {
|
||||||
/* -<userid> */
|
/* -<userid> */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user