mirror of https://gitee.com/openkylin/gvfs.git
Nuke the metadata file if magic blob is wrong
Gbp-Pq: Name metadata-nuke-junk-data.patch
This commit is contained in:
parent
079ac3cdf9
commit
70353a1032
|
@ -451,7 +451,15 @@ meta_tree_init (MetaTree *tree)
|
|||
if (memcmp (tree->header->magic, MAGIC, MAGIC_LEN) != 0)
|
||||
{
|
||||
g_warning ("can't init metadata tree %s: wrong magic", tree->filename);
|
||||
goto err;
|
||||
if (!tree->for_write)
|
||||
goto err;
|
||||
|
||||
meta_tree_clear (tree);
|
||||
|
||||
if (g_unlink (tree->filename) != 0)
|
||||
goto err;
|
||||
|
||||
goto retry;
|
||||
}
|
||||
|
||||
if (tree->header->major != MAJOR_VERSION)
|
||||
|
|
Loading…
Reference in New Issue