summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-05-12 13:12:41 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-05-12 13:12:41 (EDT)
commit01231ee43570d1de5f133a966b1d04bc68008b38 (patch)
tree5cf44d9d86f4ecc231d574cce2e85bd0f94f509e
parentba357e342af00a06fbce682e866232390780bbc5 (diff)
opk/read: Only extract and/or print regular files
-rw-r--r--src/opk/read.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/opk/read.c b/src/opk/read.c
index 5341a96..768f64d 100644
--- a/src/opk/read.c
+++ b/src/opk/read.c
@@ -169,6 +169,18 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
continue;
}
+ /* Only extract and/or print regular files. */
+ if (member->type != '-') {
+ fputs(_("Error: Non-regular control files not supported"
+ "\n"), stderr);
+ free(member);
+ _opkg_opk_opk_read_free_inner(opk);
+ if (opk->control_dir != NULL) {
+ free(path);
+ }
+ return OPKG_OPK_ERROR;
+ }
+
/* Open file for extraction. */
if (opk->control_dir != NULL) {
if (sprintf(path, "%s/%s", opk->control_dir,
@@ -189,11 +201,13 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
}
}
+ /* List file. */
if (opk->list_control > 0) {
puts(buffer);
opk->previously_printed = 1;
}
+ /* Print file if requested. */
if (opk->print_control_head != NULL &&
_opkg_opk_opk_read_check_name(member->name,
&opk->print_control_head,