User Tools

Site Tools




getaccess_times - return the time for a service used by the specified username.


#include <user_attr.h>
*getaccess_times(const char *username, const char *service);


The getaccess_times() function returns the times for which the specified service may be used by the specified username.

The internal representation of the time values is in a access_times_t structure defined in <user_attr.h> with the following members:

typedef struct access_times {

struct {
int start;
int end;
} range[7];
} access_times_t;

The caller is responsible to free the returned access_times_t structure.


The entries in the range array correspond to the seven days of the week, beginning with Sunday. The start and end times indicate minutes since midnight. If the end time is less than the start time, then the end time applies to the following day. For days that have no valid range, both the start and end times are set to -1.

If the username has no matching entry for the service then the function returns NULL.


The access time policies are specified using the access_times keyword in user_attr(5) and prof_attr(5). The administrative interfaces are usermod(8), rolemod(8), and profiles(1). The getaccess_times() function is intended to be used to validate the policy with respect to the current time, which is retrieved via localtime(3C). By convention, if the getaccess_times() function returns NULL, then no time restrictions apply for the service.


See attributes(7) for description of the following attributes:


solaris/getaccess_times.3c.txt · Last modified: 2023/07/19 08:58 by A User Not Logged in