7860
|
1 |
diff -ru /var/tmp/clean/system-tools-backends-1.4.2/shares-conf.in system-tools-backends-1.4.2/shares-conf.in
|
|
2 |
--- /usr/tmp/clean/system-tools-backends-1.4.2/shares-conf.in 2005-11-21 01:19:47.000000000 +0000
|
|
3 |
+++ system-tools-backends-1.4.2/shares-conf.in 2006-04-21 14:50:42.916517000 +0100
|
|
4 |
@@ -68,6 +68,7 @@
|
|
5 |
"mandrake-10.0", "mandrake-10.1",
|
|
6 |
"blackpanther-4.0",
|
|
7 |
"debian-2.2", "debian-3.0", "debian-sarge",
|
|
8 |
+ "nexenta-1.0", "solaris-2.11",
|
|
9 |
"suse-7.0", "suse-9.0",
|
|
10 |
"turbolinux-7.0", "fedora-1", "fedora-2", "fedora-3",
|
|
11 |
"pld-1.0", "pld-1.1", "pld-1.99",
|
|
12 |
@@ -389,7 +390,7 @@
|
|
13 |
&gst_xml_print_line ("<export type='nfs'>");
|
|
14 |
&gst_xml_enter ();
|
|
15 |
|
|
16 |
- &gst_xml_print_pcdata ("name", "unknown");
|
|
17 |
+ &gst_xml_print_pcdata ("name", &gst_share_nfs_info_get_name ($info));
|
|
18 |
&gst_xml_print_pcdata ("path", &gst_share_nfs_info_get_point ($info));
|
|
19 |
|
|
20 |
for $client (@$client_table)
|
|
21 |
@@ -537,6 +538,8 @@
|
|
22 |
"debian-2.2" => "debian-2.2",
|
|
23 |
"debian-3.0" => "debian-2.2",
|
|
24 |
"debian-sarge" => "debian-2.2",
|
|
25 |
+ "nexenta-1.0" => "nexenta",
|
|
26 |
+ "solaris-2.11" => "solaris",
|
|
27 |
"suse-7.0" => "redhat-6.2",
|
|
28 |
"suse-9.0" => "suse-9.0",
|
|
29 |
"suse-9.1" => "suse-9.0",
|
|
30 |
@@ -608,6 +611,22 @@
|
|
31 |
[ "smbinstalled", \&gst_service_installed, "samba" ],
|
|
32 |
# FIXME: How's the nfs stuff in FreeBSD?
|
|
33 |
]},
|
|
34 |
+
|
|
35 |
+ "nexenta" => {
|
|
36 |
+ table => [
|
|
37 |
+ [ "smbuse", \&gst_service_sysv_get_status_any, "smbd", "nmbd" ],
|
|
38 |
+ [ "smbinstalled", \&gst_service_sysv_installed, "samba" ],
|
|
39 |
+ [ "nfsuse", \&gst_service_installed, "nfs/client" ],
|
|
40 |
+ [ "nfsinstalled", \&gst_service_installed, "nfs/server" ],
|
|
41 |
+ ]},
|
|
42 |
+
|
|
43 |
+ "solaris" => {
|
|
44 |
+ table => [
|
|
45 |
+ [ "smbuse", \&gst_service_sysv_get_status_any, "smbd", "nmbd" ],
|
|
46 |
+ [ "smbinstalled", \&gst_service_installed, "samba" ],
|
|
47 |
+ [ "nfsuse", \&gst_service_installed, "nfs/client" ],
|
|
48 |
+ [ "nfsinstalled", \&gst_service_installed, "nfs/server" ],
|
|
49 |
+ ]},
|
|
50 |
);
|
|
51 |
|
|
52 |
my $dist = $dist_map{$gst_dist};
|
|
53 |
@@ -647,8 +666,11 @@
|
|
54 |
%dist_attrib = &gst_network_get_parse_table ();
|
|
55 |
$smb_conf = $dist_attrib{"fn"}{"SMB_CONF"};
|
|
56 |
|
|
57 |
- # This is pretty standard
|
|
58 |
- $exports = "/etc/exports";
|
|
59 |
+ if ($$tool{"system"} eq "SunOS") {
|
|
60 |
+ $exports = "/etc/dfs/dfstab";
|
|
61 |
+ } else {
|
|
62 |
+ $exports = "/etc/exports";
|
|
63 |
+ }
|
|
64 |
|
|
65 |
return ($smb_conf, $exports);
|
|
66 |
}
|
|
67 |
@@ -771,7 +793,7 @@
|
|
68 |
foreach $i (keys %$ifaces)
|
|
69 |
{
|
|
70 |
if (($$ifaces{$i}{"enabled"} == 1)
|
|
71 |
- && ($$ifaces{$i}{"dev"} ne "lo"))
|
|
72 |
+ && !($$ifaces{$i}{"dev"} =~ /^lo[0-9]?/))
|
|
73 |
{
|
|
74 |
$$ifaces{$i}{"network"} = &gst_network_ipv4_calc_subnet ($$ifaces{$i}{"addr"},
|
|
75 |
$$ifaces{$i}{"mask"});
|
8027
|
76 |
|
|
77 |
diff -ru /usr/tmp/clean/system-tools-backends-1.4.2/share.pl.in system-tools-backends-1.4.2/share.pl.in
|
|
78 |
--- /usr/tmp/clean/system-tools-backends-1.4.2/share.pl.in 2005-02-25 14:15:34.000000000 +0000
|
|
79 |
+++ system-tools-backends-1.4.2/share.pl.in 2006-04-24 13:34:21.048581000 +0100
|
|
80 |
@@ -202,6 +202,16 @@
|
|
81 |
}
|
|
82 |
}
|
|
83 |
|
|
84 |
+sub gst_share_nfs_info_get_name
|
|
85 |
+{
|
|
86 |
+ return $_[0]->{'name'};
|
|
87 |
+}
|
|
88 |
+
|
|
89 |
+sub gst_share_nfs_info_set_name
|
|
90 |
+{
|
|
91 |
+ &gst_share_nfs_info_set ($_[0], 'name', $_[1]);
|
|
92 |
+}
|
|
93 |
+
|
|
94 |
sub gst_share_nfs_info_get_point
|
|
95 |
{
|
|
96 |
return $_[0]->{'point'};
|
|
97 |
@@ -397,6 +407,52 @@
|
|
98 |
return $table;
|
|
99 |
}
|
|
100 |
|
|
101 |
+sub gst_share_dfstab_list
|
|
102 |
+{
|
|
103 |
+ my ($file) = @_;
|
|
104 |
+ my $lnum = 0;
|
|
105 |
+ my @rv;
|
|
106 |
+
|
|
107 |
+ # dfstab example:
|
|
108 |
+ #
|
|
109 |
+ # share [-F fstype] [-o fs_options ] [-d description] [pathname [resourcename]]
|
|
110 |
+ # .e.g,
|
|
111 |
+ # share -F nfs -o rw=engineering -d "home dirs" /export/home2
|
|
112 |
+ my $fd = &gst_file_open_read_from_names ($file);
|
|
113 |
+ return @rv if !$fd;
|
|
114 |
+
|
|
115 |
+ while (<$fd>) {
|
|
116 |
+ s/\r|\n//g; s/#.*$//;
|
|
117 |
+ if (/^\s*\S*share\s+(.*)/) {
|
|
118 |
+ # Found a share line
|
|
119 |
+ my $share = { 'line' => $lnum,
|
|
120 |
+ 'index' => scalar(@rv) };
|
|
121 |
+ my $line = $1;
|
|
122 |
+ while($line =~ /\\$/) {
|
|
123 |
+ $_ = <$fd>;
|
|
124 |
+ s/\r|\n//g; s/#.*$//;
|
|
125 |
+ $line =~ s/\\$//;
|
|
126 |
+ $line .= $_;
|
|
127 |
+ $lnum++;
|
|
128 |
+ }
|
|
129 |
+ $share->{'eline'} = $lnum;
|
|
130 |
+ if ($line =~ /\s+(\/\S+)/ || $line =~ /\s+(\/)/ || $line eq "/") { $share->{'dir'} = $1; }
|
|
131 |
+ if ($line =~ /-d\s+"([^"]+)"/) { $share->{'desc'} = $1; }
|
|
132 |
+ elsif ($line =~ /-d\s+(\S+)/) { $share->{'desc'} = $1; }
|
|
133 |
+ if ($line =~ /-o\s+"([^"]+)"/) { $share->{'opts'} = $1; }
|
|
134 |
+ elsif ($line =~ /-o\s+(\S+)/) { $share->{'opts'} = $1; }
|
|
135 |
+ if ($line =~ /\s-F\s+(\S+)/) { $share->{'type'} = $1; }
|
|
136 |
+ else { $share->{'type'} = "nfs"; }
|
|
137 |
+ $share->{'desc'} =~ s/"//g; $share->{'desc'} =~ s/'//g;
|
|
138 |
+ push(@rv, $share);
|
|
139 |
+ }
|
|
140 |
+ $lnum++;
|
|
141 |
+ }
|
|
142 |
+ &gst_file_close ($fd);
|
|
143 |
+
|
|
144 |
+ return @rv;
|
|
145 |
+}
|
|
146 |
+
|
|
147 |
sub gst_share_parse_nfs_exports
|
|
148 |
{
|
|
149 |
my ($nfs_exports_name) = @_;
|
|
150 |
@@ -405,43 +461,87 @@
|
|
151 |
|
|
152 |
$table = &gst_share_nfs_table_new ();
|
|
153 |
|
|
154 |
- $entries = &gst_parse_split_hash_with_continuation ($nfs_exports_name, "[ \t]+", "[ \t]+");
|
|
155 |
+ if ($$tool{"system"} eq "SunOS") {
|
|
156 |
+ foreach $share (&gst_share_dfstab_list($nfs_exports_name)) {
|
|
157 |
+ if ($share->{'type'} eq "nfs") {
|
|
158 |
+ my $info = &gst_share_nfs_info_new ();
|
|
159 |
+ my $client_table = &gst_share_nfs_client_table_new ();
|
|
160 |
+
|
|
161 |
+ &gst_share_nfs_info_set_point ($info, $share->{'dir'});
|
|
162 |
+ &gst_share_nfs_info_set_name ($info, $share->{'desc'});
|
|
163 |
+
|
|
164 |
+ # Parse a mount options string like rw=foo,nosuid,...
|
|
165 |
+ # Parts with no value are given an empty string as the value
|
|
166 |
+ foreach my $opt (split(/,/, $share->{'opts'})) {
|
|
167 |
+ if ($opt =~ /^([^=]+)=(.*)$/) {
|
|
168 |
+ my $pattern;
|
|
169 |
+ my $access = $1;
|
|
170 |
+ my $client = $2;
|
|
171 |
+
|
12154
|
172 |
+ $client =~ /^([a-zA-Z0-9.\-:_*?@\/]+)/;
|
8027
|
173 |
+ $pattern = $1;
|
|
174 |
+ $pattern = "0.0.0.0/0" if $pattern eq "";
|
|
175 |
+ foreach my $host (split(/:/, $pattern)) {
|
|
176 |
+ my $cinfo = &gst_share_nfs_client_info_new ();
|
|
177 |
+ &gst_share_nfs_client_info_set_pattern ($cinfo, $host);
|
|
178 |
+
|
|
179 |
+ if ($access eq "rw") {
|
|
180 |
+ &gst_share_nfs_client_info_set_write ($cinfo, 1);
|
|
181 |
+ }
|
|
182 |
+
|
|
183 |
+ # ignore settings other than rw or ro, e.g. root
|
|
184 |
+ if ($access eq "rw" || $access eq "ro") {
|
|
185 |
+ &gst_share_nfs_client_table_add ($client_table, $cinfo);
|
|
186 |
+ }
|
|
187 |
+ }
|
|
188 |
+ } else {
|
|
189 |
+ $clients{$opt} = "";
|
|
190 |
+ }
|
|
191 |
+ }
|
|
192 |
|
|
193 |
- foreach $point (keys %$entries)
|
|
194 |
- {
|
|
195 |
- my $clients = $$entries{$point};
|
|
196 |
- my $info = &gst_share_nfs_info_new ();
|
|
197 |
- my $client_table = &gst_share_nfs_client_table_new ();
|
|
198 |
-
|
|
199 |
- &gst_share_nfs_info_set_point ($info, $point);
|
|
200 |
-
|
|
201 |
- foreach $client (@$clients)
|
|
202 |
+ &gst_share_nfs_info_set_client_table ($info, $client_table);
|
|
203 |
+ &gst_share_nfs_table_add ($table, $info);
|
|
204 |
+ }
|
|
205 |
+ }
|
|
206 |
+ } else {
|
|
207 |
+ $entries = &gst_parse_split_hash_with_continuation ($nfs_exports_name, "[ \t]+", "[ \t]+");
|
|
208 |
+
|
|
209 |
+ foreach $point (keys %$entries)
|
|
210 |
{
|
|
211 |
- my $cinfo = &gst_share_nfs_client_info_new ();
|
|
212 |
- my $pattern;
|
|
213 |
-
|
|
214 |
- $client =~ /^([a-zA-Z0-9.-_*?@\/]+)/;
|
|
215 |
- $pattern = $1;
|
|
216 |
- $pattern = "0.0.0.0/0" if $pattern eq "";
|
|
217 |
- &gst_share_nfs_client_info_set_pattern ($cinfo, $pattern);
|
|
218 |
-
|
|
219 |
- my $option_str = "";
|
|
220 |
- my @options;
|
|
221 |
-
|
|
222 |
- if ($client =~ /\((.+)\)/) { $option_str = $1; }
|
|
223 |
- @options = ($option_str =~ /([a-zA-Z0-9_=-]+),?/mg);
|
|
224 |
-
|
|
225 |
- for $option (@options)
|
|
226 |
+ my $clients = $$entries{$point};
|
|
227 |
+ my $info = &gst_share_nfs_info_new ();
|
|
228 |
+ my $client_table = &gst_share_nfs_client_table_new ();
|
|
229 |
+
|
|
230 |
+ &gst_share_nfs_info_set_point ($info, $point);
|
|
231 |
+
|
|
232 |
+ foreach $client (@$clients)
|
|
233 |
{
|
|
234 |
- if ($option eq "rw") { &gst_share_nfs_client_info_set_write ($cinfo, 1); }
|
|
235 |
- # Add supported NFS export options here. Some might have to be split on '='.
|
|
236 |
+ my $cinfo = &gst_share_nfs_client_info_new ();
|
|
237 |
+ my $pattern;
|
|
238 |
+
|
12154
|
239 |
+ $client =~ /^([a-zA-Z0-9.\-:_*?@\/]+)/;
|
8027
|
240 |
+ $pattern = $1;
|
|
241 |
+ $pattern = "0.0.0.0/0" if $pattern eq "";
|
|
242 |
+ &gst_share_nfs_client_info_set_pattern ($cinfo, $pattern);
|
|
243 |
+
|
|
244 |
+ my $option_str = "";
|
|
245 |
+ my @options;
|
|
246 |
+
|
|
247 |
+ if ($client =~ /\((.+)\)/) { $option_str = $1; }
|
|
248 |
+ @options = ($option_str =~ /([a-zA-Z0-9_=-]+),?/mg);
|
|
249 |
+
|
|
250 |
+ for $option (@options)
|
|
251 |
+ {
|
|
252 |
+ if ($option eq "rw") { &gst_share_nfs_client_info_set_write ($cinfo, 1); }
|
|
253 |
+ # Add supported NFS export options here. Some might have to be split on '='.
|
|
254 |
+ }
|
|
255 |
+
|
|
256 |
+ &gst_share_nfs_client_table_add ($client_table, $cinfo);
|
|
257 |
}
|
|
258 |
-
|
|
259 |
- &gst_share_nfs_client_table_add ($client_table, $cinfo);
|
|
260 |
+
|
|
261 |
+ &gst_share_nfs_info_set_client_table ($info, $client_table);
|
|
262 |
+ &gst_share_nfs_table_add ($table, $info);
|
|
263 |
}
|
|
264 |
-
|
|
265 |
- &gst_share_nfs_info_set_client_table ($info, $client_table);
|
|
266 |
- &gst_share_nfs_table_add ($table, $info);
|
|
267 |
}
|
|
268 |
|
|
269 |
return $table;
|
|
270 |
@@ -495,11 +595,27 @@
|
|
271 |
{
|
|
272 |
# Each line is in the following format:
|
|
273 |
# <point> <clients>
|
|
274 |
- my @line = split /[ \t]+/, $_;
|
|
275 |
- if ($line[0] eq "") { shift @line; }
|
|
276 |
- if (@line < 1 || &gst_ignore_line (@line)) { print $outfd $_; next; }
|
|
277 |
-
|
|
278 |
- return $_;
|
|
279 |
+ if ($$tool{"system"} eq "SunOS") {
|
|
280 |
+ if (&gst_ignore_line($_)) { print $outfd $_; next; }
|
|
281 |
+ if (/^\s*\S*share\s+(.*)/) {
|
|
282 |
+ my $point, $type;
|
|
283 |
+ my $line = $1;
|
|
284 |
+ while($line =~ /\\$/) {
|
|
285 |
+ $_ = <$infd>;
|
|
286 |
+ s/\r|\n//g; s/#.*$//;
|
|
287 |
+ $line =~ s/\\$//;
|
|
288 |
+ $line .= $_;
|
|
289 |
+ }
|
|
290 |
+ if ($line =~ /\s-F\s+(\S+)/) { $type = $1; }
|
|
291 |
+ else { $type = "nfs"; }
|
|
292 |
+ return "share $line\n" if ($type eq "nfs");
|
|
293 |
+ }
|
|
294 |
+ } else {
|
|
295 |
+ my @line = split /[ \t]+/, $_;
|
|
296 |
+ if ($line[0] eq "") { shift @line; }
|
|
297 |
+ if (@line < 1 || &gst_ignore_line (@line)) { print $outfd $_; next; }
|
|
298 |
+ return $_;
|
|
299 |
+ }
|
|
300 |
}
|
|
301 |
|
|
302 |
return undef;
|
|
303 |
@@ -526,11 +642,43 @@
|
|
304 |
|
|
305 |
$clients = &gst_share_nfs_info_get_client_table ($info);
|
|
306 |
|
|
307 |
- for $client (@$clients)
|
|
308 |
- {
|
|
309 |
- $line .= &gst_share_nfs_client_info_get_pattern ($client);
|
|
310 |
- $line .= "(rw)" if (&gst_share_nfs_client_info_get_write ($client));
|
|
311 |
- $line .= " ";
|
|
312 |
+ if ($$tool{"system"} eq "SunOS") {
|
|
313 |
+ my $nowrite = 1;
|
|
314 |
+ my $noread = 1;
|
|
315 |
+ for $client (@$clients)
|
|
316 |
+ {
|
|
317 |
+ if (&gst_share_nfs_client_info_get_write ($client)) {
|
|
318 |
+ if ($nowrite eq 1) {
|
|
319 |
+ $line .= "rw=";
|
|
320 |
+ $nowrite = 0;
|
|
321 |
+ } else {
|
|
322 |
+ $line .= ":";
|
|
323 |
+ }
|
|
324 |
+ $line .= &gst_share_nfs_client_info_get_pattern ($client);
|
|
325 |
+ }
|
|
326 |
+ }
|
|
327 |
+ for $client (@$clients)
|
|
328 |
+ {
|
|
329 |
+ if (!&gst_share_nfs_client_info_get_write ($client)) {
|
|
330 |
+ if ($noread eq 1) {
|
|
331 |
+ if ($nowrite eq 0) {
|
|
332 |
+ $line .= ",";
|
|
333 |
+ }
|
|
334 |
+ $line .= "ro=";
|
|
335 |
+ $noread = 0;
|
|
336 |
+ } else {
|
|
337 |
+ $line .= ":";
|
|
338 |
+ }
|
|
339 |
+ $line .= &gst_share_nfs_client_info_get_pattern ($client);
|
|
340 |
+ }
|
|
341 |
+ }
|
|
342 |
+ } else {
|
|
343 |
+ for $client (@$clients)
|
|
344 |
+ {
|
|
345 |
+ $line .= &gst_share_nfs_client_info_get_pattern ($client);
|
|
346 |
+ $line .= "(rw)" if (&gst_share_nfs_client_info_get_write ($client));
|
|
347 |
+ $line .= " ";
|
|
348 |
+ }
|
|
349 |
}
|
|
350 |
|
|
351 |
return $line;
|
|
352 |
@@ -541,13 +689,19 @@
|
|
353 |
my ($info) = @_;
|
|
354 |
my $line;
|
|
355 |
|
|
356 |
- # <point>
|
|
357 |
-
|
|
358 |
- $line = sprintf ("%-15s ", &gst_share_nfs_info_get_point ($info));
|
|
359 |
-
|
|
360 |
- # <clients>
|
|
361 |
-
|
|
362 |
- $line .= &gst_share_nfs_info_print_clients ($info);
|
|
363 |
+ if ($$tool{"system"} eq "SunOS") {
|
|
364 |
+ $line = "share -F nfs ";
|
|
365 |
+ $line .= sprintf ("-o %s ", &gst_share_nfs_info_print_clients ($info))
|
|
366 |
+ if (&gst_share_nfs_info_print_clients ($info));
|
|
367 |
+ $line .= sprintf ("-d %s ", &gst_share_nfs_info_get_name ($info))
|
|
368 |
+ if (&gst_share_nfs_info_get_name ($info));
|
|
369 |
+ $line .= sprintf ("%-15s ", &gst_share_nfs_info_get_point ($info));
|
|
370 |
+ } else {
|
|
371 |
+ # <point>
|
|
372 |
+ $line = sprintf ("%-15s ", &gst_share_nfs_info_get_point ($info));
|
|
373 |
+ # <clients>
|
|
374 |
+ $line .= &gst_share_nfs_info_print_clients ($info);
|
|
375 |
+ }
|
|
376 |
|
|
377 |
return $line;
|
|
378 |
}
|
|
379 |
@@ -583,66 +737,75 @@
|
|
380 |
my $outline;
|
|
381 |
my $ctable = &gst_share_nfs_info_get_client_table ($info);
|
|
382 |
|
|
383 |
- # <point>
|
|
384 |
-
|
|
385 |
- $outline = sprintf ("%-15s", &gst_share_nfs_info_get_point ($info));
|
|
386 |
-
|
|
387 |
- # <clients>
|
|
388 |
-
|
|
389 |
- chomp $line;
|
|
390 |
- my @clients = split /[ \t]+/, $line;
|
|
391 |
- shift @clients;
|
|
392 |
-
|
|
393 |
- # Make client hash based on line.
|
|
394 |
-
|
|
395 |
- my $chash = { };
|
|
396 |
-
|
|
397 |
- for $client (@clients)
|
|
398 |
- {
|
|
399 |
- my $opthash = { };
|
|
400 |
-
|
|
401 |
- $client =~ /^([a-zA-Z0-9.-_*?@\/]+)/;
|
|
402 |
- my $pattern = $1;
|
|
403 |
- $$chash{$pattern} = $opthash;
|
|
404 |
-
|
|
405 |
- my $option_str = "";
|
|
406 |
- if ($client =~ /\((.+)\)/) { $option_str = $1; }
|
|
407 |
- @options = ($option_str =~ /([a-zA-Z0-9_=-]+),?/mg);
|
|
408 |
-
|
|
409 |
- for $option (@options)
|
|
410 |
- {
|
|
411 |
- my ($key, $value) = split /[=]/, $option;
|
|
412 |
- next if ($key eq "");
|
|
413 |
-
|
|
414 |
- if ($value eq "" && $option =~ /=/) { $value = " "; }
|
|
415 |
- $$opthash{$key} = $value;
|
|
416 |
- }
|
|
417 |
- }
|
|
418 |
-
|
|
419 |
- # @clients contains client(options) entries.
|
|
420 |
-
|
|
421 |
- for $cinfo (@$ctable)
|
|
422 |
- {
|
|
423 |
- my $pattern = &gst_share_nfs_client_info_get_pattern ($cinfo);
|
|
424 |
- my $opthash = $$chash{$pattern};
|
|
425 |
-
|
|
426 |
- if (&gst_share_nfs_client_info_get_write ($cinfo))
|
|
427 |
- {
|
|
428 |
- $$opthash{'rw'} = "";
|
|
429 |
- }
|
|
430 |
- else
|
|
431 |
+ if ($$tool{"system"} eq "SunOS") {
|
|
432 |
+ my $desc = "unknown";
|
|
433 |
+ if ($line =~ /-d\s+"([^"]+)"/) { $desc = $1; }
|
|
434 |
+ elsif ($line =~ /-d\s+(\S+)/) { $desc = $1; }
|
|
435 |
+ $desc =~ s/"//g; $desc =~ s/'//g;
|
|
436 |
+ &gst_share_nfs_info_set_name ($info, $desc);
|
|
437 |
+ $outline = &gst_share_nfs_info_print_entry ($info);
|
|
438 |
+ } else {
|
|
439 |
+ # <point>
|
|
440 |
+
|
|
441 |
+ $outline = sprintf ("%-15s", &gst_share_nfs_info_get_point ($info));
|
|
442 |
+
|
|
443 |
+ # <clients>
|
|
444 |
+
|
|
445 |
+ chomp $line;
|
|
446 |
+ my @clients = split /[ \t]+/, $line;
|
|
447 |
+ shift @clients;
|
|
448 |
+
|
|
449 |
+ # Make client hash based on line.
|
|
450 |
+
|
|
451 |
+ my $chash = { };
|
|
452 |
+
|
|
453 |
+ for $client (@clients)
|
|
454 |
{
|
|
455 |
- delete $$opthash{'rw'};
|
|
456 |
+ my $opthash = { };
|
|
457 |
+
|
12154
|
458 |
+ $client =~ /^([a-zA-Z0-9.\-:_*?@\/]+)/;
|
8027
|
459 |
+ my $pattern = $1;
|
|
460 |
+ $$chash{$pattern} = $opthash;
|
|
461 |
+
|
|
462 |
+ my $option_str = "";
|
|
463 |
+ if ($client =~ /\((.+)\)/) { $option_str = $1; }
|
|
464 |
+ @options = ($option_str =~ /([a-zA-Z0-9_=-]+),?/mg);
|
|
465 |
+
|
|
466 |
+ for $option (@options)
|
|
467 |
+ {
|
|
468 |
+ my ($key, $value) = split /[=]/, $option;
|
|
469 |
+ next if ($key eq "");
|
|
470 |
+
|
|
471 |
+ if ($value eq "" && $option =~ /=/) { $value = " "; }
|
|
472 |
+ $$opthash{$key} = $value;
|
|
473 |
+ }
|
|
474 |
}
|
|
475 |
-
|
|
476 |
- $outline .= " " . &gst_share_nfs_client_info_get_pattern ($cinfo);
|
|
477 |
- my $client_string = &gst_share_nfs_client_print_option_hash ($opthash);
|
|
478 |
- if ($client_string ne "")
|
|
479 |
+
|
|
480 |
+ # @clients contains client(options) entries.
|
|
481 |
+
|
|
482 |
+ for $cinfo (@$ctable)
|
|
483 |
{
|
|
484 |
- $outline .= "(" . $client_string . ")";
|
|
485 |
+ my $pattern = &gst_share_nfs_client_info_get_pattern ($cinfo);
|
|
486 |
+ my $opthash = $$chash{$pattern};
|
|
487 |
+
|
|
488 |
+ if (&gst_share_nfs_client_info_get_write ($cinfo))
|
|
489 |
+ {
|
|
490 |
+ $$opthash{'rw'} = "";
|
|
491 |
+ }
|
|
492 |
+ else
|
|
493 |
+ {
|
|
494 |
+ delete $$opthash{'rw'};
|
|
495 |
+ }
|
|
496 |
+
|
|
497 |
+ $outline .= " " . &gst_share_nfs_client_info_get_pattern ($cinfo);
|
|
498 |
+ my $client_string = &gst_share_nfs_client_print_option_hash ($opthash);
|
|
499 |
+ if ($client_string ne "")
|
|
500 |
+ {
|
|
501 |
+ $outline .= "(" . $client_string . ")";
|
|
502 |
+ }
|
|
503 |
}
|
|
504 |
}
|
|
505 |
-
|
|
506 |
+
|
|
507 |
return $outline;
|
|
508 |
}
|
|
509 |
|
|
510 |
@@ -719,7 +882,11 @@
|
|
511 |
my ($line) = @_;
|
|
512 |
my $point;
|
|
513 |
|
|
514 |
- ($point) = split /[ \t]+/, $line;
|
|
515 |
+ if ($$tool{"system"} eq "SunOS") {
|
|
516 |
+ if ($line =~ /\s+(\/\S+)/ || $line =~ /\s+(\/)/ || $line eq "/") { $point = $1; }
|
|
517 |
+ } else {
|
|
518 |
+ ($point) = split /[ \t]+/, $line;
|
|
519 |
+ }
|
|
520 |
return $point;
|
|
521 |
}
|
|
522 |
|
|
523 |
@@ -752,6 +919,12 @@
|
|
524 |
&gst_share_nfs_exports_remove_entry ($file, $old_info);
|
|
525 |
}
|
|
526 |
}
|
|
527 |
+
|
|
528 |
+ if ($$tool{"system"} eq "SunOS") {
|
|
529 |
+ &gst_file_run ("svcadm enable nfs/server");
|
|
530 |
+ &gst_file_run ("unshareall");
|
|
531 |
+ &gst_file_run ("/bin/sh $file");
|
|
532 |
+ }
|
|
533 |
}
|
|
534 |
|
|
535 |
|