* 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-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
#include "config.h"
#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
#include <errno.h>
#include "nfslib.h"
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
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>
+#include <string.h>
#include <getopt.h>
#include <errno.h>
#include <fcntl.h>
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"); */
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
#include <getopt.h>
#include "nfslib.h"
}
}
+ 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 */
#endif
#include <unistd.h>
+#include <errno.h>
#include <rpc/rpc.h>
#include "rquota.h"
#include <stdlib.h>
}
}
+ 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);