1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
*** ../rumba.0.4.s/./rumba.c Mon Feb 10 15:08:50 1997
--- ./rumba.c Sun Jun 15 14:17:02 1997
***************
*** 216,222 ****
struct passwd *pwd;
struct group *grp;
char mountpoint_abs[MAXPATHLEN + 1];
- char hostname[MAXHOSTNAMELEN + 1];
struct hostent *h;
int got_password, upcase_password;
int port = -1, max_xmit = -1;
--- 216,221 ----
***************
*** 231,237 ****
got_password = 0;
upcase_password = 1;
run_as_daemon = 1;
- memset(hostname, 0, sizeof(hostname));
if(argc < 2 || (argc == 2 && strcmp(argv[1], "-h") == 0)){
help();
exit(0);
--- 230,235 ----
***************
*** 239,248 ****
if(argc == 2 && strcmp(argv[1], "-v") == 0){
print_version();
}
! gethostname(hostname, MAXHOSTNAMELEN);
if (geteuid() != 0) {
eprintf("%s must be installed suid root\n", progname);
}
mount_point = argv[2];
if(extract_service(argv[1], &server, &share, &root, &user_dummy) != 0) {
usage();
--- 237,247 ----
if(argc == 2 && strcmp(argv[1], "-v") == 0){
print_version();
}
! #ifndef BSD4_4_LITE2
if (geteuid() != 0) {
eprintf("%s must be installed suid root\n", progname);
}
+ #endif
mount_point = argv[2];
if(extract_service(argv[1], &server, &share, &root, &user_dummy) != 0) {
usage();
***************
*** 393,398 ****
--- 392,403 ----
password, max_xmit, port) != 0){
exit(1);
}
+ #ifdef BSD4_4
+ if (realpath(mount_point, mountpoint_abs) == NULL) {
+ perror(mount_point);
+ exit (1);
+ }
+ #else
if(*mount_point == '/'){ /* absolute path given? */
strcpy(mountpoint_abs, mount_point);
}else{
***************
*** 403,408 ****
--- 408,414 ----
}
strcat(mountpoint_abs, mount_point);
}
+ #endif
mount_and_dispatch(mountpoint_abs, nfs_dispatch, root_fh, run_as_daemon);
return 0;
}
|