#18294: /etc/init.d/cron restart leaks validation msg
-------------------------+-----------------------------------
Reporter: luizluca@… | Owner: developers
Type: defect | Status: new
Priority: normal | Milestone: Barrier Breaker 14.07
Component: base system | Version: Barrier Breaker 14.07
Keywords: |
-------------------------+-----------------------------------
Hello,
This command is leaking a msg to stderr:
{{{
root@router:~# /etc/init.d/cron restart
uinteger - 9 = true
}}}
Seems to be from validade_data:
{{{
# /sbin/validate_data uinteger 9
uinteger - 9 = true
}}}
when loglevel is defined, called at:
{{{
/etc/init.d/cron:
start_service () {
[ -z "$(ls /etc/crontabs/)" ] && return 1
loglevel=$(uci_get "system.@system[0].cronloglevel")
[ -z "${loglevel}" ] || {
/sbin/validate_data uinteger "${loglevel}"
[ "$?" -eq 0 ] || {
echo "validation failed"
return 1
}
}
}}}
This is also used at:
{{{
uci_validate_section()
{
local _package="$1"
local _type="$2"
local _name="$3"
local _result
local _error
shift; shift; shift
_result=`/sbin/validate_data "$_package" "$_type" "$_name" "$@" 2>
/dev/null`
_error=$?
eval "$_result"
[ "$_error" = "0" ] || `/sbin/validate_data "$_package" "$_type"
"$_name" "$@" 1> /dev/null`
return $_error
}
}}}
That redirects stderr to null. Should it be done in /etc/init.d/cron?
BTW, the second call of validate_data at
/lib/functions/procd.sh:uci_validate_section() is redirecting stdout. Is
it correct? Should it be stderr?
--
Ticket URL: <https://dev.openwrt.org/ticket/18294>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets