]>
Commit | Line | Data |
---|---|---|
99a9930a AG |
1 | diff -Naur LinNeighborhood-0.6.5.orig/src/smbmount.c LinNeighborhood-0.6.5/src/smbmount.c |
2 | --- LinNeighborhood-0.6.5.orig/src/smbmount.c Sun Jun 9 09:58:43 2002 | |
3 | +++ LinNeighborhood-0.6.5/src/smbmount.c Fri Aug 13 15:02:25 2004 | |
4 | @@ -390,10 +390,16 @@ | |
5 | escape_str(smbuser,&strlist),escape_str(smbpasswd,&strlist)); | |
6 | break; | |
7 | case SMBMOUNT_206: | |
8 | - sprintf(commandstr,"%s %s %s -o username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,ip=%s,debug=0%s", | |
9 | + sprintf(commandstr,"%s %s %s -o username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,debug=0%s", | |
10 | escape_str(pref_get_smbmount_exe(),&strlist),escape_str(servicename,&strlist),escape_str(mount_point,&strlist), | |
11 | escape_str(smbuser,&strlist),escape_str(smbpasswd,&strlist), | |
12 | - filemode,dirmode,uid,gid,ipaddr,opt_group); | |
13 | + filemode,dirmode,uid,gid,opt_group); | |
14 | + | |
15 | + if (ipaddr && *ipaddr) { | |
16 | + string_ncat(commandstr, ",ip=", MAXMNTCOMMANDL); | |
17 | + string_ncat(commandstr, ipaddr, MAXMNTCOMMANDL); | |
18 | + } | |
19 | + | |
20 | if ( (port >= 0) && (port < 65536) ) | |
21 | { | |
22 | sprintf(commandstr, "%s,port=%d", commandstr, port); | |
23 | @@ -485,8 +491,14 @@ | |
24 | { | |
25 | argv[++argnr]="-o"; | |
26 | argv[++argnr]=commandstr; | |
27 | - sprintf(commandstr,"username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,ip=%s,debug=0", | |
28 | - smbuser,smbpasswd,filemode,dirmode,uid,gid,ipaddr); | |
29 | + sprintf(commandstr,"username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,debug=0", | |
30 | + smbuser,smbpasswd,filemode,dirmode,uid,gid); | |
31 | + | |
32 | + if (ipaddr && *ipaddr) { | |
33 | + string_ncat(commandstr, ",ip=", MAXMNTCOMMANDL); | |
34 | + string_ncat(commandstr, ipaddr, MAXMNTCOMMANDL); | |
35 | + } | |
36 | + | |
37 | if (*group_name) | |
38 | { | |
39 | strcat(commandstr,",workgroup="); | |
40 | @@ -573,9 +585,15 @@ | |
41 | pref_get_smbmount_exe(),servicename,mount_point,ipaddr,opt_group,smbuser,dummysmbpasswd); | |
42 | break; | |
43 | case SMBMOUNT_206: | |
44 | - sprintf(commandstr,"%s %s %s -o username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,ip=%s,debug=0%s", | |
45 | + sprintf(commandstr,"%s %s %s -o username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,debug=0%s", | |
46 | pref_get_smbmount_exe(),servicename,mount_point,smbuser,dummysmbpasswd, | |
47 | - filemode,dirmode,uid,gid,ipaddr,opt_group); | |
48 | + filemode,dirmode,uid,gid,opt_group); | |
49 | + | |
50 | + if (ipaddr && *ipaddr) { | |
51 | + string_ncat(commandstr, ",ip=", MAXMNTCOMMANDL); | |
52 | + string_ncat(commandstr, ipaddr, MAXMNTCOMMANDL); | |
53 | + } | |
54 | + | |
55 | if ( (port >= 0) && (port < 65536) ) | |
56 | { | |
57 | string_ncat(commandstr, ",port=", MAXMNTCOMMANDL); | |
58 | @@ -621,8 +639,14 @@ | |
59 | sprintf(userpasswd,"-U%s%%%s",smbuser,dummysmbpasswd); | |
60 | else | |
61 | { | |
62 | - sprintf(commandstr,"username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,ip=%s,debug=0", | |
63 | - smbuser,dummysmbpasswd,filemode,dirmode,uid,gid,ipaddr); | |
64 | + sprintf(commandstr,"username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,debug=0", | |
65 | + smbuser,dummysmbpasswd,filemode,dirmode,uid,gid); | |
66 | + | |
67 | + if (ipaddr && *ipaddr) { | |
68 | + string_ncat(commandstr, ",ip=", MAXMNTCOMMANDL); | |
69 | + string_ncat(commandstr, ipaddr, MAXMNTCOMMANDL); | |
70 | + } | |
71 | + | |
72 | if (*group_name){ | |
73 | strcat(commandstr,",workgroup="); | |
74 | strcat(commandstr,group_name); |