~ttx/openldap/lucid-gssapi-495418

« back to all changes in this revision

Viewing changes to contrib/slapd-modules/nssov/nssov.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-07-28 10:17:15 UTC
  • mto: (0.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20090728101715-g0isvetelfeqm48k
Tags: upstream-2.4.17
ImportĀ upstreamĀ versionĀ 2.4.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* nssov.h - NSS overlay header file */
2
 
/* $OpenLDAP: pkg/ldap/contrib/slapd-modules/nssov/nssov.h,v 1.1.2.3 2009/01/22 00:00:45 kurt Exp $ */
 
2
/* $OpenLDAP: pkg/ldap/contrib/slapd-modules/nssov/nssov.h,v 1.1.2.4 2009/06/03 20:46:55 quanah Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
 *
5
5
 * Copyright 2008-2009 The OpenLDAP Foundation.
9
9
#ifndef NSSOV_H
10
10
#define NSSOV_H
11
11
 
 
12
#ifndef NSLCD_PATH
 
13
#define NSLCD_PATH      "/var/run/nslcd"
 
14
#endif
 
15
 
12
16
#ifndef NSLCD_SOCKET
13
 
#define NSLCD_SOCKET    "/var/run/nslcd/socket"
 
17
#define NSLCD_SOCKET    NSLCD_PATH "/socket"
14
18
#endif
15
19
 
16
20
#include <stdio.h>
64
68
        int ni_socket;
65
69
        Connection *ni_conn;
66
70
        BackendDB *ni_db;
 
71
 
 
72
        /* PAM authz support... */
 
73
        slap_mask_t ni_pam_opts;
 
74
        struct berval ni_pam_group_dn;
 
75
        AttributeDescription *ni_pam_group_ad;
 
76
        int ni_pam_min_uid;
 
77
        int ni_pam_max_uid;
 
78
        AttributeDescription *ni_pam_template_ad;
 
79
        struct berval ni_pam_template;
 
80
        struct berval ni_pam_defhost;
 
81
        struct berval *ni_pam_sessions;
67
82
} nssov_info;
68
83
 
 
84
#define NI_PAM_USERHOST         1       /* old style host checking */
 
85
#define NI_PAM_USERSVC          2       /* old style service checking */
 
86
#define NI_PAM_USERGRP          4       /* old style group checking */
 
87
#define NI_PAM_HOSTSVC          8       /* new style authz checking */
 
88
#define NI_PAM_SASL2DN          0x10    /* use sasl2dn */
 
89
#define NI_PAM_UID2DN           0x20    /* use uid2dn */
 
90
 
 
91
#define NI_PAM_OLD      (NI_PAM_USERHOST|NI_PAM_USERSVC|NI_PAM_USERGRP)
 
92
#define NI_PAM_NEW      NI_PAM_HOSTSVC
 
93
 
 
94
extern AttributeDescription *nssov_pam_host_ad;
 
95
extern AttributeDescription *nssov_pam_svc_ad;
 
96
 
69
97
/* Read the default configuration file. */
70
98
void nssov_cfg_init(nssov_info *ni,const char *fname);
71
99
 
139
167
/* checks to see if the specified string is a valid username */
140
168
int isvalidusername(struct berval *name);
141
169
 
142
 
/* transforms the DN info a uid doing an LDAP lookup if needed */
 
170
/* transforms the DN into a uid doing an LDAP lookup if needed */
143
171
int nssov_dn2uid(Operation *op,nssov_info *ni,struct berval *dn,struct berval *uid);
144
172
 
145
173
/* transforms the uid into a DN by doing an LDAP lookup */
146
174
int nssov_uid2dn(Operation *op,nssov_info *ni,struct berval *uid,struct berval *dn);
 
175
int nssov_name2dn_cb(Operation *op, SlapReply *rs);
147
176
 
148
177
/* Escapes characters in a string for use in a search filter. */
149
178
int nssov_escape(struct berval *src,struct berval *dst);
163
192
void nssov_service_init(nssov_info *ni);
164
193
void nssov_shadow_init(nssov_info *ni);
165
194
 
 
195
int nssov_pam_init(void);
 
196
 
166
197
/* these are the different functions that handle the database
167
198
   specific actions, see nslcd.h for the action descriptions */
168
199
int nssov_alias_byname(nssov_info *ni,TFILE *fp,Operation *op);
195
226
int nssov_service_all(nssov_info *ni,TFILE *fp,Operation *op);
196
227
int nssov_shadow_byname(nssov_info *ni,TFILE *fp,Operation *op);
197
228
int nssov_shadow_all(nssov_info *ni,TFILE *fp,Operation *op);
 
229
int pam_authc(nssov_info *ni,TFILE *fp,Operation *op);
 
230
int pam_authz(nssov_info *ni,TFILE *fp,Operation *op);
 
231
int pam_sess_o(nssov_info *ni,TFILE *fp,Operation *op);
 
232
int pam_sess_c(nssov_info *ni,TFILE *fp,Operation *op);
 
233
int pam_pwmod(nssov_info *ni,TFILE *fp,Operation *op);
198
234
 
199
235
/* config initialization */
200
236
#define NSSOV_INIT(db) \