From 1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 3 Jan 2012 08:12:57 +0100 Subject: AUTOFS: sysdb interface --- src/db/sysdb_autofs.h | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/db/sysdb_autofs.h (limited to 'src/db/sysdb_autofs.h') diff --git a/src/db/sysdb_autofs.h b/src/db/sysdb_autofs.h new file mode 100644 index 00000000..e8e5de46 --- /dev/null +++ b/src/db/sysdb_autofs.h @@ -0,0 +1,88 @@ +/* + Authors: + Jakub Hrozek + + Copyright (C) 2012 Red Hat + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef _SYSDB_AUTOFS_H_ +#define _SYSDB_AUTOFS_H_ + +#include "db/sysdb.h" + +/* subdirs in cn=custom in sysdb. We don't store autofs stuff in sysdb directly + * b/c it's not name-service-switch data */ +#define AUTOFS_MAP_SUBDIR "autofsmaps" +#define AUTOFS_ENTRY_SUBDIR "autofsentries" + +#define SYSDB_AUTOFS_MAP_OC "automountMap" +#define SYSDB_AUTOFS_MAP_NAME "automountMapName" + +#define SYSDB_AUTOFS_ENTRY_OC "automount" +#define SYSDB_AUTOFS_ENTRY_KEY "automountKey" +#define SYSDB_AUTOFS_ENTRY_VALUE "automountInformation" + +struct ldb_dn * +sysdb_autofsmap_dn(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + const char *map_name); + +struct ldb_dn * +sysdb_autofsentry_dn(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + const char *entry_name); + +errno_t +sysdb_save_autofsmap(struct sysdb_ctx *sysdb_ctx, + const char *name, + const char *autofsmapname, + struct sysdb_attrs *attrs, + int cache_timeout, + time_t now); + +errno_t +sysdb_get_map_byname(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + const char *map_name, + struct ldb_message **map); + +errno_t +sysdb_delete_autofsmap(struct sysdb_ctx *sysdb_ctx, + const char *name); + +errno_t +sysdb_save_autofsentry(struct sysdb_ctx *sysdb_ctx, + const char *key, + const char *value, + struct sysdb_attrs *attrs); + +errno_t +sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + const char *mapname, + size_t *_count, + struct ldb_message ***_entries); + +errno_t sysdb_map_entry_name(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, + const char *entry_dn, char **_name); + +errno_t +sysdb_autofs_map_update_members(struct sysdb_ctx *sysdb, + const char *mapname, + const char *const *add_entries, + const char *const *del_entries); + +#endif /* _SYSDB_AUTOFS_H_ */ -- cgit