mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-21 23:29:39 +00:00
Fixed validation of full (absolute) filename (#910)
* Fixed validation of full (absolute) filename * Added missing CR/LF in rasctl output
This commit is contained in:
parent
5a679509a1
commit
0c8d54f055
@ -114,11 +114,11 @@ Localizer::Localizer()
|
|||||||
Add(LocalizationKey::ERROR_SHUTDOWN_PERMISSION, "sv", "Saknar root-rättigheter för att kunna stänga av eller starta om systemet");
|
Add(LocalizationKey::ERROR_SHUTDOWN_PERMISSION, "sv", "Saknar root-rättigheter för att kunna stänga av eller starta om systemet");
|
||||||
Add(LocalizationKey::ERROR_SHUTDOWN_PERMISSION, "fr", "Permissions root manquantes pour extinction ou redémarrage");
|
Add(LocalizationKey::ERROR_SHUTDOWN_PERMISSION, "fr", "Permissions root manquantes pour extinction ou redémarrage");
|
||||||
Add(LocalizationKey::ERROR_SHUTDOWN_PERMISSION, "es", "Falta el permiso de root para el apagado o el reinicio");
|
Add(LocalizationKey::ERROR_SHUTDOWN_PERMISSION, "es", "Falta el permiso de root para el apagado o el reinicio");
|
||||||
Add(LocalizationKey::ERROR_FILE_OPEN, "en", "Invalid or non-existing file '%1': %2");
|
Add(LocalizationKey::ERROR_FILE_OPEN, "en", "Invalid or non-existing file '%1'");
|
||||||
Add(LocalizationKey::ERROR_FILE_OPEN, "de", "Ungültige oder fehlende Datei '%1': %2");
|
Add(LocalizationKey::ERROR_FILE_OPEN, "de", "Ungültige oder fehlende Datei '%1'");
|
||||||
Add(LocalizationKey::ERROR_FILE_OPEN, "sv", "Ogiltig eller saknad fil '%1': %2");
|
Add(LocalizationKey::ERROR_FILE_OPEN, "sv", "Ogiltig eller saknad fil '%1'");
|
||||||
Add(LocalizationKey::ERROR_FILE_OPEN, "fr", "Fichier invalide ou non-existant '%1': %2");
|
Add(LocalizationKey::ERROR_FILE_OPEN, "fr", "Fichier invalide ou non-existant '%1'");
|
||||||
Add(LocalizationKey::ERROR_FILE_OPEN, "es", "Archivo inválido o inexistente '%1': %2");
|
Add(LocalizationKey::ERROR_FILE_OPEN, "es", "Archivo inválido o inexistente '%1'");
|
||||||
Add(LocalizationKey::ERROR_BLOCK_SIZE, "en", "Invalid block size %1 bytes");
|
Add(LocalizationKey::ERROR_BLOCK_SIZE, "en", "Invalid block size %1 bytes");
|
||||||
Add(LocalizationKey::ERROR_BLOCK_SIZE, "de", "Ungültige Blockgröße %1 Bytes");
|
Add(LocalizationKey::ERROR_BLOCK_SIZE, "de", "Ungültige Blockgröße %1 Bytes");
|
||||||
Add(LocalizationKey::ERROR_BLOCK_SIZE, "sv", "Ogiltig blockstorlek: %1 byte");
|
Add(LocalizationKey::ERROR_BLOCK_SIZE, "sv", "Ogiltig blockstorlek: %1 byte");
|
||||||
|
@ -580,11 +580,13 @@ bool RascsiExecutor::ValidateImageFile(const CommandContext& context, shared_ptr
|
|||||||
to_string(id), to_string(lun));
|
to_string(id), to_string(lun));
|
||||||
}
|
}
|
||||||
|
|
||||||
disk->Open(filepath);
|
if (!disk->FileExists(filepath)) {
|
||||||
|
return context.ReturnLocalizedError(LocalizationKey::ERROR_FILE_OPEN, initial_filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const io_exception& e) {
|
catch(const io_exception& e) {
|
||||||
return context.ReturnLocalizedError(LocalizationKey::ERROR_FILE_OPEN, initial_filename, e.get_msg());
|
return context.ReturnLocalizedError(LocalizationKey::ERROR_FILE_OPEN, initial_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
full_path = filepath.GetPath();
|
full_path = filepath.GetPath();
|
||||||
|
@ -164,6 +164,8 @@ string RasctlDisplay::DisplayDeviceTypesInfo(const PbDeviceTypesInfo& device_typ
|
|||||||
DisplayBlockSizes(s, properties);
|
DisplayBlockSizes(s, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s << '\n';
|
||||||
|
|
||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user