validation fixed
"cryptsetup remove" fixed
This commit is contained in:
parent
546ce6e73c
commit
831849b93f
2 changed files with 9 additions and 9 deletions
|
@ -209,7 +209,7 @@ function mount_crypto()
|
|||
$CRYPTSETUP -h "$HASH" -c "$ALGO" create "`basename $CRYPTMAPPER_DEV`" "${device}2"
|
||||
if mount "$CRYPTMAPPER_DEV" "$CRYPTO_DIR"
|
||||
then /etc/init.d/samba start
|
||||
else dmsetup remove "$CRYPTMAPPER_DEV"
|
||||
else dmsetup remove $(basename $CRYPTMAPPER_DEV)
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ function umount_crypto()
|
|||
ps -e | grep -q " smbd$" && killall -9 smbd
|
||||
ps -e | grep -q " nmbd$" && killall -9 nmbd
|
||||
umount "$CRYPTO_DIR"
|
||||
$CRYPTSETUP remove "$CRYPTMAPPER_DEV"
|
||||
$CRYPTSETUP remove $(basename $CRYPTMAPPER_DEV)
|
||||
set -e
|
||||
}
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ sub validate_language()
|
|||
{
|
||||
my $language = shift;
|
||||
# check for non-alphanumeric character
|
||||
return 0 if ($language = ~/\W/);
|
||||
return 0 if ($language =~ /\W/);
|
||||
return 0 if ( ! -e "$LANGUAGE_DIR/$language" . '.hdf');
|
||||
return 1;
|
||||
}
|
||||
|
@ -385,15 +385,15 @@ if ( ! &check_ssl()) {
|
|||
$pagedata->setValue('Data.Warning', 'NotConfigured');
|
||||
$pagedata->setValue('Data.Action', 'init_form');
|
||||
} else {
|
||||
if ( ! &validate_language()) {
|
||||
if ( ! &validate_language($query->param('language'))) {
|
||||
$pagedata->setValue('Data.Warning', 'InvalidLanguage');
|
||||
$pagedata->setValue('Data.Action', 'config_ask');
|
||||
} elsif ( ! &validate_ip()) {
|
||||
$pagedata->setValue('Data.Action', 'config_form');
|
||||
} elsif ( ! &validate_ip($query->param('ip'))) {
|
||||
$pagedata->setValue('Data.Warning', 'InvalidIP');
|
||||
$pagedata->setValue('Data.Action', 'config_ask');
|
||||
} elsif ( ! &validate_timeout()) {
|
||||
$pagedata->setValue('Data.Action', 'config_form');
|
||||
} elsif ( ! &validate_timeout($query->param('timeout'))) {
|
||||
$pagedata->setValue('Data.Warning', 'InvalidTimeOut');
|
||||
$pagedata->setValue('Data.Action', 'config_ask');
|
||||
$pagedata->setValue('Data.Action', 'config_form');
|
||||
} else {
|
||||
system("$CB_SCRIPT", "set_config", "language", $query->param('language'));
|
||||
system("$CB_SCRIPT", "set_config", "timeout", $query->param('timeout'));
|
||||
|
|
Loading…
Add table
Reference in a new issue