summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb_autofs.h
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-01-03 08:12:57 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-02-05 19:16:16 -0500
commit1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8 (patch)
tree5add917cb8be11a8dee45f60fcacf73b56da93da /src/db/sysdb_autofs.h
parent232b73185893a42e545b20caa9e59880e8a8a901 (diff)
downloadsssd-1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8.tar.gz
sssd-1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8.tar.xz
sssd-1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8.zip
AUTOFS: sysdb interface
Diffstat (limited to 'src/db/sysdb_autofs.h')
-rw-r--r--src/db/sysdb_autofs.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/db/sysdb_autofs.h b/src/db/sysdb_autofs.h
new file mode 100644
index 000000000..e8e5de466
--- /dev/null
+++ b/src/db/sysdb_autofs.h
@@ -0,0 +1,88 @@
+/*
+ Authors:
+ Jakub Hrozek <jhrozek@redhat.com>
+
+ 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 <http://www.gnu.org/licenses/>.
+*/
+
+#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_ */