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
407123c67114bf010cdad4418f291f9fb3762f4aCove Schneider#define SYSDB_AUTOFS_MAP_OC "automountMap"
407123c67114bf010cdad4418f291f9fb3762f4aCove Schneider#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 Hrozekerrno_t
e7d1cd14ce1a427007b1a7e9789dcb7e9619f84fJakub Hrozeksysdb_save_autofsmap(struct sss_domain_info *domain,
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,
2913240aee51ce81195148a4d814e967f66839c4Simo Sorce struct sss_domain_info *domain,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *map_name,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct ldb_message **map);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t
e7d1cd14ce1a427007b1a7e9789dcb7e9619f84fJakub Hrozeksysdb_delete_autofsmap(struct sss_domain_info *domain,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *name);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t
e7d1cd14ce1a427007b1a7e9789dcb7e9619f84fJakub Hrozeksysdb_save_autofsentry(struct sss_domain_info *domain,
f17d26a8db285622a5cd5f21c7488b62eedc2cf8Jakub Hrozek const char *map,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *key,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *value,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct sysdb_attrs *attrs);
f17d26a8db285622a5cd5f21c7488b62eedc2cf8Jakub Hrozekerrno_t
e7d1cd14ce1a427007b1a7e9789dcb7e9619f84fJakub Hrozeksysdb_del_autofsentry(struct sss_domain_info *domain,
2234d49c8a307ee4f11cc544c862a359f76b44adJakub Hrozek const char *entry_dn);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekerrno_t
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozeksysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx,
2913240aee51ce81195148a4d814e967f66839c4Simo Sorce struct sss_domain_info *domain,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const char *mapname,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek size_t *_count,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct ldb_message ***_entries);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozekerrno_t
e7d1cd14ce1a427007b1a7e9789dcb7e9619f84fJakub Hrozeksysdb_set_autofsmap_attr(struct sss_domain_info *domain,
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozek const char *name,
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozek struct sysdb_attrs *attrs,
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozek int mod_op);
eb29ae58117ca88868491fe2240e27393c7a9068Jakub Hrozek
ba153306e0e551731a3ee2c31c26cd1d63052ff8Jakub Hrozekerrno_t
e7d1cd14ce1a427007b1a7e9789dcb7e9619f84fJakub Hrozeksysdb_invalidate_autofs_maps(struct sss_domain_info *domain);
ba153306e0e551731a3ee2c31c26cd1d63052ff8Jakub Hrozek
2234d49c8a307ee4f11cc544c862a359f76b44adJakub Hrozekchar *
2234d49c8a307ee4f11cc544c862a359f76b44adJakub Hrozeksysdb_autofsentry_strdn(TALLOC_CTX *mem_ctx,
2234d49c8a307ee4f11cc544c862a359f76b44adJakub Hrozek struct sss_domain_info *domain,
2234d49c8a307ee4f11cc544c862a359f76b44adJakub Hrozek const char *map_name,
2234d49c8a307ee4f11cc544c862a359f76b44adJakub Hrozek const char *entry_name,
2234d49c8a307ee4f11cc544c862a359f76b44adJakub Hrozek const char *entry_value);
2234d49c8a307ee4f11cc544c862a359f76b44adJakub Hrozek
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek#endif /* _SYSDB_AUTOFS_H_ */