]>
Commit | Line | Data |
---|---|---|
e0a8d7a7 | 1 | diff -u -p -r1.2 lockd.c |
2 | --- utils/lockd/lockd.c 2001/01/25 21:11:29 1.2 | |
3 | +++ utils/lockd/lockd.c 2001/05/28 15:32:21 | |
4 | @@ -9,6 +9,8 @@ | |
5 | #include "config.h" | |
6 | ||
7 | #include <stdio.h> | |
8 | +#include <unistd.h> | |
9 | +#include <string.h> | |
10 | #include <errno.h> | |
11 | #include "nfslib.h" | |
12 | ||
13 | @@ -21,6 +23,12 @@ main(int argc, char **argv) | |
14 | ||
15 | if (argc > 1) | |
16 | usage (argv [0]); | |
17 | + | |
18 | + if (chdir(NFS_STATEDIR)) { | |
19 | + fprintf(stderr, "%s: chdir(%s) failed: %s\n", | |
20 | + argv [0], NFS_STATEDIR, strerror(errno)); | |
21 | + exit(1); | |
22 | + } | |
23 | ||
24 | if ((error = lockdsvc()) < 0) { | |
25 | if (errno == EINVAL) | |
26 | diff -u -p -r1.8 mountd.c | |
27 | --- utils/mountd/mountd.c 2001/02/11 01:12:02 1.8 | |
28 | +++ utils/mountd/mountd.c 2001/05/28 15:32:22 | |
29 | @@ -14,6 +14,7 @@ | |
30 | #include <arpa/inet.h> | |
31 | #include <unistd.h> | |
32 | #include <stdlib.h> | |
33 | +#include <string.h> | |
34 | #include <getopt.h> | |
35 | #include <errno.h> | |
36 | #include <fcntl.h> | |
37 | @@ -439,6 +440,12 @@ main(int argc, char **argv) | |
38 | /* No more arguments allowed. */ | |
39 | if (optind != argc || !(nfs_version & 0x7)) | |
40 | usage(argv [0], 1); | |
41 | + | |
42 | + if (chdir(NFS_STATEDIR)) { | |
43 | + fprintf(stderr, "%s: chdir(%s) failed: %s\n", | |
44 | + argv [0], NFS_STATEDIR, strerror(errno)); | |
45 | + exit(1); | |
46 | + } | |
47 | ||
48 | /* Initialize logging. */ | |
49 | /* xlog_open("mountd"); */ | |
50 | diff -u -p -r1.1.1.1 nfsd.c | |
51 | --- utils/nfsd/nfsd.c 1999/10/18 23:21:12 1.1.1.1 | |
52 | +++ utils/nfsd/nfsd.c 2001/05/28 15:32:22 | |
53 | @@ -11,6 +11,9 @@ | |
54 | ||
55 | #include <stdio.h> | |
56 | #include <stdlib.h> | |
57 | +#include <unistd.h> | |
58 | +#include <string.h> | |
59 | +#include <errno.h> | |
60 | #include <getopt.h> | |
61 | #include "nfslib.h" | |
62 | ||
63 | @@ -41,6 +44,12 @@ main(int argc, char **argv) | |
64 | default: | |
65 | usage(argv[0]); | |
66 | } | |
67 | + } | |
68 | + | |
69 | + if (chdir(NFS_STATEDIR)) { | |
70 | + fprintf(stderr, "%s: chdir(%s) failed: %s\n", | |
71 | + argv [0], NFS_STATEDIR, strerror(errno)); | |
72 | + exit(1); | |
73 | } | |
74 | ||
75 | if (optind < argc) { |