Merge branch 'master' into dist/eole/2.8.0/master

This commit is contained in:
Benjamin Bohard 2021-06-18 09:06:29 +02:00
commit 7a771386c8
2 changed files with 32 additions and 5 deletions

View File

@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<creole>
<files>
<service_access service='smbd'>
<port>139</port>
<port>445</port>
</service_access>
<service_restriction service='smbd'>
<ip interface='auto' netmask='smb_share_allowed_netmask' netmask_type='SymLinkOption' ip_type='SymLinkOption'>smb_share_allowed_network</ip>
</service_restriction>
</files>
<containers>
<container name='partage' id='52'>
@ -11,20 +19,27 @@
</containers>
<variables>
<family name='Partages smb'>
<variable name='use_smb_share' type='oui/non' description='Configurer des répertoires partagés' mode='expert'>
<variable name='use_smb_share' type='oui/non' description='Configurer des répertoires partagés' mode='normal'>
<value>non</value>
</variable>
<variable name='smb_share_name' type='string' description='Nom du répertoire partagé' mandatory='True' mode='expert' multi='True'/>
<variable name='smb_share_path' type='string' description='Chemin du partage' mandatory='True' mode='expert'/>
<variable name='smb_share_path' type='string' description='Chemin du partage' mandatory='True' mode='normal'/>
<variable name='smb_share_name' type='string' description='Nom du répertoire partagé' mandatory='True' mode='normal' multi='True'/>
<variable name='smb_share_allowed_network' type='network' description='Adresses autorisées à se connecter aux partages' mode='normal' multi='True' mandatory='True'/>
<variable name='smb_share_allowed_network' type='netmask' description='Masque de sous-réseau des réseaux autorisés à se connecter aux partages' mode='normal' mandatory='True'/>
</family>
</variables>
<constraints>
<group master='smb_share_name'>
<slave>smb_share_path</slave>
<group master='smb_share_path'>
<slave>smb_share_name</slave>
</group>
<group master='smb_share_allowed_network'>
<slave>smb_share_allowed_netmask</slave>
</group>
<condition name='disabled_if_in' source='use_smb_share' fallback='True'>
<param>non</param>
<target type='variable'>smb_share_name</target>
<target type='variable'>smb_share_allowed_network</target>
<target type='variable'>smb_share_allowed_netmask</target>
<target type='filelist'>smb_share</target>
</condition>
</constraints>

12
posttemplate/02-smb_partages Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# partages multiples
if [ "$(CreoleGet use_smb_share non)" = "oui" ]; then
for path in $(CreoleGet smb_share_path); do
if [ ! -d $path ]; then
/bin/mkdir -p $path
chmod g+ws $path
fi
done
fi
exit 0