backup-manager: syntax error when env-variable content long

Bug #435132 reported by schnittchen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
backup-manager (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: backup-manager

Cron regularly sends me an email containing

/etc/cron.daily/backup-manager:
expr: syntax error
/usr/share/backup-manager/sanitize.sh: line 97: [: -gt: unary operator expected

It looks like this doesn't break things, but I won't bet.
Apparently the reason is the usage of "env" for parsing the environment (see next post).

Upstream has the same code at the location and so should be affected as well.

Revision history for this message
schnittchen (schnittchen) wrote :

Upon invocation from cron, backup-manager has some HAL_... environment variables containing much data.

From /usr/share/backup-manager/sanitize.sh, around line 97:

function replace_deprecated_booleans()
{

    for line in $(env)
    do
        key=$(echo "$line" | awk -F '=' '{print $1}')
        value=$(echo "$line" | awk -F '=' '{print $2}')
        #...parse, warn and modify...
    done

Now set some environment variable inside bash to some very long value and check the export of "env": The value is not quoted, but broken in several lines. This breaks the above construct.

Better would be to use "export -p" or to just loop through known BM_... variables.

Revision history for this message
schnittchen (schnittchen) wrote :

I haven's seen this error in a while. Probably this bug can be closed.

Changed in backup-manager (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.