authenticateuser()

NAME

authenticateuser() - validate user information

SYNOPSIS

#include <interix/security.h>

int authenticateuser (const struct usersec userdata)

DESCRIPTION

The authenticateuser(2) function validates the data in the data structure userdata. It returns 1 if the information is valid and 0 if it is not. This function is often used to validate information before calling one of the exec_asuser functions.

Note that this function is deprecated in favor of the call setuser(2) with the command flag SU_CHECK.

The userdata argument is a user security structure, struct usersec, which is defined in <security.h>:

struct usersec {
   char * user;
   char * domain;
   char * password;
   int logontype; 	/* Defaults to 0 */
   int logonprovider; /* Defaults to 0 */
};

The user points to the user's logon name.

The domain points to the user's domain.

The password points to the user's password.

The logintype and logonprovider members are reserved for future use; for now, they should left at the default value of 0.

RETURN VALUES

If the information in the struct usersec structure is authentic and valid, authenticateuser(2) returns 1. Otherwise, it returns 0 and sets errno to indicate the error.

ERRORS

[EFAULT]
The userdata parameter is not in a valid part of the user address space.
[EINVAL]
One of the members of the structure was invalid, possibly too long.
[ENOMEM]
Not enough memory.
[EPERM]
The user-domain-password combination is invalid.

SEE ALSO

exec_asuser(2)

setuser(2)