Technical article 119266

OpenServer:The man page of smp_check is missing a couple of arguments

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

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.html
localhost:8457/OSAdminG/uaT.restfailterm.html

From the Xinuos technical article database, record 119266. Reproduced with permission. The original is at www.sco.com/ta/119266, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.