summaryrefslogtreecommitdiff
path: root/server/nss/nsssrv_ldb.h
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-10-17 13:58:52 -0400
committerSimo Sorce <idra@samba.org>2008-10-20 10:41:59 -0400
commitcd632a9d2cda129f79b4ddd5484b748806c68ef6 (patch)
tree2712798ce6b49d728306f101ce0ace34d9c4a6ef /server/nss/nsssrv_ldb.h
parent8b0afbc4aa94628290d74165cab6bec97c7e532b (diff)
downloadsssd-cd632a9d2cda129f79b4ddd5484b748806c68ef6.tar.gz
sssd-cd632a9d2cda129f79b4ddd5484b748806c68ef6.tar.bz2
sssd-cd632a9d2cda129f79b4ddd5484b748806c68ef6.zip
Add configuration database functions.
Convert nss responder to use the confdb
Diffstat (limited to 'server/nss/nsssrv_ldb.h')
-rw-r--r--server/nss/nsssrv_ldb.h63
1 files changed, 46 insertions, 17 deletions
diff --git a/server/nss/nsssrv_ldb.h b/server/nss/nsssrv_ldb.h
index eb3e8fca..c7a3c4d6 100644
--- a/server/nss/nsssrv_ldb.h
+++ b/server/nss/nsssrv_ldb.h
@@ -1,58 +1,87 @@
-#define NSS_PW_NAME "uid"
-#define NSS_PW_UIDNUM "uidNumber"
-#define NSS_PW_GIDNUM "gidNumber"
-#define NSS_PW_FULLNAME "fullName"
-#define NSS_PW_HOMEDIR "HomeDirectory"
-#define NSS_PW_SHELL "loginShell"
+struct nss_ldb_ctx {
+ struct ldb_context *ldb;
+ const char *ldb_file;
-#define NSS_GR_NAME "cn"
-#define NSS_GR_GIDNUM "gidNumber"
-#define NSS_GR_MEMBER "member"
+ const char *user_base;
+ const char *group_base;
+
+ const char *pwnam_filter;
+ const char *pwuid_filter;
+ const char *pwent_filter;
+
+ const char *grnam_filter;
+ const char *grna2_filter;
+ const char *grgid_filter;
+ const char *grent_filter;
+
+ const char *initgr_filter;
+
+ const char *pw_name;
+ const char *pw_uidnum;
+ const char *pw_gidnum;
+ const char *pw_fullname;
+ const char *pw_homedir;
+ const char *pw_shell;
+
+ const char *gr_name;
+ const char *gr_gidnum;
+ const char *gr_member;
+
+ const char *initgr_attr;
+
+ const char **pw_attrs;
+ const char **grnam_attrs;
+ const char **grpw_attrs;
+ const char **initgr_attrs;
+};
+
+struct confdb_ctx;
typedef int (*nss_ldb_callback_t)(void *, int, struct ldb_result *);
int nss_ldb_init(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct ldb_context **ldb);
+ struct confdb_ctx *cdb,
+ struct nss_ldb_ctx **nlctx);
int nss_ldb_getpwnam(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct ldb_context *ldb,
+ struct nss_ldb_ctx *ctx,
const char *name,
nss_ldb_callback_t fn, void *ptr);
int nss_ldb_getpwuid(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct ldb_context *ldb,
+ struct nss_ldb_ctx *ctx,
uint64_t uid,
nss_ldb_callback_t fn, void *ptr);
int nss_ldb_enumpwent(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct ldb_context *ldb,
+ struct nss_ldb_ctx *ctx,
nss_ldb_callback_t fn, void *ptr);
int nss_ldb_getgrnam(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct ldb_context *ldb,
+ struct nss_ldb_ctx *ctx,
const char *name,
nss_ldb_callback_t fn, void *ptr);
int nss_ldb_getgrgid(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct ldb_context *ldb,
+ struct nss_ldb_ctx *ctx,
uint64_t gid,
nss_ldb_callback_t fn, void *ptr);
int nss_ldb_enumgrent(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct ldb_context *ldb,
+ struct nss_ldb_ctx *ctx,
nss_ldb_callback_t fn, void *ptr);
int nss_ldb_initgroups(TALLOC_CTX *mem_ctx,
struct event_context *ev,
- struct ldb_context *ldb,
+ struct nss_ldb_ctx *ctx,
const char *name,
nss_ldb_callback_t fn, void *ptr);