Problem
"smp_check_user" is used to register login or password change to be performed.
If you run a "man smp_check_user" you get:
int smp_check_user(typ, name, term, invoker, usrpp, pwtryp, reasonp) int typ; char *name; char *term; uid_t invoker; struct smp_user_info **usrpp; int *pwtryp; char **reasonp;
This doesn't match up with the entry in /usr/include/prot.h which details:
extern int smp_check_user(int, char *, char *, int,
struct smp_user_info **, int *, char **, int *, int ),ie. nine entries. Cause
The man page is missing the last two arguments.
Solution
There are nine values available for smp_check_user:
smp_check_user(type, name, terminal, invoker, userpp, pwtriesp, reasonp, from_nis, delay_between_attempts)
The man page should read:int smp_check_user(typ, name, term, invoker, usrpp, pwtryp, reasonp, from_nis, delayp) int typ; char *name; char *term; uid_t invoker; struct smp_user_info **usrpp; int *pwtryp; char **reasonp; int *from_nis; int *delayp;
The description for this is:from_nis points to an integer which is used to return whether the returned smp_user_info structure was obtained from NIS (1) or from local files (0). [xref localhost:8457/NetAdminG/nisN.usingnis.html]
delayp points to an integer which is used to return the delay, in
seconds, which should be enforced after a failed login attempt.
This delay enhances system security by hindering automated password
probing attempts. The value is set by the system administrator.
[xref localhost:8457/OSAdminG/uaT.restfailterm.html]put("login: "); switch (smp_check_user(SMP_LOGIN, gets(line), ttyname(0), 0, &userp, &pwtries, &reason, &from_nis, &delay)) {
case SMP_FAIL:
put("out of memory\n");
sleep(delay);
exit(1);
case SMP_EXTFAIL:
put(reason);
put("\n");
sleep(delay);
exit(1);
case SMP_NOTAUTH:
put("not authorzed\n"); /* can't read auth database * /
sleep(delay);
exit(1);
case SMP_TERMLOCK:
put("terminal locked\n");
smp_audit_fail(userp);
sleep(delay);
exit(1);
case SMP_ACCTLOCK:
put("account locked\n");
smp_audit_fail(userp);
sleep(delay);
exit(1);
case SMP_RETIRED:
put("account retired\n");
smp_audit_fail(userp);
sleep(delay);
exit(1);
case SMP_OVERRIDE:
put(reason);
noecho();
put("password: ");
switch (smp_check_pw(gets(line), userp, &reason)) {
/* either allow access, or say why not and sleep(delay) */
...
}
echo();This issue is fixed in SCO OpenServer 5.0.7.
See also
localhost:8457/NetAdminG/nisN.usingnis.htmllocalhost:8457/OSAdminG/uaT.restfailterm.html