mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 12:35:57 +00:00
Use the default value if ArchiveSizeMax is unspecified in daemon.conf
Fixes: https://github.com/hughsie/fwupd/issues/405
This commit is contained in:
parent
919f8ab910
commit
321f77a07f
@ -8,5 +8,5 @@ BlacklistDevices=
|
|||||||
# Uses semicolons as delimiter
|
# Uses semicolons as delimiter
|
||||||
BlacklistPlugins=test
|
BlacklistPlugins=test
|
||||||
|
|
||||||
# Maximum archive size that can be loaded, in Mb
|
# Maximum archive size that can be loaded in Mb, with 0 for the default
|
||||||
ArchiveSizeMax=512
|
ArchiveSizeMax=0
|
||||||
|
@ -279,6 +279,7 @@ gboolean
|
|||||||
fu_config_load (FuConfig *self, GError **error)
|
fu_config_load (FuConfig *self, GError **error)
|
||||||
{
|
{
|
||||||
GFileMonitor *monitor;
|
GFileMonitor *monitor;
|
||||||
|
guint64 archive_size_max;
|
||||||
g_autofree gchar *config_file = NULL;
|
g_autofree gchar *config_file = NULL;
|
||||||
g_auto(GStrv) devices = NULL;
|
g_auto(GStrv) devices = NULL;
|
||||||
g_auto(GStrv) plugins = NULL;
|
g_auto(GStrv) plugins = NULL;
|
||||||
@ -335,11 +336,12 @@ fu_config_load (FuConfig *self, GError **error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get maximum archive size, defaulting to something sane */
|
/* get maximum archive size, defaulting to something sane */
|
||||||
self->archive_size_max = g_key_file_get_uint64 (self->keyfile,
|
archive_size_max = g_key_file_get_uint64 (self->keyfile,
|
||||||
"fwupd",
|
"fwupd",
|
||||||
"ArchiveSizeMax",
|
"ArchiveSizeMax",
|
||||||
NULL);
|
NULL);
|
||||||
self->archive_size_max *= 0x100000;
|
if (archive_size_max > 0)
|
||||||
|
self->archive_size_max = archive_size_max *= 0x100000;
|
||||||
|
|
||||||
/* load remotes */
|
/* load remotes */
|
||||||
if (!fu_config_load_remotes (self, error))
|
if (!fu_config_load_remotes (self, error))
|
||||||
|
Loading…
Reference in New Issue
Block a user