From c1ac58c0cbd29aff34ad7fd538d743b82f14a42c Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 01 Aug 2020 22:50:25 -0400 Subject: src/proquivs: Validate fields --- 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 -- cgit v0.9.1