mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
limit icon size to 100K
This commit is contained in:
committed by
Aiden McClelland
parent
1d97856922
commit
f57f7022a1
@@ -136,6 +136,13 @@ impl<R: AsyncRead + AsyncSeek + Unpin> S9pkReader<InstallProgressTracker<R>> {
|
|||||||
impl<R: AsyncRead + AsyncSeek + Unpin> S9pkReader<R> {
|
impl<R: AsyncRead + AsyncSeek + Unpin> S9pkReader<R> {
|
||||||
#[instrument(skip(self))]
|
#[instrument(skip(self))]
|
||||||
pub async fn validate(&mut self) -> Result<(), Error> {
|
pub async fn validate(&mut self) -> Result<(), Error> {
|
||||||
|
if self.toc.icon.length > 102_400 {
|
||||||
|
// 100 KiB
|
||||||
|
return Err(Error::new(
|
||||||
|
eyre!("icon must be less than 100KiB"),
|
||||||
|
crate::ErrorKind::ValidateS9pk,
|
||||||
|
));
|
||||||
|
}
|
||||||
let image_tags = self.image_tags().await?;
|
let image_tags = self.image_tags().await?;
|
||||||
let man = self.manifest().await?;
|
let man = self.manifest().await?;
|
||||||
let validated_image_ids = image_tags
|
let validated_image_ids = image_tags
|
||||||
|
|||||||
Reference in New Issue
Block a user