Hello,
Does anybody know what the consequences could be if run a C
program that alters argv[2] BEFORE calling the function
set_auth_parameters? The man pages warn against doing this,
but I don't understand the given explanation. (I'm running
DU 3.2d-1 with C2 Security.)
I have a C program that I want to use to lock the accounts of
several hundred users whose names it reads from a text file.
It works by reading one name from the input file, "stuffing"
that username into argv[2], and THEN calling set_auth_parameters(),
getprpwnam(), putprpwnam(), and endprpwent() to lock the
account. This program seems to work ok on small "test" input
files, but I hesitate to use it on a list of several hundred
usernames for fear (because of the warnings I don't understand)
of somehow doing some sort of damage to the C2 secure database.
The man pages for functions that manipulate protected password
database entries (Enhanced Security) like getprpwnam() and
putprpwnam() say "Programs must call set_auth_parameters()
before any other action in main()."
Also, the man page for set_auth_parameters says:
Programs must call set_auth_parameters() before any other
action in main(). The program must always call
set_auth_parameters(argc,argv) before doing anything that
changes argc or argv; the other functions in identity.c
depend on this happening. The argc parameter must be at
least 1. The argv[0] parameter determines the command name
for auditing and the command line is preserved for subsystem
auditing purposes.
Thank you in advance if you are able to shed any light on
this for me.
Paul Youngblood
youngbp_at_email.uah.edu
Information Services
University of Alabama in Huntsville
Information Services
Received on Tue Jul 02 1996 - 23:27:06 NZST