repo: make index and index-meta dicts immutable.

For clients that want to modify its content they will need to copy a mutable
dictionary instead. This will avoid unwanted modifications.
This commit is contained in:
Juan RP 2015-05-22 12:19:48 +02:00
parent 5e97a1eb39
commit 4fdc8de9d6

View File

@ -154,9 +154,12 @@ repo_open_local(struct xbps_repo *repo, const char *repofile)
(void)unlink(repofile); (void)unlink(repofile);
return false; return false;
} }
xbps_dictionary_make_immutable(repo->idx);
repo->idxmeta = repo_get_dict(repo); repo->idxmeta = repo_get_dict(repo);
if (repo->idxmeta != NULL) if (repo->idxmeta != NULL) {
repo->is_signed = true; repo->is_signed = true;
xbps_dictionary_make_immutable(repo->idxmeta);
}
return true; return true;
} }