source: trunk/server/source3/lib/ldap_escape.c@ 421

Last change on this file since 421 was 414, checked in by Herwig Bauernfeind, 16 years ago

Samba 3.5.0: Initial import

File size: 2.5 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 ldap filter argument escaping
4
5 Copyright (C) 1998, 1999, 2000 Luke Howard <[email protected]>,
6 Copyright (C) 2003 Andrew Bartlett <[email protected]>
7
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23#include "includes.h"
24
25/**
26 * Escape a parameter to an LDAP filter string, so they cannot contain
27 * embeded ( ) * or \ chars which may cause it not to parse correctly.
28 *
29 * @param s The input string
30 *
31 * @return A string allocated with malloc(), containing the escaped string,
32 * and to be free()ed by the caller.
33 **/
34
35char *escape_ldap_string(TALLOC_CTX *mem_ctx, const char *s)