|
Packit |
6bd9ab |
/*
|
|
Packit |
6bd9ab |
attmap.h - attribute mapping variables
|
|
Packit |
6bd9ab |
This file is part of the nss-pam-ldapd library.
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
Copyright (C) 2007, 2008, 2009, 2010, 2012 Arthur de Jong
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
This library is free software; you can redistribute it and/or
|
|
Packit |
6bd9ab |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6bd9ab |
License as published by the Free Software Foundation; either
|
|
Packit |
6bd9ab |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
This library is distributed in the hope that it will be useful,
|
|
Packit |
6bd9ab |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6bd9ab |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6bd9ab |
Lesser General Public License for more details.
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6bd9ab |
License along with this library; if not, write to the Free Software
|
|
Packit |
6bd9ab |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit |
6bd9ab |
02110-1301 USA
|
|
Packit |
6bd9ab |
*/
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
#ifndef NSLCD__ATTMAP_H
|
|
Packit |
6bd9ab |
#define NSLCD__ATTMAP_H 1
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
#include "cfg.h"
|
|
Packit |
6bd9ab |
#include "myldap.h"
|
|
Packit |
6bd9ab |
#include "common/set.h"
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
/* these are the attribute names per database */
|
|
Packit |
6bd9ab |
extern const char *attmap_alias_cn;
|
|
Packit |
6bd9ab |
extern const char *attmap_alias_rfc822MailMember;
|
|
Packit |
6bd9ab |
extern const char *attmap_ether_cn;
|
|
Packit |
6bd9ab |
extern const char *attmap_ether_macAddress;
|
|
Packit |
6bd9ab |
extern const char *attmap_group_cn;
|
|
Packit |
6bd9ab |
extern const char *attmap_group_userPassword;
|
|
Packit |
6bd9ab |
extern const char *attmap_group_gidNumber;
|
|
Packit |
6bd9ab |
extern const char *attmap_group_memberUid;
|
|
Packit |
6bd9ab |
extern const char *attmap_group_member;
|
|
Packit |
6bd9ab |
extern const char *attmap_host_cn;
|
|
Packit |
6bd9ab |
extern const char *attmap_host_ipHostNumber;
|
|
Packit |
6bd9ab |
extern const char *attmap_netgroup_cn;
|
|
Packit |
6bd9ab |
extern const char *attmap_netgroup_nisNetgroupTriple;
|
|
Packit |
6bd9ab |
extern const char *attmap_netgroup_memberNisNetgroup;
|
|
Packit |
6bd9ab |
extern const char *attmap_network_cn;
|
|
Packit |
6bd9ab |
extern const char *attmap_network_ipNetworkNumber;
|
|
Packit |
6bd9ab |
extern const char *attmap_passwd_uid;
|
|
Packit |
6bd9ab |
extern const char *attmap_passwd_userPassword;
|
|
Packit |
6bd9ab |
extern const char *attmap_passwd_uidNumber;
|
|
Packit |
6bd9ab |
extern const char *attmap_passwd_gidNumber;
|
|
Packit |
6bd9ab |
extern const char *attmap_passwd_gecos;
|
|
Packit |
6bd9ab |
extern const char *attmap_passwd_homeDirectory;
|
|
Packit |
6bd9ab |
extern const char *attmap_passwd_loginShell;
|
|
Packit |
6bd9ab |
extern const char *attmap_protocol_cn;
|
|
Packit |
6bd9ab |
extern const char *attmap_protocol_ipProtocolNumber;
|
|
Packit |
6bd9ab |
extern const char *attmap_rpc_cn;
|
|
Packit |
6bd9ab |
extern const char *attmap_rpc_oncRpcNumber;
|
|
Packit |
6bd9ab |
extern const char *attmap_service_cn;
|
|
Packit |
6bd9ab |
extern const char *attmap_service_ipServicePort;
|
|
Packit |
6bd9ab |
extern const char *attmap_service_ipServiceProtocol;
|
|
Packit |
6bd9ab |
extern const char *attmap_shadow_uid;
|
|
Packit |
6bd9ab |
extern const char *attmap_shadow_userPassword;
|
|
Packit |
6bd9ab |
extern const char *attmap_shadow_shadowLastChange;
|
|
Packit |
6bd9ab |
extern const char *attmap_shadow_shadowMin;
|
|
Packit |
6bd9ab |
extern const char *attmap_shadow_shadowMax;
|
|
Packit |
6bd9ab |
extern const char *attmap_shadow_shadowWarning;
|
|
Packit |
6bd9ab |
extern const char *attmap_shadow_shadowInactive;
|
|
Packit |
6bd9ab |
extern const char *attmap_shadow_shadowExpire;
|
|
Packit |
6bd9ab |
extern const char *attmap_shadow_shadowFlag;
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
/* return a reference to the map specific base variable */
|
|
Packit |
6bd9ab |
const char **base_get_var(enum ldap_map_selector map);
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
/* return a reference to the map specific scope variable */
|
|
Packit |
6bd9ab |
int *scope_get_var(enum ldap_map_selector map);
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
/* return a reference to the map specific filter variable */
|
|
Packit |
6bd9ab |
const char **filter_get_var(enum ldap_map_selector map);
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
/* return a reference to the attribute mapping variable for the specified name
|
|
Packit |
6bd9ab |
the name is the name after the attmap_... variables above with the
|
|
Packit |
6bd9ab |
underscode replaced by a dot (e.g passwd.homeDirectory) */
|
|
Packit |
6bd9ab |
const char **attmap_get_var(enum ldap_map_selector map, const char *name);
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
/* Set the attribute mapping of the variable to the value specified.
|
|
Packit |
6bd9ab |
Returns the new value on success. */
|
|
Packit |
6bd9ab |
MUST_USE const char *attmap_set_mapping(const char **var, const char *value);
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
/* Return a value for the attribute, handling the case where attr
|
|
Packit |
6bd9ab |
is an expression. On error (e.g. problem parsing expression, attribute
|
|
Packit |
6bd9ab |
value not found) it returns NULL and the buffer is made empty. */
|
|
Packit |
6bd9ab |
const char *attmap_get_value(MYLDAP_ENTRY *entry, const char *attr,
|
|
Packit |
6bd9ab |
char *buffer, size_t buflen);
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
/* Add the attributes from attr to the set. The attr argumenent
|
|
Packit |
6bd9ab |
can either be an attribute or an attribute expression. */
|
|
Packit |
6bd9ab |
SET *attmap_add_attributes(SET *set, const char *attr);
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
#endif /* not NSLCD__ATTMAP_H */
|