From 01231ee43570d1de5f133a966b1d04bc68008b38 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 12 May 2023 13:12:41 -0400 Subject: opk/read: Only extract and/or print regular files --- (limited to 'src/opk/read.c') 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, -- cgit v0.9.1