|
|
#include <sys/types.h> #include <sys/security.h> #include <sys/audit.h> #include <prot.h>int randomword (word, hyphenated_word, min, max, restrict, seed) char *word; char *hyphenated_word; unsigned short int min; unsigned short int max; int restrict; long seed;
The min and max arguments denote the minimum and maximum lengths allowed for word. min may equal max, but may not be greater than max, and neither may be negative. The user space pre-allocated is at least max for word and 2*max-1 for hyphenated_word. Of course, the smaller min and max are, the less the selection of random words. For a program like login(M), suggested values are 6 for min and 8 for max.
The argument restrict is 0 when no restrictions are placed on the generated word. It is non-zero when the words generated pass the tests of the routine acceptable_password(S).
The seed
argument specifies an initial seed for the random number generator used
by randomword.
It is used by the routine only on the first time it is called; the argument
is ignored on subsequent calls.