[one-users] possible bug on tm_mad/common/context

Olivier Sallou olivier.sallou at irisa.fr
Mon Mar 3 05:33:11 PST 2014


Hi,
I made some tests and looking at code of tm_context, I think there is a
possible bug:
(src/tm_mad/common/context)

In code:

for f in "${SRC[@]}"; do
    case "$f" in
    http://*)
        exec_and_set_error "$WGET -P $ISO_DIR $f" "Error downloading $f"
        ;;
    *)
        if echo "$f" | grep -q ':'; then
            target=$(echo "$f"|cut -d':' -f2-)
            target="'$target'"
            f=$(echo "$f"|cut -d':' -f1)


If a target is set with something like : f = /path_to_my_file:subdir/my_file

target is then set with quotes, in the above example target='subdir/myfile'

Following command is:

exec_and_set_error "cp -R $f $ISO_DIR/$target" \
            "Error copying $f to $ISO_DIR"

The cp will fail:   cp -R /path_to_my_file $ISO_DIR/'subdir/myfile'
There are quotes in cp target path.

Am I correct. I made a try and it failed, but I wonder if it is code
part or an other error I made somewhere else.

Olivier

-- 
Olivier Sallou
IRISA / University of Rennes 1
Campus de Beaulieu, 35000 RENNES - FRANCE
Tel: 02.99.84.71.95

gpg key id: 4096R/326D8438  (keyring.debian.org)
Key fingerprint = 5FB4 6F83 D3B9 5204 6335  D26D 78DC 68DB 326D 8438

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20140303/a0f51424/attachment.htm>


More information about the Users mailing list