]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
2001-05-28 H.J. Lu <hjl@lucon.org>
authorhjl <hjl>
Mon, 28 May 2001 18:37:30 +0000 (18:37 +0000)
committerhjl <hjl>
Mon, 28 May 2001 18:37:30 +0000 (18:37 +0000)
* utils/lockd/lockd.c (main): chdir to NFS_STATEDIR.
* utils/mountd/mountd.c (main): Likewise.
* utils/nfsd/nfsd.c (main): Likewise.
* utils/rquotad/rquota_svc.c (main): Likewise.

ChangeLog
utils/lockd/lockd.c
utils/mountd/mountd.c
utils/nfsd/nfsd.c
utils/rquotad/rquota_svc.c

index 1760d41e5e8d171b5737f321f9f25288f402df9b..1630d21525e219d10c59e25e01d0103d7a067aa1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-28  H.J. Lu <hjl@lucon.org>
+
+       * utils/lockd/lockd.c (main): chdir to NFS_STATEDIR.
+       * utils/mountd/mountd.c (main): Likewise.
+       * utils/nfsd/nfsd.c (main): Likewise.
+       * utils/rquotad/rquota_svc.c (main): Likewise.
+
 2001-05-06  Anne Milicia <milicia@missioncriticallinux.com>
 
        * support/export/client.c (client_check): Check IP address
index 900510b606e2321019503c0b12d810e346111e25..49183d2d9a7dc4adae7a7789bdc4cffcdb3f2e10 100644 (file)
@@ -9,6 +9,8 @@
 #include "config.h"
 
 #include <stdio.h>
+#include <unistd.h>
+#include <string.h>
 #include <errno.h>
 #include "nfslib.h"
 
@@ -22,6 +24,12 @@ main(int argc, char **argv)
        if (argc > 1)
                usage (argv [0]);
 
+       if (chdir(NFS_STATEDIR)) {
+               fprintf(stderr, "%s: chdir(%s) failed: %s\n",
+                       argv [0], NFS_STATEDIR, strerror(errno));
+               exit(1);
+       }
+
        if ((error = lockdsvc()) < 0) {
                if (errno == EINVAL)
                        /* Ignore EINVAL since kernel may start
index 8779afed4a4fbb73ff59c3a3e1d6a93da15591be..14f5fa26f9691238f3a15ec3577d41f4f1e8b72e 100644 (file)
@@ -14,6 +14,7 @@
 #include <arpa/inet.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <string.h>
 #include <getopt.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -440,6 +441,12 @@ main(int argc, char **argv)
        if (optind != argc || !(nfs_version & 0x7))
                usage(argv [0], 1);
 
+       if (chdir(NFS_STATEDIR)) {
+               fprintf(stderr, "%s: chdir(%s) failed: %s\n",
+                       argv [0], NFS_STATEDIR, strerror(errno));
+               exit(1);
+       }
+
        /* Initialize logging. */
 /*     xlog_open("mountd"); */
 
index 3a22370a27540c81979656e7fcf97dde85c4ca55..c1cb56fe46db0e8e276bccecdbb3532a42cf5fbc 100644 (file)
@@ -11,6 +11,9 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
 #include <getopt.h>
 #include "nfslib.h"
 
@@ -43,6 +46,12 @@ main(int argc, char **argv)
                }
        }
 
+       if (chdir(NFS_STATEDIR)) {
+               fprintf(stderr, "%s: chdir(%s) failed: %s\n",
+                       argv [0], NFS_STATEDIR, strerror(errno));
+               exit(1);
+       }
+
        if (optind < argc) {
                if ((count = atoi(argv[optind])) < 0) {
                        /* insane # of servers */
index 104ba7eb8946cdb2675439f84d5896eaefd4c016..e1149664ced37639518c042b22fe890bc1ff97ea 100644 (file)
@@ -25,6 +25,7 @@
 #endif
 
 #include <unistd.h>
+#include <errno.h>
 #include <rpc/rpc.h>
 #include "rquota.h"
 #include <stdlib.h>
@@ -254,6 +255,13 @@ int main(int argc, char **argv)
      }
    }
 
+   if (chdir(NFS_STATEDIR)) {
+     fprintf(stderr, "%s: chdir(%s) failed: %s\n",
+            argv [0], NFS_STATEDIR, strerror(errno));
+
+     exit(1);
+   }
+
    /* WARNING: the following works on Linux and SysV, but not BSD! */
    signal(SIGCHLD, SIG_IGN);