summaryrefslogtreecommitdiffstats
path: root/include/libaccess/nsamgmt.h
blob: ccfd5ab57326b549de8aa3355c463694cbf1f041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/** BEGIN COPYRIGHT BLOCK
 * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
 * Copyright (C) 2005 Red Hat, Inc.
 * All rights reserved.
 * END COPYRIGHT BLOCK **/
#ifndef __nsamgmt_h
#define __nsamgmt_h

/*
 * Description (nsamgmt.h)
 *
 *	This file defines the interface for managing information in a
 *	Netscape authentication database.  An authentication database
 *	consists of a user database and a group database.  This
 *	implementation of an authentication database based on Netscape
 *	user and group databases defined in nsuser.h and nsgroup.h,
 *	which in turn are based on the Netscape (server) database
 *	implementation defined in nsdb.h.  The interface for retrieving
 *	information from an authentication database is described
 *	separately in nsadb.h.
 */

#include "nsadb.h"

/* Flags used in enumeration call-back function return value */
#define ADBF_KEEPOBJ	0x1		/* do not free user or group object */
#define ADBF_STOPENUM	0x2		/* stop the enumeration */

NSPR_BEGIN_EXTERN_C

/* Functions in nsamgmt.c */
NSAPI_PUBLIC extern int nsadbAddGroupToGroup(NSErr_t * errp, void * authdb,
					     GroupObj_t * pgoptr,
					     GroupObj_t * cgoptr);

NSAPI_PUBLIC extern int nsadbAddUserToGroup(NSErr_t * errp, void * authdb,
					    GroupObj_t * goptr,
					    UserObj_t * uoptr);

NSAPI_PUBLIC extern int nsadbCreateGroup(NSErr_t * errp,
					 void * authdb, GroupObj_t * goptr);

NSAPI_PUBLIC extern int nsadbCreateUser(NSErr_t * errp,
					void * authdb, UserObj_t * uoptr);

/*
for ANSI C++ standard on SCO UDK must typedef fn in arg list, otherwise fn
name is managled
*/

#ifdef UnixWare
typedef int(*ArgFn_EnumUsers)(NSErr_t * ferrp, void * authdb, void * parg,
                 UserObj_t * uoptr);

NSAPI_PUBLIC extern int nsadbEnumerateUsers(NSErr_t * errp, void * authdb,
					void * argp, ArgFn_EnumUsers);
#else /* UnixWare */
NSAPI_PUBLIC extern int nsadbEnumerateUsers(NSErr_t * errp, void * authdb,
					    void * argp,
					    int (*func)(NSErr_t * ferrp,
							void * authdb,
							void * parg,
							UserObj_t * uoptr));
#endif /* UnixWare */
 
#ifdef UnixWare
typedef int(*ArgFn_EnumGroups)(NSErr_t * ferrp, void * authdb, void * parg,
                 GroupObj_t * goptr);
NSAPI_PUBLIC extern int nsadbEnumerateGroups(NSErr_t * errp,
						void * authdb, void * argp,
                       				ArgFn_EnumGroups);
#else /* UnixWare */
NSAPI_PUBLIC extern int nsadbEnumerateGroups(NSErr_t * errp,
                                             void * authdb, void * argp,
					     int (*func)(NSErr_t * ferrp,
							 void * authdb,
							 void * parg,
							 GroupObj_t * goptr));
#endif /* UnixWare */

NSAPI_PUBLIC extern int nsadbIsUserInGroup(NSErr_t * errp, void * authdb,
					   USI_t uid, USI_t gid,
					   int ngroups, USI_t * grplist);

NSAPI_PUBLIC extern int nsadbModifyGroup(NSErr_t * errp,
					 void * authdb, GroupObj_t * goptr);

NSAPI_PUBLIC extern int nsadbModifyUser(NSErr_t * errp,
					void * authdb, UserObj_t * uoptr);

NSAPI_PUBLIC extern int nsadbRemoveGroup(NSErr_t * errp,
					 void * authdb, char * name);

NSAPI_PUBLIC extern int nsadbRemoveUser(NSErr_t * errp,
					void * authdb, char * name);

NSAPI_PUBLIC extern int nsadbRemGroupFromGroup(NSErr_t * errp, void * authdb,
					       GroupObj_t * pgoptr,
					       GroupObj_t * cgoptr);

NSAPI_PUBLIC extern int nsadbRemUserFromGroup(NSErr_t * errp, void * authdb,
					      GroupObj_t * goptr,
					      UserObj_t * uoptr);

NSAPI_PUBLIC extern int nsadbSuperGroups(NSErr_t * errp, void * authdb,
					 GroupObj_t * goptr,
					 USIList_t * gsuper);


NSPR_END_EXTERN_C

#if defined(CLIENT_AUTH)

/* Removed for new ns security integration
#include <sec.h>
*/
#include <key.h>
#include <cert.h>

#endif /* defined(CLIENT_AUTH) */

#endif /* __nsamgmt_h */