summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,