summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-08-01 22:50:25 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-08-01 22:50:25 (EDT)
commitc1ac58c0cbd29aff34ad7fd538d743b82f14a42c (patch)
tree2ab8071f2dcf38204294c31ce981f42bf151103d /src
parent63c2a95035be9cefdabfba23ed7d2f27b86a075c (diff)
src/proquivs: Validate fields
Diffstat (limited to 'src')
-rwxr-xr-xsrc/proquivs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/proquivs b/src/proquivs
index e9ac2e8..ea2d141 100755
--- a/src/proquivs
+++ b/src/proquivs
@@ -83,6 +83,24 @@ build()
local value=
ob_parse_control "${ctl}" field_cb '' '' "${FIELDS}"
+ if [ -n "${field_source}" ] && \
+ ! ob_validate_source_name "${field_source}"; then
+ printf 'proquivs: Error: Invalid source name "%s"\n' \
+ "${field_source}" 1>&2
+ return 1
+ fi
+ if [ -n "${field_package}" ] && \
+ ! ob_validate_binary_name "${field_package}"; then
+ printf 'proquivs: Error: Invalid package name "%s"\n' \
+ "${field_package}" 1>&2
+ return 1
+ fi
+ if [ -n "${field_section}" ] && \
+ ! ob_validate_section "${field_section}"; then
+ printf 'proquivs: Error: Invalid section name "%s"\n' \
+ "${field_section}" 1>&2
+ return 1
+ fi
if ! mkdir 'proquivs'; then
printf 'proquivs: Error: Failed to create package\n' 1>&2