From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Duffy, Thomas J." Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: Utility to validate username, password combination Date: Mon, 28 Jul 2003 14:29:10 -0700 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <3F16FF786F31154EB6171035DFB0FC85058DD4@xcgmd062.md.essd.northgrum.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: main.gmane.org 1059427775 13645 80.91.224.249 (28 Jul 2003 21:29:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 28 Jul 2003 21:29:35 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Mon Jul 28 23:29:33 2003 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 19hFYj-0003Xb-00 for ; Mon, 28 Jul 2003 23:29:33 +0200 Original-Received: (qmail 1588 invoked by uid 5); 28 Jul 2003 21:29:27 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 1557 invoked by uid 49493); 28 Jul 2003 21:29:27 -0000 Original-Received: from thomas.duffy@ngc.com by sws1 by uid 49491 with qmail-scanner-1.16 (clamscan: 20030605. spamassassin: 2.55. Clear:SA:0(0.0/5.0):. Processed in 0.620352 secs); 28 Jul 2003 21:29:27 -0000 Original-Received: from unknown (HELO emroute3.ornl.gov) (160.91.4.110) by 0 with SMTP; 28 Jul 2003 21:29:26 -0000 Original-Received: from emroute3.ornl.gov (localhost [127.0.0.1]) by emroute3.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HIR00K2U7OXFI@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT Tru64-UNIX-Managers@ornl.gov) ; Mon, 28 Jul 2003 17:29:25 -0400 (EDT) Original-Received: from xcgmd810.northgrum.com (xcgmd810.northgrum.com [155.104.240.104]) by emroute3.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HIR00IK47OOZG@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT Tru64-UNIX-Managers@ornl.gov) ; Mon, 28 Jul 2003 17:29:17 -0400 (EDT) Original-Received: by xcgmd810.northgrum.com with Internet Mail Service (5.5.2656.59) id ; Mon, 28 Jul 2003 14:30:21 -0700 Content-return: allowed Original-To: "'Tru64-UNIX-Managers@ornl.gov'" X-Mailer: Internet Mail Service (5.5.2656.59) Xref: main.gmane.org gmane.os.tru64.managers:4957 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:4957 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 > >