map.c (98841) | map.c (102528) |
---|---|
1/* 2 * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1992, 1995-1997 Eric P. Allman. All rights reserved. 5 * Copyright (c) 1992, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * By using this file, you agree to the terms and conditions set 9 * forth in the LICENSE file which can be found at the top level of 10 * the sendmail distribution. 11 * 12 */ 13 14#include <sendmail.h> 15 | 1/* 2 * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1992, 1995-1997 Eric P. Allman. All rights reserved. 5 * Copyright (c) 1992, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * By using this file, you agree to the terms and conditions set 9 * forth in the LICENSE file which can be found at the top level of 10 * the sendmail distribution. 11 * 12 */ 13 14#include <sendmail.h> 15 |
16SM_RCSID("@(#)$Id: map.c,v 8.645.2.1 2002/06/21 20:25:23 ca Exp $") | 16SM_RCSID("@(#)$Id: map.c,v 8.645.2.3 2002/08/09 22:23:13 gshapiro Exp $") |
17 18#if LDAPMAP 19# include <sm/ldap.h> 20#endif /* LDAPMAP */ 21 22#if NDBM 23# include <ndbm.h> 24# ifdef R_FIRST --- 3781 unchanged lines hidden (view full) --- 3806 3807 p = vp_tmp; 3808 for (i = 0; vals[i] != NULL; i++) 3809 { 3810 if (lmap->ldap_attrsep != '\0') 3811 { 3812 p += sm_strlcpy(p, attr, 3813 vsize - (p - vp_tmp)); | 17 18#if LDAPMAP 19# include <sm/ldap.h> 20#endif /* LDAPMAP */ 21 22#if NDBM 23# include <ndbm.h> 24# ifdef R_FIRST --- 3781 unchanged lines hidden (view full) --- 3806 3807 p = vp_tmp; 3808 for (i = 0; vals[i] != NULL; i++) 3809 { 3810 if (lmap->ldap_attrsep != '\0') 3811 { 3812 p += sm_strlcpy(p, attr, 3813 vsize - (p - vp_tmp)); |
3814 if (p >= vp_tmp + vsize) 3815 syserr("ldapmap_lookup: Internal error: buffer too small for LDAP values"); |
|
3814 *p++ = lmap->ldap_attrsep; 3815 } 3816 p += sm_strlcpy(p, vals[i], 3817 vsize - (p - vp_tmp)); 3818 if (p >= vp_tmp + vsize) 3819 syserr("ldapmap_lookup: Internal error: buffer too small for LDAP values"); 3820 if (vals[i + 1] != NULL) 3821 *p++ = map->map_coldelim; --- 3371 unchanged lines hidden (view full) --- 7193 } 7194 7195 /* if we are looking at a NULL ns_map_list_t, then create a new one */ 7196 if (ns_map == NULL) 7197 { 7198 ns_map = (ns_map_list_t *) xalloc(sizeof *ns_map); 7199 ns_map->mapname = newstr(mapname); 7200 ns_map->map = (ns_map_t *) xalloc(sizeof *ns_map->map); | 3816 *p++ = lmap->ldap_attrsep; 3817 } 3818 p += sm_strlcpy(p, vals[i], 3819 vsize - (p - vp_tmp)); 3820 if (p >= vp_tmp + vsize) 3821 syserr("ldapmap_lookup: Internal error: buffer too small for LDAP values"); 3822 if (vals[i + 1] != NULL) 3823 *p++ = map->map_coldelim; --- 3371 unchanged lines hidden (view full) --- 7195 } 7196 7197 /* if we are looking at a NULL ns_map_list_t, then create a new one */ 7198 if (ns_map == NULL) 7199 { 7200 ns_map = (ns_map_list_t *) xalloc(sizeof *ns_map); 7201 ns_map->mapname = newstr(mapname); 7202 ns_map->map = (ns_map_t *) xalloc(sizeof *ns_map->map); |
7203 memset(ns_map->map, '\0', sizeof *ns_map->map); |
|
7201 ns_map->next = ns_maps; 7202 ns_maps = ns_map; 7203 } 7204 return ns_map->map; 7205} 7206 7207char * 7208nsd_map_lookup(map, name, av, statp) --- 161 unchanged lines hidden --- | 7204 ns_map->next = ns_maps; 7205 ns_maps = ns_map; 7206 } 7207 return ns_map->map; 7208} 7209 7210char * 7211nsd_map_lookup(map, name, av, statp) --- 161 unchanged lines hidden --- |