smeserver-phpvirtualbox/smeserver-phpvirtualbox-5.2.1-samba_share.patch

81 lines
3.7 KiB
Diff
Raw Permalink Normal View History

diff -urN smeserver-phpvirtualbox-5.2.1.old/root/etc/e-smith/db/configuration/defaults/phpvirtualbox/samba smeserver-phpvirtualbox-5.2.1/root/etc/e-smith/db/configuration/defaults/phpvirtualbox/samba
--- smeserver-phpvirtualbox-5.2.1.old/root/etc/e-smith/db/configuration/defaults/phpvirtualbox/samba 1970-01-01 10:00:00.000000000 +1000
+++ smeserver-phpvirtualbox-5.2.1/root/etc/e-smith/db/configuration/defaults/phpvirtualbox/samba 2023-03-19 14:38:18.000000000 +1100
@@ -0,0 +1 @@
+all
\ No newline at end of file
diff -urN smeserver-phpvirtualbox-5.2.1.old/root/etc/e-smith/templates/etc/smb.conf/60phpvirtualbox smeserver-phpvirtualbox-5.2.1/root/etc/e-smith/templates/etc/smb.conf/60phpvirtualbox
--- smeserver-phpvirtualbox-5.2.1.old/root/etc/e-smith/templates/etc/smb.conf/60phpvirtualbox 2023-03-19 14:43:29.380771500 +1100
+++ smeserver-phpvirtualbox-5.2.1/root/etc/e-smith/templates/etc/smb.conf/60phpvirtualbox 2023-03-19 14:37:11.000000000 +1100
@@ -1,14 +1,36 @@
{
+ if ($phpvirtualbox{'status'} ne 'enabled') {
+ return;
+ }
+ my $samba = ($phpvirtualbox{'samba'} || 'all');
+ if ($samba ne 'all' && $samba ne 'adminUser') {
+ return;
+ }
my $validusers = '';
- if ($phpvirtualbox{'adminUser'} || $phpvirtualbox{'userGroups'}) {
+ my @phpvboxusers = split(",", ($phpvirtualbox{'Users'} || "") );
+ my @phpvboxgroups = split(",", ($phpvirtualbox{'userGroups'} || "") );
+ if ($samba eq 'all' || $samba eq 'adminUser') {
if ($phpvirtualbox{'adminUser'}) {
$validusers = "$phpvirtualbox{'adminUser'}";
- if ($phpvirtualbox{'userGroups'}) {
- $validusers .= ",+$phpvirtualbox{'userGroups'}";
+ }
+ }
+ if ($samba eq 'all') {
+ if ($phpvirtualbox{'Users'}) {
+ foreach my $user (@phpvboxusers) {
+ if ($validusers) {
+ $validusers .= ",$user";
+ } else {
+ $validusers = "$user";
+ }
}
- } else {
- if ($phpvirtualbox{'userGroups'}) {
- $validusers = "+$phpvirtualbox{'userGroups'}";
+ }
+ if ($phpvirtualbox{'userGroups'}) {
+ foreach my $group (@phpvboxgroups) {
+ if ($validusers) {
+ $validusers .= ",\@$group";
+ } else {
+ $validusers = "\@$group";
+ }
}
}
}
@@ -22,7 +44,7 @@
writable = yes
printable = no
inherit permissions = yes
-create mode = 0640
+create mode = 0777
_VBOX
@@ -30,4 +52,4 @@
$OUT .= "valid users = $validusers\n";
}
-}
\ No newline at end of file
+}
diff -urN smeserver-phpvirtualbox-5.2.1.old/root/etc/e-smith/templates/opt/phpvirtualbox/config.php/config.php smeserver-phpvirtualbox-5.2.1/root/etc/e-smith/templates/opt/phpvirtualbox/config.php/config.php
--- smeserver-phpvirtualbox-5.2.1.old/root/etc/e-smith/templates/opt/phpvirtualbox/config.php/config.php 2023-03-19 14:43:29.380771500 +1100
+++ smeserver-phpvirtualbox-5.2.1/root/etc/e-smith/templates/opt/phpvirtualbox/config.php/config.php 2023-03-19 14:37:53.000000000 +1100
@@ -78,7 +78,7 @@
# allow inclusion of any generic parameter stored in config db for phpvirtualbox
$OUT .= "# additional parameters defined in configuration DB\n";
- my @stdparms = qw(type status Name Users userGroups adminUser adminGroup authtype language vrdeports maxProgressList deleteOnRemove browserRestrictFiles browserRestrictFolders consolresolutions hostMemInfoRefreshInterval consoleKeyboardLayout nicMax);
+ my @stdparms = qw(type status Name samba Users userGroups adminUser adminGroup authtype language vrdeports maxProgressList deleteOnRemove browserRestrictFiles browserRestrictFolders consolresolutions hostMemInfoRefreshInterval consoleKeyboardLayout nicMax);
while (my ($param, $value) = each (%phpvirtualbox)) {
next if ( $param ~~ @stdparms );
$OUT .= "var \$$param = $value;\n";