mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-13 19:19:03 +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
|
||||
BlacklistPlugins=test
|
||||
|
||||
# Maximum archive size that can be loaded, in Mb
|
||||
ArchiveSizeMax=512
|
||||
# Maximum archive size that can be loaded in Mb, with 0 for the default
|
||||
ArchiveSizeMax=0
|
||||
|
@ -279,6 +279,7 @@ gboolean
|
||||
fu_config_load (FuConfig *self, GError **error)
|
||||
{
|
||||
GFileMonitor *monitor;
|
||||
guint64 archive_size_max;
|
||||
g_autofree gchar *config_file = NULL;
|
||||
g_auto(GStrv) devices = 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 */
|
||||
self->archive_size_max = g_key_file_get_uint64 (self->keyfile,
|
||||
"fwupd",
|
||||
"ArchiveSizeMax",
|
||||
NULL);
|
||||
self->archive_size_max *= 0x100000;
|
||||
archive_size_max = g_key_file_get_uint64 (self->keyfile,
|
||||
"fwupd",
|
||||
"ArchiveSizeMax",
|
||||
NULL);
|
||||
if (archive_size_max > 0)
|
||||
self->archive_size_max = archive_size_max *= 0x100000;
|
||||
|
||||
/* load remotes */
|
||||
if (!fu_config_load_remotes (self, error))
|
||||
|
Loading…
Reference in New Issue
Block a user