keyhole logo

Heimdal Kerberos 5 support functions


Functions

krb5_error_code KRB5_LIB_FUNCTION krb5_acl_match_string (krb5_context context, const char *string, const char *format,...)
krb5_error_code KRB5_LIB_FUNCTION krb5_acl_match_file (krb5_context context, const char *file, const char *format,...)
krb5_error_code KRB5_LIB_FUNCTION krb5_config_parse_file_multi (krb5_context context, const char *fname, krb5_config_section **res)
krb5_error_code KRB5_LIB_FUNCTION krb5_expand_hostname (krb5_context context, const char *orig_hostname, char **new_hostname)
krb5_error_code KRB5_LIB_FUNCTION krb5_expand_hostname_realms (krb5_context context, const char *orig_hostname, char **new_hostname, char ***realms)
krb5_error_code KRB5_LIB_FUNCTION krb5_free_host_realm (krb5_context context, krb5_realm *realmlist)
krb5_error_code krb5_plugin_register (krb5_context context, enum krb5_plugin_type type, const char *name, void *symbol)

Detailed Description


Function Documentation

krb5_error_code KRB5_LIB_FUNCTION krb5_acl_match_file ( krb5_context  context,
const char *  file,
const char *  format,
  ... 
)

krb5_acl_match_file matches ACL format against each line in a file using krb5_acl_match_string(). Lines starting with # are treated like comments and ignored.

Parameters:
context Kerberos 5 context.
file file with acl listed in the file.
format format to match.
... parameter to format string.
Returns:
Return an error code or 0.
See also:
krb5_acl_match_string

krb5_error_code KRB5_LIB_FUNCTION krb5_acl_match_string ( krb5_context  context,
const char *  string,
const char *  format,
  ... 
)

krb5_acl_match_string matches ACL format against a string.

The ACL format has three format specifiers: s, f, and r. Each specifier will retrieve one argument from the variable arguments for either matching or storing data. The input string is split up using " " (space) and "\t" (tab) as a delimiter; multiple and "\t" in a row are considered to be the same.

List of format specifiers:

  • s Matches a string using strcmp(3) (case sensitive).
  • f Matches the string with fnmatch(3). Theflags argument (the last argument) passed to the fnmatch function is 0.
  • r Returns a copy of the string in the char ** passed in; the copy must be freed with free(3). There is no need to free(3) the string on error: the function will clean up and set the pointer to NULL.

Parameters:
context Kerberos 5 context
string string to match with
format format to match
... parameter to format string
Returns:
Return an error code or 0.
 char *s;

 ret = krb5_acl_match_string(context, "foo", "s", "foo");
 if (ret)
     krb5_errx(context, 1, "acl didn't match");
 ret = krb5_acl_match_string(context, "foo foo baz/kaka",
     "ss", "foo", &s, "foo/\\*");
 if (ret) {
     // no need to free(s) on error
     assert(s == NULL);
     krb5_errx(context, 1, "acl didn't match");
 }
 free(s);

See also:
krb5_acl_match_file

krb5_error_code KRB5_LIB_FUNCTION krb5_config_parse_file_multi ( krb5_context  context,
const char *  fname,
krb5_config_section **  res 
)

Parse a configuration file and add the result into res. This interface can be used to parse several configuration files into one resulting krb5_config_section by calling it repeatably.

Parameters:
context a Kerberos 5 context.
fname a file name to a Kerberos configuration file
res the returned result, must be free with krb5_free_config_files().
Returns:
Return an error code or 0, see krb5_get_error_message().

If the fname starts with "~/" parse configuration file in the current users home directory. The behavior can be disabled and enabled by calling krb5_set_home_dir_access().

krb5_error_code KRB5_LIB_FUNCTION krb5_expand_hostname ( krb5_context  context,
const char *  orig_hostname,
char **  new_hostname 
)

krb5_expand_hostname() tries to make orig_hostname into a more canonical one in the newly allocated space returned in new_hostname.

Parameters:
context a Keberos context
orig_hostname hostname to canonicalise.
new_hostname output hostname, caller must free hostname with krb5_xfree().
Returns:
Return an error code or 0, see krb5_get_error_message().

krb5_error_code KRB5_LIB_FUNCTION krb5_expand_hostname_realms ( krb5_context  context,
const char *  orig_hostname,
char **  new_hostname,
char ***  realms 
)

krb5_expand_hostname_realms() expands orig_hostname to a name we believe to be a hostname in newly allocated space in new_hostname and return the realms new_hostname is believed to belong to in realms.

Parameters:
context a Keberos context
orig_hostname hostname to canonicalise.
new_hostname output hostname, caller must free hostname with krb5_xfree().
realms output possible realms, is an array that is terminated with NULL. Caller must free with krb5_free_host_realm().
Returns:
Return an error code or 0, see krb5_get_error_message().

krb5_error_code KRB5_LIB_FUNCTION krb5_free_host_realm ( krb5_context  context,
krb5_realm *  realmlist 
)

Free all memory allocated by `realmlist'

Parameters:
context A Kerberos 5 context.
realmlist realmlist to free, NULL is ok
Returns:
a Kerberos error code, always 0.

krb5_error_code krb5_plugin_register ( krb5_context  context,
enum krb5_plugin_type  type,
const char *  name,
void *  symbol 
)

Register a plugin symbol name of specific type.

Parameters:
context a Keberos context
type type of plugin symbol
name name of plugin symbol
symbol a pointer to the named symbol
Returns:
In case of error a non zero error com_err error is returned and the Kerberos error string is set.


Generated on Fri Aug 14 16:34:42 2009 for HeimdalKerberos5library by doxygen 1.5.6