Skip to content

Commit 5fb2574

Browse files
adclearedstevegrubb
authored andcommitted
Minimal change to allow benign dpkg errors
1 parent dd5d928 commit 5fb2574

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/library/deb-backend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int do_deb_load_list(const conf_t *conf)
168168
: namenode->name;
169169
if (hash != NULL) {
170170
if (add_file_to_backend_by_md5(path, hash, hashtable_ptr, SRC_DEB,
171-
&deb_backend) != 0) {
171+
&deb_backend) < 0) {
172172
rc = 1;
173173
goto out;
174174
}

src/library/md5-backend.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
* While MD5 is considered broken, this is still some effort.
5454
* This function would compute a sha256 and file size on the attackers
5555
* crafted file so they do not secure this backend.
56+
*
57+
* Returns 0 when the file was added, 1 when the file was skipped
58+
* (benign per-file condition), and -1 on a fatal error that leaves
59+
* the backend snapshot unusable.
5660
*/
5761
int add_file_to_backend_by_md5(const char *path, const char *expected_md5,
5862
struct _hash_record **hashtable,
@@ -145,7 +149,7 @@ int add_file_to_backend_by_md5(const char *path, const char *expected_md5,
145149
"dprintf failed writing %s to memfd (%s)",
146150
path, strerror(errno));
147151
free((void *)data);
148-
return 1;
152+
return -1;
149153
}
150154
}
151155
free((void *)data);

0 commit comments

Comments
 (0)