2 * Copyright (c) 2011, Secure Endpoints Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28 * OF THE POSSIBILITY OF SUCH DAMAGE.
32 #ifndef HEIMDAL_KRB5_KUSEROK_PLUGIN_H
33 #define HEIMDAL_KRB5_KUSEROK_PLUGIN_H 1
35 #include <heimbase-svc.h>
37 #define KRB5_PLUGIN_KUSEROK "krb5_plugin_kuserok"
38 #define KRB5_PLUGIN_KUSEROK_VERSION_0 0
40 /** @struct krb5plugin_kuserok_ftable_desc
42 * @brief Description of the krb5_kuserok(3) plugin facility.
44 * The krb5_kuserok(3) function is pluggable. The plugin is named
45 * KRB5_PLUGIN_KUSEROK ("krb5_plugin_kuserok"), with a single minor
46 * version, KRB5_PLUGIN_KUSEROK_VERSION_0 (0).
48 * The plugin for krb5_kuserok(3) consists of a data symbol referencing
49 * a structure of type krb5plugin_kuserok_ftable, with four fields:
51 * @param init Plugin initialization function (see krb5-plugin(7))
53 * @param minor_version The plugin minor version number (0)
55 * @param fini Plugin finalization function
57 * @param kuserok Plugin kuserok function
59 * The kuserok field is the plugin entry point that performs the
60 * traditional kuserok operation however the plugin desires. It is
61 * invoked in no particular order relative to other kuserok plugins, but
62 * it has a 'rule' argument that indicates which plugin is intended to
63 * act on the rule. The plugin kuserok function must return
64 * KRB5_PLUGIN_NO_HANDLE if the rule is not applicable to it.
66 * The plugin kuserok function has the following arguments, in this
69 * -# plug_ctx, the context value output by the plugin's init function
70 * -# context, a krb5_context
71 * -# rule, the kuserok rule being evaluated (from krb5.conf(5))
73 * -# k5login_dir, configured location of k5login per-user files if any
74 * -# luser, name of the local user account to which principal is attempting to access.
75 * -# principal, the krb5_principal trying to access the luser account
76 * -# result, a krb5_boolean pointer where the plugin will output its result
78 * @ingroup krb5_support
80 typedef struct krb5plugin_kuserok_ftable_desc
{
81 HEIM_PLUGIN_FTABLE_COMMON_ELEMENTS(krb5_context
);
82 krb5_error_code (KRB5_LIB_CALL
*kuserok
)(void *, krb5_context
, const char *,
83 unsigned int, const char *, const char *,
86 } krb5plugin_kuserok_ftable
;
88 #define KUSEROK_ANAME_TO_LNAME_OK 1
89 #define KUSEROK_K5LOGIN_IS_AUTHORITATIVE 2
91 #endif /* HEIMDAL_KRB5_KUSEROK_PLUGIN_H */