]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/monitor.c
Use 65534 for anon uid/gid rather than -2
[nfs-utils.git] / utils / statd / monitor.c
index 88b33db0ab478ac22a4bd33384a4cb204a244665..98cbf4a5940ba660bda50aa944f01769b0ee9ea4 100644 (file)
@@ -7,7 +7,9 @@
  * NSM for Linux.
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <fcntl.h>
 #include <limits.h>
@@ -15,6 +17,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <errno.h>
 #include <arpa/inet.h>
 #include "misc.h"
 #include "statd.h"
@@ -172,7 +175,7 @@ sm_mon_1_svc(struct mon *argp, struct svc_req *rqstp)
        sprintf(path, "%s/%s", SM_DIR, mon_name);
        if ((fd = open(path, O_WRONLY|O_SYNC|O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
                /* Didn't fly.  We won't monitor. */
-               note(N_ERROR, "creat(%s) failed: %m", path);
+               note(N_ERROR, "creat(%s) failed: %s", path, strerror (errno));
                nlist_free(NULL, clnt);
                free(path);
                goto failure;
@@ -265,7 +268,9 @@ sm_unmon_1_svc(struct mon_id *argp, struct svc_req *rqstp)
                        clnt = NL_NEXT(clnt);
        }
 
+#ifdef RESTRICTED_STATD
  failure:
+#endif
        note(N_WARNING, "Received erroneous SM_UNMON request from %s for %s",
                my_name, mon_name);
        return (&result);
@@ -333,6 +338,8 @@ sm_unmon_all_1_svc(struct my_id *argp, struct svc_req *rqstp)
                dprintf(N_DEBUG, "SM_UNMON_ALL request from %s with no "
                        "SM_MON requests from it.", my_name);
        }
+#ifdef RESTRICTED_STATD
  failure:
+#endif
        return (&result);
 }