summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsamba_wizard/Sambashare.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/samba_wizard/Sambashare.pm b/samba_wizard/Sambashare.pm
index 90d968ed..a8c923c1 100755
--- a/samba_wizard/Sambashare.pm
+++ b/samba_wizard/Sambashare.pm
@@ -434,7 +434,9 @@ $o->{pages} = {
{ label => N("Name of the share:"), val => \$o->{var}{wiz_add_public_share_name} },
{ label => N("Comment:"), val => \$o->{var}{wiz_add_public_share_comment} },
{ label => N("Path:"), val => \$o->{var}{wiz_add_public_share_path} },
+ { label => N("Writable:"), val => \$o->{var}{wiz_add_public_share_writable}, fixed_list => \@yesorno },
{ label => N("Public:"), fixed_val => \$o->{var}{wiz_add_public_share_public} },
+
],
complete => sub {
foreach my $clef (keys %$samba) {
@@ -443,6 +445,9 @@ $o->{pages} = {
return 1;
}
}
+ if ($o->{var}{wiz_add_public_share_writable} eq 'yes') {
+ $::in->ask_okcancel(N("WARNING"), N("Be carrefull, you define your public share writable. This wizard will change permission to nobody.users, so do not use this feature on an home directory !")) or return 1;
+ }
if (!$o->{var}{wiz_add_public_share_path}) {
$::in->ask_warn(N("Error"), N("Can\'t create the directory, please enter a correct path.")) and return 1;
}
@@ -632,6 +637,7 @@ $o->{pages} = {
{ label => N("Comment:"), val => \$o->{var}{wiz_add_public_share_comment} },
{ label => N("Path:"), val => \$o->{var}{wiz_add_public_share_path} },
{ label => N("Public:"), fixed_val => \$o->{var}{wiz_add_public_share_public} },
+ { label => N("Writable:"), fixed_val => \$o->{var}{wiz_add_public_share_writable} },
],
post => \&do_it_add_public_share,
next => 'end_add_public_share',
@@ -880,11 +886,14 @@ sub do_it_add_public_share {
$samba->{$share};
$samba->{$share}{browseable} = $o->{var}{wiz_add_public_share_browseable};
$samba->{$share}{public} = $o->{var}{wiz_add_public_share_public};
- $samba->{$share}{path} = $o->{var}{wiz_add_public_share_createmode};
$samba->{$share}{'create mask'} = $o->{var}{wiz_add_public_share_createmask};
$samba->{$share}{'directory mask'} = $o->{var}{wiz_add_public_share_directorymask};
$samba->{$share}{comment} = $o->{var}{wiz_add_public_share_comment};
$samba->{$share}{path} = $o->{var}{wiz_add_public_share_path};
+ if ($o->{var}{wiz_add_public_share_writable} eq 'yes') {
+ $samba->{$share}{'writable'} = $o->{var}{wiz_add_public_share_writable};
+ system("chown -R nobody.users $o->{var}{wiz_add_public_share_path}");
+ }
write_conf_restart_smb();
undef $w;