From 09655210344e117917a2e32610b42144dc5518ef Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 01 Jun 2018 23:04:09 -0400 Subject: bin/rc: Invalidate session types with empty ancestor types And replace unnecessary double quotes with no interpolation. --- diff --git a/bin/rc b/bin/rc index 8b14849..0b06c19 100755 --- a/bin/rc +++ b/bin/rc @@ -34,7 +34,7 @@ valid_session_type() local session_type="${1}" shift 1 - case "${session_type}" in *[!A-Za-z0-9:]* | '' | ':'* | *':' | ':') + case "${session_type}" in *[!A-Za-z0-9:]* | '' | ':'* | *':' | *'::'*) return 1 esac return 0 @@ -204,7 +204,7 @@ start() run_daemon "${session_type}" & else # Signal the running rc daemon. - printf "%s beg %s\n" "${MAGIC}" "${session_type}" \ + printf '%s beg %s\n' "${MAGIC}" "${session_type}" \ 1>"${rc_fifo}" fi @@ -223,7 +223,7 @@ stop() return 1 else # Signal the running rc daemon. - printf "%s end %s\n" "${MAGIC}" "${session_type}" \ + printf '%s end %s\n' "${MAGIC}" "${session_type}" \ 1>"${rc_fifo}" fi @@ -247,7 +247,7 @@ status() return 1 fi # Signal the running rc daemon. - printf "%s who %s\n" "${MAGIC}" "${res_fifo}" \ + printf '%s who %s\n' "${MAGIC}" "${res_fifo}" \ 1>"${rc_fifo}" if read -r magic list 0<"${res_fifo}" && \ [ "x${magic}" = "x${MAGIC}" ]; then -- cgit v0.9.1