]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/statd/stat.c
Use 65534 for anon uid/gid rather than -2
[nfs-utils.git] / utils / statd / stat.c
1 /*
2  * Copyright (C) 1995, 1997, 1999 Jeffrey A. Uphoff
3  * Modified by Olaf Kirch, 1996.
4  *
5  * NSM for Linux.
6  */
7
8 #ifdef HAVE_CONFIG_H
9 #include <config.h>
10 #endif
11
12 #include <netdb.h>
13 #include "statd.h"
14
15 /* 
16  * Services SM_STAT requests.
17  *
18  * According the the X/Open spec's on this procedure: "Implementations
19  * should not rely on this procedure being operative.  In many current
20  * implementations of the NSM it will always return a 'STAT_FAIL'
21  * status."  My implementation is operative; it returns 'STAT_SUCC'
22  * whenever it can resolve the hostname that it's being asked to
23  * monitor, and returns 'STAT_FAIL' otherwise.
24  */
25 struct sm_stat_res * 
26 sm_stat_1_svc (struct sm_name *argp, struct svc_req *rqstp)
27 {
28   static sm_stat_res result;
29
30   if (gethostbyname (argp->mon_name) == NULL) {
31     note (N_WARNING, "gethostbyname error for %s", argp->mon_name);
32     result.res_stat = STAT_FAIL;
33     dprintf (N_DEBUG, "STAT_FAIL for %s", argp->mon_name);
34   } else {
35     result.res_stat = STAT_SUCC;
36     dprintf (N_DEBUG, "STAT_SUCC for %s", argp->mon_name);
37   }
38   result.state = MY_STATE;
39   return(&result);
40 }