diff options
author | P. J. McDermott <pj@pehjota.net> | 2018-06-01 23:04:09 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2018-06-04 01:51:00 (EDT) |
commit | 09655210344e117917a2e32610b42144dc5518ef (patch) | |
tree | f3fa6daf1208469ad569215be09de4b14e426679 | |
parent | 6a2a1e5f1e5a4a70837a260e9ea57b34ba339981 (diff) | |
download | homerc-09655210344e117917a2e32610b42144dc5518ef.zip homerc-09655210344e117917a2e32610b42144dc5518ef.tar.gz homerc-09655210344e117917a2e32610b42144dc5518ef.tar.bz2 |
bin/rc: Invalidate session types with empty ancestor types
And replace unnecessary double quotes with no interpolation.
-rwxr-xr-x | bin/rc | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |