tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: Utility to validate username, password combination
@ 2003-07-28 21:29 Duffy, Thomas J.
  0 siblings, 0 replies; only message in thread
From: Duffy, Thomas J. @ 2003-07-28 21:29 UTC (permalink / raw)


Many thanks!  Especially to Ann Majeske, Jim Lola, and Jerome Berkman

My original question was:

I wrote a simple utility for SGI and Solari machines to query a user for a
username and password and it validates the entry against the shadow password
file.  To accomplish this, I used the getspnam and crypt routines.  Is there
an analogous set of routines for Tru64 5.1A UNIX or a similar utility that I
can employ?

-------------------------------------------------

Ann's response was to try sia_validate_user...

The sia_validate_user() routine can be used to validate
username password combinations.  See the sia_validate_user
man page and the Security manual for more information.
Further input on SIA collection routines is available from
the interface specifications in /usr/include/sia.h

THIS WORKED WELL FOR ME.  I put in code like below to validate username
(argv[1]) and password (argv[2]):

if (!sia_validate_user(NULL, 1, sia_argv, NULL, argv[1], NULL, 0, NULL,
argv[2]))
{
  printf ("Invalid login!\n");
  exit (-1);
}
else
{
  printf ("Valid login!\n");
  exit(0);
}

Note, sia_argv was just a pointer to an array of character pointers
containing my program name and 1 was the number entries within it.  See the
documentation for sia_validate_user.

----------------------------------------------------------------------------
-----

Jim & Jerome pointed out the Compaq-equivalent of getspnam (getespwnam).
Unfortunately, when I tried this I got an error: "Authentication database
not initialized"  I stopped chasing this down when the above worked.

Thanks for such timely responses.

Tom

Thomas Duffy
Northrop Grumman

> *Phone:       410-993-6128
> *FAX:           410-765-6286
> *Email:        thomas.duffy@ngc.com
> *Mail Stop:   3J18
> 
> 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-28 21:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-28 21:29 SUMMARY: Utility to validate username, password combination Duffy, Thomas J.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox