Modify

Opened 3 years ago

#18294 new defect

/etc/init.d/cron restart leaks validation msg

Reported by: luizluca@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: base system Version: Barrier Breaker 14.07
Keywords: Cc:

Description

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?

Attachments (0)

Change History (0)

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.