int code;
char name[MAXKTCNAMELEN];
char instance[MAXKTCNAMELEN];
+ char *end;
afs_int32 flags = 0;
Date expiration = 0;
afs_int32 lifetime = 0;
for (i = 0; i < 4; misc_auth_bytes[i++] = 0);
if (as->parms[4].items) {
- if (util_isint(as->parms[4].items->data))
- pwexpiry = atoi(as->parms[4].items->data);
- else {
+ pwexpiry = strtol(as->parms[4].items->data, &end, 10);
+ if (*end != '\0') {
fprintf(stderr,
"Password lifetime specified must be a non-negative decimal integer.\n");
pwexpiry = -1;
"Password lifetime range must be [0..254] days.\n");
fprintf(stderr, "Zero represents an unlimited lifetime.\n");
return KABADCMD;
- } else {
- misc_auth_bytes[0] = pwexpiry + 1;
}
+
+ misc_auth_bytes[0] = pwexpiry + 1;
}
if (as->parms[5].items) {
if (as->parms[6].items) {
int nfailures;
+ nfailures = strtol(as->parms[6].items->data, &end, 10);
- if (util_isint(as->parms[6].items->data)
- && ((nfailures = atoi(as->parms[6].items->data)) < 255)) {
- misc_auth_bytes[2] = nfailures + 1;
- } else {
+ if (*end != '\0' || nfailures < 0 || nfailures > 254) {
fprintf(stderr, "Failure limit must be in [0..254].\n");
fprintf(stderr, "Zero represents unlimited login attempts.\n");
return KABADCMD;
}
+ misc_auth_bytes[2] = nfailures + 1;
}
if (as->parms[7].items) {