summaryrefslogtreecommitdiffstats
path: root/samba_wizard/scripts
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-10-15 16:10:00 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-10-15 16:10:00 +0000
commit83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c (patch)
tree4c26d86f98f9c21e47cc27df98ab8ef90e280455 /samba_wizard/scripts
parent7c9035918b08c4f2e6960a9664dbdd4e40e45c6a (diff)
downloaddrakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.tar
drakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.tar.gz
drakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.tar.bz2
drakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.tar.xz
drakwizard-83eca6fa0dac3c5dbf68aff23d87ff5fca2e5a5c.zip
wiz update, nfs fixed
Diffstat (limited to 'samba_wizard/scripts')
-rwxr-xr-xsamba_wizard/scripts/Smbconf.pm53
-rw-r--r--samba_wizard/scripts/smb.conf.default10
2 files changed, 51 insertions, 12 deletions
diff --git a/samba_wizard/scripts/Smbconf.pm b/samba_wizard/scripts/Smbconf.pm
index ddf09ee9..1466caf0 100755
--- a/samba_wizard/scripts/Smbconf.pm
+++ b/samba_wizard/scripts/Smbconf.pm
@@ -5,7 +5,7 @@ require "__WIZ_HOME__/common/scripts/Vareqval.pm";
require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm";
use MDK::Common;
use strict;
-
+use Data::Dumper;
# All possibilies in the config file must be precedeed by ";"
# This script can just comment, uncomment or/and change values
# but can not add anything.
@@ -20,8 +20,9 @@ sub check {
}
sub check_services {
- $ENV{wiz_do_homes} and return 2;
- $ENV{wiz_do_file_sharing} and return 1;
+ $ENV{wiz_do_homes} and return 3;
+ $ENV{wiz_do_file_sharing} and return 2;
+ $ENV{wiz_do_printer_sharing} and return 1;
0;
}
@@ -73,6 +74,22 @@ sub write_conf {
}
}
}
+
+sub list_printers {
+ my $file = "/etc/printcap";
+ my $i;
+
+ sort grep /^(?!\#).*/, map {
+ my @toto = split(':', $_);
+ $i++;
+ $toto[0];
+ } cat_($file);
+}
+
+sub check_users {
+ return 1 if $ENV{wiz_do_printer_sharing};
+ 0;
+}
sub comment_menu {
my $self = shift;
@@ -120,17 +137,35 @@ sub printer_sharing {
}
sub check_workgroup {
- !$ENV{workgroup} and return 1;
+ !$ENV{wiz_workgroup} and return 1;
10;
}
-sub check_banner {
- !$ENV{banner} and return 1;
+sub ask_acces {
10;
}
+sub check_printers {
+ foreach (keys %::bool) {
+ print "$::bool{$_}\n";
+ }
+}
+
my $old = read_conf("/etc/samba/smb.conf");
+sub get_write {
+ $old->{conf}->{public}{"write list"}{value};
+}
+
+sub get_read {
+ $old->{conf}->{public}{"read list"}{value};
+}
+
+sub check_banner {
+ !$ENV{wiz_banner} and return 1;
+ 10;
+}
+
sub get_workgroup {
$old->{conf}->{global}{workgroup}{value};
}
@@ -140,7 +175,9 @@ sub get_banner {
}
sub ask_dir {
- $ENV{wiz_do_file_sharing};
+ return 2 if $ENV{wiz_do_file_sharing};
+ return 1 if $ENV{wiz_do_printer_sharing};
+ 0;
}
sub get_dir {
@@ -152,6 +189,8 @@ sub do_it {
my $conf = read_conf("__WIZ_HOME__/samba_wizard/scripts/smb.conf.default");
$conf->chg_var("global", "workgroup", $ENV{wiz_workgroup});
$conf->chg_var("global", "server string", $ENV{wiz_banner});
+ $conf->chg_var("public", "write list", $ENV{wiz_write_list}) if $ENV{wiz_do_file_sharing};
+ $conf->chg_var("public", "read list", $ENV{wiz_read_list}) if $ENV{wiz_do_file_sharing};
my $ip = $o->get_from_known_dev("IP");
$conf->file_sharing() if $ENV{wiz_do_file_sharing};
$conf->printer_sharing() if $ENV{wiz_do_printer_sharing};
diff --git a/samba_wizard/scripts/smb.conf.default b/samba_wizard/scripts/smb.conf.default
index 8781db7e..a6012972 100644
--- a/samba_wizard/scripts/smb.conf.default
+++ b/samba_wizard/scripts/smb.conf.default
@@ -305,14 +305,14 @@
; read only = no
; public = yes
-# A publicly accessible directory, but read only, except for people in
-# the "staff" group
+# A publicly accessible directory
+
;[public]
; comment = Public Stuff
; path = /home/samba/public
-; public = yes
-; writable = no
-; write list = @staff
+; write list = @wheel
+; read list = nobody, @users
+; guest ok = no
# Other examples.
#