mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-11-22 07:15:22 +00:00
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:
+2
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user