home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
NETCLB35.ZIP
/
NETCLB35.EXE
/
EXAMPLES
/
VERPASS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-03
|
2KB
|
63 lines
/***************************************************************************/
/* File: VERPASS.C */
/* */
/* Function: Verifies a Netware Users password. */
/* */
/* Usage: verpass username password */
/* */
/* Functions Called: GetPreferredConnectionID */
/* GetDefaultConnectionID */
/* SetPreferredConnectionID */
/* GetPrimaryConnectionID */
/* ISShellLoaded */
/* VerifyBinderyObjectPassword */
/* */
/***************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "netware.h"
void main(int argc,char *argv[])
{
int prefserver;
int thisserver;
byte encrypt[8];
long objectID;
int r;
if (argc != 3)
{
printf("Usage is: VERPASS <user name> <password>\n");
exit(0);
}
if (IsShellLoaded() != SUCCESS)
{
printf("*** No netware shell loaded ***\n");
exit(255);
}
if ((prefserver = GetPreferredConnectionID()) == 0)
{
if ((thisserver = GetDefaultConnectionID()) == 0)
thisserver = GetPrimaryConnectionID();
SetPreferredConnectionID( thisserver );
}
else
thisserver = prefserver;
strupr(argv[1]);
strupr(argv[2]);
if ((r=VerifyBinderyObjectPassword(USER,argv[1],argv[2])) != 0)
printf("*** password is invalid (%d) ***\n",r);
else
printf("*** password OK ***\n");
if (thisserver != prefserver) /* reset preferred server */
SetPreferredConnectionID( prefserver );
}