2 Copyright (c) 2004 The Regents of the University of Michigan.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
9 1. Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 2. Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
14 3. Neither the name of the University nor the names of its
15 contributors may be used to endorse or promote products derived
16 from this software without specific prior written permission.
18 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
19 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
25 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include <sys/types.h>
35 #include <sys/queue.h>
36 #include <gssapi/gssapi.h>
38 #define MAX_FILE_NAMELEN 32
39 #define FD_ALLOC_BLOCK 256
40 #ifndef GSSD_PIPEFS_DIR
41 #define GSSD_PIPEFS_DIR "/var/lib/nfs/rpc_pipefs"
45 #define DNOTIFY_SIGNAL (SIGRTMIN + 3)
47 #define GSSD_DEFAULT_CRED_DIR "/tmp"
48 #define GSSD_DEFAULT_CRED_PREFIX "krb5cc_"
49 #define GSSD_DEFAULT_MACHINE_CRED_SUFFIX "machine"
50 #define GSSD_DEFAULT_KEYTAB_FILE "/etc/krb5.keytab"
51 #define GSSD_SERVICE_NAME "nfs"
52 #define GSSD_SERVICE_NAME_LEN 3
53 #define GSSD_MAX_CCACHE_SEARCH 16
56 * The gss mechanisms that we can handle
58 enum {AUTHTYPE_KRB5, AUTHTYPE_SPKM3, AUTHTYPE_LIPKEY};
62 extern char pipefs_dir[PATH_MAX];
63 extern char keytabfile[PATH_MAX];
64 extern char *ccachesearch[];
65 extern int use_memcache;
66 extern int root_uses_machine_creds;
67 extern unsigned int context_timeout;
68 extern char *preferred_realm;
70 TAILQ_HEAD(clnt_list_head, clnt_info) clnt_list;
73 TAILQ_ENTRY(clnt_info) list;
87 struct sockaddr_storage addr;
90 TAILQ_HEAD(topdirs_list_head, topdirs_info) topdirs_list;
93 TAILQ_ENTRY(topdirs_info) list;
98 void init_client_list(void);
99 int update_client_list(void);
100 void handle_krb5_upcall(struct clnt_info *clp);
101 void handle_spkm3_upcall(struct clnt_info *clp);
102 void handle_gssd_upcall(struct clnt_info *clp);
103 int gssd_acquire_cred(char *server_name);
107 #endif /* _RPC_GSSD_H_ */