All pastes #576606 Raw Edit

rcaskey

public text v1 · immutable
·published 2007-06-19 15:28 UTC
rendered paste body
? system_shares.diffIndex: SMBConfig.pm===================================================================RCS file: /cvs/system-tools-backends/system-tools-backends/SMBConfig.pm,vretrieving revision 1.3diff -u -r1.3 SMBConfig.pm--- SMBConfig.pm	27 Nov 2006 16:36:33 -0000	1.3+++ SMBConfig.pm	19 Jun 2007 15:28:23 -0000@@ -28,8 +28,8 @@  my $OBJECT_NAME = "SMBConfig"; my $OBJECT_PATH = "$Utils::Backend::DBUS_PATH/$OBJECT_NAME";-my $format = [[ "array", [ "struct", "string", "string", "string", "int32", "int32", "int32", "int32" ]],-              "string", "string", "int32", "string" ];+my $share_format = [ "struct", "string", "string", "string", "int32", "int32", "int32", "int32" ];+my $format = [["array", $share_format], "string", "string", "int32", "string", ["array", $share_format]];  sub new {Index: Shares/SMB.pm===================================================================RCS file: /cvs/system-tools-backends/system-tools-backends/Shares/SMB.pm,vretrieving revision 1.6diff -u -r1.6 SMB.pm--- Shares/SMB.pm	4 Jan 2007 17:50:09 -0000	1.6+++ Shares/SMB.pm	19 Jun 2007 15:28:23 -0000@@ -198,6 +198,26 @@   &Utils::Replace::remove_ini_var ($smb_conf_file, $section, "writeable"); } +sub get_system_shares+{+  my ($smb_conf_file) = @_;+  my (@sections, @table, $share);++  # Get the sections.+  @sections = &Utils::Parse::get_ini_sections ($smb_conf_file);++  for $section (@sections)+  {+    next if ($section !~ /^(global)|(homes)|(printers)|(print\$)$/);+    next if (&Utils::Parse::get_from_ini_bool ($smb_conf_file, $section, "printable"));++    $share = &get_share_info ($smb_conf_file, $section);+    push @table, $share;+  }++  return \@table;+}+ sub get_shares {   my ($smb_conf_file) = @_;@@ -221,17 +241,18 @@ sub get {   my ($smb_conf_file);-  my ($shares, $workgroup, $desc, $wins, $winsserver);+  my ($shares, $workgroup, $desc, $wins, $winsserver, $system_shares);    $smb_conf_file = &get_distro_smb_file;   $shares = &get_shares ($smb_conf_file);+  $system_shares = &get_system_shares ($smb_conf_file);      $workgroup = &Utils::Parse::get_from_ini ($smb_conf_file, "global", "workgroup");   $smbdesc = &Utils::Parse::get_from_ini ($smb_conf_file, "global", "server string");   $wins = &Utils::Parse::get_from_ini_bool ($smb_conf_file, "global", "wins support");   $winsserver = &Utils::Parse::get_from_ini ($smb_conf_file, "global", "wins server"); -  return ($shares, $workgroup, $smbdesc, $wins, $winsserver);+  return ($shares, $workgroup, $smbdesc, $wins, $winsserver, $system_shares); }  sub set_shares