summaryrefslogtreecommitdiffstats
path: root/samba_wizard
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2005-08-22 20:01:51 +0000
committerAntoine Ginies <aginies@mandriva.com>2005-08-22 20:01:51 +0000
commitc672af5d2e7390c1b5a6a46d60b0da96fcf9c53b (patch)
treec71564abec532d82070b2f7bcbd98262c7a9ac94 /samba_wizard
parentf29685505ed6363d615a7382ca0b559ab8f180b9 (diff)
downloaddrakwizard-c672af5d2e7390c1b5a6a46d60b0da96fcf9c53b.tar
drakwizard-c672af5d2e7390c1b5a6a46d60b0da96fcf9c53b.tar.gz
drakwizard-c672af5d2e7390c1b5a6a46d60b0da96fcf9c53b.tar.bz2
drakwizard-c672af5d2e7390c1b5a6a46d60b0da96fcf9c53b.tar.xz
drakwizard-c672af5d2e7390c1b5a6a46d60b0da96fcf9c53b.zip
add read/write list (user share)
Diffstat (limited to 'samba_wizard')
-rwxr-xr-xsamba_wizard/Sambashare.pm25
1 files changed, 16 insertions, 9 deletions
diff --git a/samba_wizard/Sambashare.pm b/samba_wizard/Sambashare.pm
index d3ca3108..833afa89 100755
--- a/samba_wizard/Sambashare.pm
+++ b/samba_wizard/Sambashare.pm
@@ -360,7 +360,8 @@ $o->{pages} = {
{ label => N("Name of the share:"), val => \$o->{var}{wiz_add_user_share_name} },
{ label => N("Comment:"), val => \$o->{var}{wiz_add_user_share_comment} },
{ label => N("Path:"), val => \$o->{var}{wiz_add_user_share_path} },
- { label => N("Public:"), fixed_val => \$o->{var}{wiz_add_user_share_public} },
+ { label => N("Write list:"), val => \$o->{var}{wiz_add_user_share_writelist} },
+ { label => N("Read list:"), val => \$o->{var}{wiz_add_user_share_readlist} },
],
complete => sub {
foreach my $clef (keys %$samba) {
@@ -379,11 +380,19 @@ $o->{pages} = {
mkdir_p($o->{var}{wiz_add_user_share_path}) or $::in->ask_warn(N("Error"), N("Can\'t create the directory, please enter a correct path."));
return 1;
} else { return 0 }
+ map { my @users = split(" ", $_);
+ foreach my $user (@users) {
+ if ($user and !any { /^$user:/ } cat_("/etc/passwd")) {
+ $::in->ask_warn(N("Error"), N("Please provide a system user, %s not present.", $user));
+ return 1; $_;
+ }
+ }
+ } $o->{var}{wiz_add_user_share_writelist}, $o->{var}{wiz_add_user_share_readlist};
},
next => 'summary_add_user_share',
},
add_public_share => {
- name => N("Add a public share") . "\n" . N("Comment: description of the share") . "\n",
+ name => N("Add a public share"),
pre => sub {
$o->{var}{wiz_add_public_share_browseable} = "yes";
$o->{var}{wiz_add_public_share_public} = "yes";
@@ -567,10 +576,10 @@ $o->{pages} = {
pre => sub {
},
data => [
- { label => N("Name of the share:"), val => \$o->{var}{wiz_add_user_share_name} },
- { label => N("Comment:"), val => \$o->{var}{wiz_add_user_share_comment} },
- { label => N("Path:"), val => \$o->{var}{wiz_add_user_share_path} },
- { label => N("Public:"), fixed_val => \$o->{var}{wiz_add_user_share_public} },
+ { label => N("Name of the share:"), fixed_val => \$o->{var}{wiz_add_user_share_name} },
+ { label => N("Comment:"), fixed_val => \$o->{var}{wiz_add_user_share_comment} },
+ { label => N("Path:"), fixed_val => \$o->{var}{wiz_add_user_share_path} },
+ { label => N("Write list:"), fixed_val => \$o->{var}{wiz_add_user_share_writelist} },
],
post => \&do_it_add_user_share,
next => 'end_add_user_share',
@@ -844,9 +853,7 @@ sub do_it_add_user_share {
$samba->{$share}{path} = $o->{var}{wiz_add_user_share_path};
$samba->{$share}{'write list'} = $o->{var}{wiz_add_user_share_writelist};
- if ($o->{var}{wiz_owner}) {
- system("chown -R $o->{var}{wiz_add_user_share_writelist}.users $o->{var}{wiz_add_user_share_path}");
- }
+ system("chown -R $o->{var}{wiz_add_user_share_writelist}.users $o->{var}{wiz_add_user_share_path}");
create_smbuser($o->{var}{wiz_add_user_share_writelist});
write_conf_restart_smb();