Only create deltas between two regular files

For three different Clear Linux OS builds in the last few months, deltas
were created between files with type change L->F (symlink to file).
This was allowed to occur because there is no check if
file->peer->is_link in __create_delta().

Instead, remove the file->is_link check and simply ensure that the
from/to file types are both F (i.e. "regular file").

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2017-04-04 11:45:43 -07:00
committed by tmarcu
parent a9f13e939c
commit 9c1a4a3542
+2 -2
View File
@@ -40,8 +40,8 @@ void __create_delta(struct file *file, int from_version, char *from_hash)
char *original, *newfile, *outfile, *dotfile, *testnewfile, *conf;
int ret;
if (file->is_link) {
return;
if (!file->is_file || !file->peer->is_file) {
return; /* only support deltas between two regular files right now */
}
if (file->is_deleted) {