Replace ACTIVE cpp constant with ALLOWED

ACTIVE is a bit of a misnomer here, when what the constant is meant to
represent is whether the user is allowed to login, or contiue being
logged in, so it's been replaced with a more appropriate name.
This commit is contained in:
Petar Kapris 2020-12-19 10:13:41 +01:00
parent 8077ae6004
commit 9201509738

View file

@ -63,7 +63,7 @@
#define MAXLINES 512
#define max(a,b) ((a)>(b)?(a):(b))
#define ACTIVE 1
#define ALLOWED 1
#define IDLEMAX 2
#define SESSMAX 3
#define DAYMAX 4
@ -208,7 +208,7 @@ char *argv[];
argv[2]);
logoff_msg(1);
exit(20);
case ACTIVE:
case ALLOWED:
#ifdef DEBUG
syslog(LOG_DEBUG, "User %s on %s passed login check.", argv[1], argv[2]);
#endif
@ -819,13 +819,13 @@ int session;
}
/* Otherwise, leave the poor net addict alone */
return ACTIVE;
return ALLOWED;
}
configline++;
}
/* If they do not match any entries, then they can stay on forever */
return ACTIVE;
return ALLOWED;
}
void check_idle()
@ -868,9 +868,9 @@ void check_idle()
sesstime = (time_now - utmpp->ut_time) / 60;
switch (chk_timeout(user, dev, host, idle, sesstime)) {
case ACTIVE:
case ALLOWED:
#ifdef DEBUG
syslog(LOG_DEBUG, "User %s is active.", user);
syslog(LOG_DEBUG, "User %s passed all checks.", user);
#endif
break;
case IDLEMAX: