2 /***********************************************************************
3 * Copyright (c) 2009, Secure Endpoints Inc.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * - Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 * OF THE POSSIBILITY OF SUCH DAMAGE.
31 **********************************************************************/
33 #include "krb5_locl.h"
38 * Internal function to expand tokens in paths.
42 * @context A krb5_context
43 * @path_in The path to expand tokens from
44 * @filepath True if the value is a filesystem path (converts slashes to
45 * backslashes on Windows)
46 * @ppath_out The expanded path
50 * @ppath_out Path with expanded tokens (caller must free() this)
52 KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
53 _krb5_expand_path_tokens(krb5_context context
,
58 return heim_expand_path_tokens(context
? context
->hcontext
: NULL
, path_in
,
59 filepath
, ppath_out
, NULL
);
63 * Internal function to expand tokens in paths.
67 * @context A krb5_context
68 * @path_in The path to expand tokens from
69 * @filepath True if the value is a filesystem path (converts slashes to
70 * backslashes on Windows)
71 * @ppath_out The expanded path
72 * @... Variable number of pairs of strings, the first of each
73 * being a token (e.g., "luser") and the second a string to
74 * replace it with. The list is terminated by a NULL.
78 * @ppath_out Path with expanded tokens (caller must free() this)
80 KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
81 _krb5_expand_path_tokensv(krb5_context context
,
84 char **ppath_out
, ...)
89 va_start(ap
, ppath_out
);
90 ret
= heim_expand_path_tokensv(context
->hcontext
, path_in
, filepath
, ppath_out
, ap
);