sysdb_autofs.h revision eb29ae58117ca88868491fe2240e27393c7a9068
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek/*
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek Authors:
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek Jakub Hrozek <jhrozek@redhat.com>
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek Copyright (C) 2012 Red Hat
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek This program is free software; you can redistribute it and/or modify
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek it under the terms of the GNU General Public License as published by
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek the Free Software Foundation; either version 3 of the License, or
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek (at your option) any later version.
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek This program is distributed in the hope that it will be useful,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek but WITHOUT ANY WARRANTY; without even the implied warranty of
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek GNU General Public License for more details.
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek You should have received a copy of the GNU General Public License
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek along with this program. If not, see <http://www.gnu.org/licenses/>.
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek*/
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#ifndef _SYSDB_AUTOFS_H_
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#define _SYSDB_AUTOFS_H_
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#include "db/sysdb.h"
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek/* subdirs in cn=custom in sysdb. We don't store autofs stuff in sysdb directly
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek * b/c it's not name-service-switch data */
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#define AUTOFS_MAP_SUBDIR "autofsmaps"
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#define AUTOFS_ENTRY_SUBDIR "autofsentries"
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#define SYSDB_AUTOFS_MAP_OC "automountMap"
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#define SYSDB_AUTOFS_MAP_NAME "automountMapName"
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#define SYSDB_AUTOFS_ENTRY_OC "automount"
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#define SYSDB_AUTOFS_ENTRY_KEY "automountKey"
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#define SYSDB_AUTOFS_ENTRY_VALUE "automountInformation"
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekstruct ldb_dn *
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozeksysdb_autofsmap_dn(TALLOC_CTX *mem_ctx,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct sysdb_ctx *sysdb,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *map_name);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekstruct ldb_dn *
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozeksysdb_autofsentry_dn(TALLOC_CTX *mem_ctx,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct sysdb_ctx *sysdb,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *entry_name);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozeksysdb_save_autofsmap(struct sysdb_ctx *sysdb_ctx,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *name,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *autofsmapname,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct sysdb_attrs *attrs,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek int cache_timeout,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek time_t now);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozeksysdb_get_map_byname(TALLOC_CTX *mem_ctx,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct sysdb_ctx *sysdb,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *map_name,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct ldb_message **map);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozeksysdb_delete_autofsmap(struct sysdb_ctx *sysdb_ctx,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *name);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozeksysdb_save_autofsentry(struct sysdb_ctx *sysdb_ctx,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *key,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *value,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct sysdb_attrs *attrs);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozeksysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct sysdb_ctx *sysdb,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *mapname,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek size_t *_count,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct ldb_message ***_entries);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t sysdb_map_entry_name(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *entry_dn, char **_name);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozeksysdb_autofs_map_update_members(struct sysdb_ctx *sysdb,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *mapname,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *const *add_entries,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *const *del_entries);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozekerrno_t
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozeksysdb_set_autofsmap_attr(struct sysdb_ctx *sysdb,
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozek const char *name,
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozek struct sysdb_attrs *attrs,
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozek int mod_op);
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#endif /* _SYSDB_AUTOFS_H_ */