My original post:
>I am trying to write a .c program that uses some of the Enhanced Security
>system calls. In the man page for getprpwent(3) it states that programs
>must call set_auth_parameters() before any other security action in main.
>However, there is no information in the man pages or dxbook about what to
>pass into set_auth_parameters(). I compiled the program with -lsecurity and
>used set_auth_parameters() with no arguments. When I execute the program it
>output "Security command was invoked without ANY arguments".
The following people replied with the necessary parameters and sample code:
Dr. Tom Blinn <tpb@xxxxxxxxxxx>
Greg Bell <gbell@xxxxxxxxxxxxxxxxxxx>
Udo Linauer <linauer@xxxxxxxxxxxxxxxxx>
Richard M Rogers <cstrmr@xxxxxxxxxxxx>
Essentially, set_auth_parameters() needs to be the first function called in
the main() before using any of the enhanced security functions. It should
have passed as its parameters the argc and argv from main():
int main(int argc, char *argv[])
{
... /* Variable Declarations */
set_auth_parameters(argc, argv);
... /* Rest of Main */
}
The rest of the information about the enhanced security functions is pretty
clear in the man pages.
--
+--------------------------+-------------------------------------+
| BRIAN K. HOLMAN | E-Mail: brian_holman@xxxxxxx |
| Programmer/Analyst | Mail: 2330 HBLL, Provo, UT 84602 |
| Library Automations | Phone: (801) 378-8162 |
| Brigham Young University | Fax: (801) 378-6708 |
+--------------------------+-------------------------------------+