home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
dsrght.exe
/
DSEFFECT.C
next >
Wrap
C/C++ Source or Header
|
1995-06-27
|
4KB
|
117 lines
/****************************************************************************
** File:DSEFFECT.C
**
** Description:
** This programs prompts for a user name and a server name then
** a call is made to NWDSGetEffectiveRights with these as parameters
** and the returned privileges are printed out.
**
** Disclaimer:
**
** Novell, Inc. makes no representations or warranties with respect to
** any NetWare software, and specifically disclaims any express or
** implied warranties of merchantability, title, or fitness for a
** particular purpose.
**
** Distribution of any NetWare software is forbidden without the
** express written consent of Novell, Inc. Further, Novell reserves
** the right to discontinue distribution of any NetWare software.
**
** Novell is not responsible for lost profits or revenue, loss of use
** of the software, loss of data, costs of re-creating lost data, the
** cost of any substitute equipment or program, or claims by any party
** other than you. Novell strongly recommends a backup be made before
** any software is installed. Technical support for this software
** may be provided at the discretion of Novell.
**
**
**
** Programmers:
**
** Ini Who Firm
** -----------------------------------------------------------------------
** MDP Marina D Pimentel Novell Developer Support
**
** History:
**
** When Who What
** -----------------------------------------------------------------------
** 06-27-95 MDP First code.
**
*/
/*---------------------------------------------------------------------------
** Include headers, macros, structures, typedefs, etc.
*/
#define NWDOS
#include <stdio.h>
#include <string.h>
#include <nwcalls.h>
#include <nwnet.h>
#include <nwpsrv.h>
#include <stdlib.h>
extern _stklen = (8 * 1024U);
/*---------------------------------------------------------------------------
** Program start.
*/
void main()
{
NWDSContextHandle dContext;
NWDS_PRIVILEGES mypriv;
NWDSCCODE ccode;
char myname[48];
char servername[48];
char buffer[48];
/*---------------------------------------------------------------------------
** Include headers, macros, structures, typedefs, etc.
*/
ccode=NWCallsInit(NULL,NULL);
ccode = NWInitUnicodeTables(001, 437);
if(ccode)
{
printf("NWInitUnicodeTables returned [%x]\n",ccode);
goto cleanup;
}
dContext = NWDSCreateContext( );
if(dContext == ERR_CONTEXT_CREATION)
{
printf("Could not create context\n");
goto cleanup;
}
printf("Please enter server name\n");
gets(buffer);
strcpy(servername,strupr(buffer));
printf("Please enter user name\n");
gets(buffer);
strcpy(myname,strupr(buffer));
NWDSGetEffectiveRights(dContext,myname,servername,"[Entry Rights]",&mypriv);
if(ccode)
{
printf("NWGetEffectiveRights returned [%x]\n",ccode);
goto cleanup;
}
printf ("%s %s %s %s %s \n",
mypriv & DS_ENTRY_BROWSE ? "Entry Browse" : "-----",
mypriv & DS_ENTRY_ADD ? "Entry Add" : "-----",
mypriv & DS_ENTRY_DELETE ? "Entry Delete" : "-----",
mypriv & DS_ENTRY_RENAME ? "Entry Rename" : "-----",
mypriv & DS_ENTRY_SUPERVISOR ? "Entry Superv" : "-----");
/*---------------------------------------------------------------------------
** Freeing memory.
*/
cleanup:
NWFreeUnicodeTables();
NWDSFreeContext(dContext);
}