Variable to basename unescaped

Bug #1218775 reported by Paulo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ldapscripts (Ubuntu)
New
Undecided
Unassigned

Bug Description

I am integrating the runtime script in my custom script so I can use some of the utilities it provides.
My custom script is currently in a path which contains white space causing the "log_only" function call to not work correctly because the command passed has unescaped variables. For instance it was causing base name to complain about extra operands, which is completely unrelated.

The line is /usr/share/runtime@795:
log_only "$(date '+%b %d %H:%M:%S') $(uname -n | sed 's|\..*$||') ldapscripts: $(basename $0)($USER): $0 $*"

The proposed change:
log_only "$(date '+%b %d %H:%M:%S') $(uname -n | sed 's|\..*$||') ldapscripts: $(basename '$0')($USER): '$0' '$*'"

Notice the single quotes around $0 and $*. I didn't escape $USER because it is not supposed to have white spaces ever, but feel free to decide that.

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.