diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2007-07-24 10:13:46 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2007-07-24 10:13:46 +0000 |
commit | faee906ac541a533b61d1b51aad34fde4f3f8509 (patch) | |
tree | 88703b0828a955d0ae319f9a3bc211e94419b781 /nslcd | |
parent | d1566e9f8c34365d4e674f3f7b41a103a8bff01f (diff) |
get rid of some unused attribute mappings and a small reorganisation of code
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@325 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd')
-rw-r--r-- | nslcd/cfg.c | 2 | ||||
-rw-r--r-- | nslcd/ldap-schema.c | 72 | ||||
-rw-r--r-- | nslcd/ldap-schema.h | 33 |
3 files changed, 28 insertions, 79 deletions
diff --git a/nslcd/cfg.c b/nslcd/cfg.c index 6fae4b8..42e9785 100644 --- a/nslcd/cfg.c +++ b/nslcd/cfg.c @@ -262,8 +262,6 @@ static enum ldap_map_selector _nss_ldap_str2selector(const char *key) sel = LM_ETHERS; else if (!strcasecmp (key, MP_netmasks)) sel = LM_NETMASKS; - else if (!strcasecmp (key, MP_bootparams)) - sel = LM_BOOTPARAMS; else if (!strcasecmp (key, MP_aliases)) sel = LM_ALIASES; else if (!strcasecmp (key, MP_netgroup)) diff --git a/nslcd/ldap-schema.c b/nslcd/ldap-schema.c index 81b9286..f7b2839 100644 --- a/nslcd/ldap-schema.c +++ b/nslcd/ldap-schema.c @@ -237,42 +237,6 @@ _nss_ldap_init_filters () } -static void init_pwd_attributes (const char ***pwd_attrs); -static void init_sp_attributes (const char ***sp_attrs); -static void init_grp_attributes (const char ***grp_attrs); -static void init_hosts_attributes (const char ***hosts_attrs); -static void init_services_attributes (const char ***services_attrs); -static void init_network_attributes (const char ***network_attrs); -static void init_proto_attributes (const char ***proto_attrs); -static void init_rpc_attributes (const char ***rpc_attrs); -static void init_ethers_attributes (const char ***ethers_attrs); -static void init_bp_attributes (const char ***bp_attrs); -static void init_alias_attributes (const char ***alias_attrs); -static void init_netgrp_attributes (const char ***netgrp_attrs); - -/** - * attribute table initialization routines - */ -void -_nss_ldap_init_attributes (const char ***attrtab) -{ - init_pwd_attributes (&attrtab[LM_PASSWD]); - init_sp_attributes (&attrtab[LM_SHADOW]); - init_grp_attributes (&attrtab[LM_GROUP]); - init_hosts_attributes (&attrtab[LM_HOSTS]); - init_services_attributes (&attrtab[LM_SERVICES]); - init_network_attributes (&attrtab[LM_NETWORKS]); - init_proto_attributes (&attrtab[LM_PROTOCOLS]); - init_rpc_attributes (&attrtab[LM_RPC]); - init_ethers_attributes (&attrtab[LM_ETHERS]); - init_network_attributes (&attrtab[LM_NETMASKS]); - init_bp_attributes (&attrtab[LM_BOOTPARAMS]); - init_alias_attributes (&attrtab[LM_ALIASES]); - init_netgrp_attributes (&attrtab[LM_NETGROUP]); - - attrtab[LM_NONE] = NULL; -} - static void init_pwd_attributes (const char ***pwd_attrs) { @@ -405,18 +369,6 @@ init_ethers_attributes (const char ***ethers_attrs) } static void -init_bp_attributes (const char ***bp_attrs) -{ - static const char *__bp_attrs[ATTRTAB_SIZE + 1]; - - (*bp_attrs) = __bp_attrs; - - (*bp_attrs)[0] = ATM (LM_BOOTPARAMS, cn); - (*bp_attrs)[1] = AT (bootParameter); - (*bp_attrs)[2] = NULL; -} - -static void init_alias_attributes (const char ***alias_attrs) { static const char *__alias_attrs[ATTRTAB_SIZE + 1]; @@ -440,3 +392,27 @@ init_netgrp_attributes (const char ***netgrp_attrs) (*netgrp_attrs)[2] = AT (memberNisNetgroup); (*netgrp_attrs)[3] = NULL; } + +/** + * attribute table initialization routines + */ +void +_nss_ldap_init_attributes (const char ***attrtab) +{ + init_pwd_attributes (&attrtab[LM_PASSWD]); + init_sp_attributes (&attrtab[LM_SHADOW]); + init_grp_attributes (&attrtab[LM_GROUP]); + init_hosts_attributes (&attrtab[LM_HOSTS]); + init_services_attributes (&attrtab[LM_SERVICES]); + init_network_attributes (&attrtab[LM_NETWORKS]); + init_proto_attributes (&attrtab[LM_PROTOCOLS]); + init_rpc_attributes (&attrtab[LM_RPC]); + init_ethers_attributes (&attrtab[LM_ETHERS]); + init_network_attributes (&attrtab[LM_NETMASKS]); + init_alias_attributes (&attrtab[LM_ALIASES]); + init_netgrp_attributes (&attrtab[LM_NETGROUP]); + + attrtab[LM_NONE] = NULL; +} + + diff --git a/nslcd/ldap-schema.h b/nslcd/ldap-schema.h index 4ccbcd2..360b642 100644 --- a/nslcd/ldap-schema.h +++ b/nslcd/ldap-schema.h @@ -98,10 +98,14 @@ extern char _nss_ldap_filt_getnetgrent[]; * selector (eg. LM_PASSWD) relative to an "ldap_config" */ + + + /** * Lookup (potentially mapped) * objectclass/attribute. */ +/* these functions are defined in ldap-nss.[ch] */ #define OC(oc) _nss_ldap_map_oc(LM_NONE, OC##_##oc) #define OCM(map, at) _nss_ldap_map_oc(map, AT##_##at) #define AT(at) _nss_ldap_map_at(LM_NONE, AT##_##at) @@ -241,24 +245,6 @@ extern char _nss_ldap_filt_getnetgrent[]; #define AT_memberNisNetgroup "memberNisNetgroup" /* - * ( nisSchema.2.09 NAME 'nisMap' SUP top STRUCTURAL - * DESC 'A generic abstraction of a NIS map' - * MUST nisMapName - * MAY description ) - */ -#define OC_nisMap "nisMap" -#define AT_nisMapName "nisNapName" - -/* - * ( nisSchema.2.10 NAME 'nisObject' SUP top STRUCTURAL - * DESC 'An entry in a NIS map' - * MUST ( cn $ nisMapEntry $ nisMapName ) - * MAY description ) - */ -#define OC_nisObject "nisObject" -#define AT_nisMapEntry "nisMapEntry" - -/* * ( nisSchema.2.11 NAME 'ieee802Device' SUP top AUXILIARY * DESC 'A device with a MAC address; device SHOULD be * used as a structural class' @@ -268,16 +254,6 @@ extern char _nss_ldap_filt_getnetgrent[]; #define AT_macAddress "macAddress" /* - * ( nisSchema.2.12 NAME 'bootableDevice' SUP top AUXILIARY - * DESC 'A device with boot parameters; device SHOULD be - * used as a structural class' - * MAY ( bootFile $ bootParameter ) ) - */ -#define OC_bootableDevice "bootableDevice" -#define AT_bootFile "bootFile" -#define AT_bootParameter "bootParameter" - -/* * Map names */ #define MP_passwd "passwd" @@ -290,7 +266,6 @@ extern char _nss_ldap_filt_getnetgrent[]; #define MP_rpc "rpc" #define MP_ethers "ethers" #define MP_netmasks "netmasks" -#define MP_bootparams "bootparams" #define MP_aliases "aliases" #define MP_netgroup "netgroup" |