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 32
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
55 * The gss mechanisms that we can handle
57 enum {AUTHTYPE_KRB5, AUTHTYPE_SPKM3, AUTHTYPE_LIPKEY};
61 extern char pipefs_dir[PATH_MAX];
62 extern char pipefs_nfsdir[PATH_MAX];
63 extern char keytabfile[PATH_MAX];
64 extern char ccachedir[PATH_MAX];
65 extern int use_memcache;
66 extern int root_uses_machine_creds;
68 TAILQ_HEAD(clnt_list_head, clnt_info) clnt_list;
71 TAILQ_ENTRY(clnt_info) list;
85 void init_client_list(void);
86 int update_client_list(void);
87 void handle_krb5_upcall(struct clnt_info *clp);
88 void handle_spkm3_upcall(struct clnt_info *clp);
89 int gssd_acquire_cred(char *server_name);
93 #endif /* _RPC_GSSD_H_ */