Opened 9 years ago

Closed 9 years ago

#584 closed defect (fixed)

mondoarchive is mangling nfs URL

Reported by: Bill Owned by: Bruno Cornec
Priority: normal Milestone: 3.0.1
Component: mondo Version: 3.0.0
Severity: normal Keywords:
Cc:

Description (last modified by Bruno Cornec)

The 9th and 10th characters of my NFS url is getting changed:

Try with "ddr01.hlm.ad.moffitt.usf.edu:/backup/MCC/nfs/Linux/mkmondob":

Are you sure directory 'wlsu0165a/cur' exists in remote dir 'ddr01.hl**of**ad.moffitt.usf.edu:/backup/MCC/nfs/Linux/mkmondob'?
If so, do you have rights to write to it?
running: which mkfs.vfat > /mnt/backup/mondo.tmp.Fna5T0/mondo-run-prog-thing.tmp 2> /mnt/backup/mondo.tmp.Fna5T0/mondo-run-prog-thing.err
--------------------------------start of output-----------------------------
/sbin/mkfs.vfat
--------------------------------end of output------------------------------
...ran just fine. :-)
                [Main] libmondo-cli.c->handle_incoming_parameters#100: Switches:-
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -0
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -J /etc/mkmondob.include
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -O
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -d wlsu0165a/cur
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -n nfs://ddr01.hl**m.**ad.moffitt.usf.edu:/backup/MCC/nfs/Linux/mkmondob
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -p wlsu0165a
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -s 4444m
[Main] mondoarchive.c->main#346: Mondoarchive will now exit.

Try with "ddr01:/backup/MCC/nfs/Linux/mkmondob":

Are you sure directory 'wlsu0165a/cur' exists in remote dir 'ddr01:/b**MC**kup/MCC/nfs/Linux/mkmondob'?
If so, do you have rights to write to it?
running: which mkfs.vfat > /mnt/backup/mondo.tmp.CRtKiA/mondo-run-prog-thing.tmp 2> /mnt/backup/mondo.tmp.CRtKiA/mondo-run-prog-thing.err
--------------------------------start of output-----------------------------
/sbin/mkfs.vfat
--------------------------------end of output------------------------------
...ran just fine. :-)
                [Main] libmondo-cli.c->handle_incoming_parameters#100: Switches:-
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -0   
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -J /etc/mkmondob.include
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -O
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -d wlsu0165a/cur
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -n nfs://ddr01:/b**ac**kup/MCC/nfs/Linux/mkmondob
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -p wlsu0165a
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -s 4444m
[Main] mondoarchive.c->main#346: Mondoarchive will now exit.

Try with "ddr01:/data/col1/backup/MCC/nfs/Linux/mkmondob":

Are you sure directory 'wlsu0165a/cur' exists in remote dir 'ddr01:/d**l1**a/col1/backup/MCC/nfs/Linux/mkmondob'?
If so, do you have rights to write to it?
running: which mkfs.vfat > /mnt/backup/mondo.tmp.6pIP7t/mondo-run-prog-thing.tmp 2> /mnt/backup/mondo.tmp.6pIP7t/mondo-run-prog-thing.err
--------------------------------start of output-----------------------------
/sbin/mkfs.vfat
--------------------------------end of output------------------------------
...ran just fine. :-)
                [Main] libmondo-cli.c->handle_incoming_parameters#100: Switches:-
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -0   
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -J /etc/mkmondob.include
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -O
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -d wlsu0165a/cur
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -n nfs://ddr01:/d**at**a/col1/backup/MCC/nfs/Linux/mkmondob
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -p wlsu0165a
                [Main] libmondo-cli.c->handle_incoming_parameters#104: -s 4444m
[Main] mondoarchive.c->main#346: Mondoarchive will now exit.

This fails in 3.0.0, 2.2.9.7, and 2.2.9.6. I have been using 2.2.9.3 for a long time and it works.

Attachments (1)

mondoarchive.log (6.9 KB) - added by Bill 9 years ago.
One of my failed mondoarchive.log files

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by Bill

Attachment: mondoarchive.log added

One of my failed mondoarchive.log files

comment:1 Changed 9 years ago by Bruno Cornec

Status: newassigned

comment:2 Changed 9 years ago by Bill

The issue is with line 513 of libmondo-cli.c:

strcpy(bkpinfo->netfs_mount,p);

From the manpage for strcpy:

The strcpy() function copies the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest. The strings may not overlap, and the destination string dest must be large enough to receive the copy.

Though I am not suggesting this is how you have to fix this issue, switching to memmove does resolve the issue:

/* strcpy(bkpinfo->netfs_mount,p); */

memmove(bkpinfo->netfs_mount, p, MAX_STR_LEN);

From the manpage for memmove:

The memmove() function copies n bytes from memory area src to memory area dest. The memory areas may overlap: copying takes place as though the bytes in src are first copied into a temporary array that does not overlap src or dest, and the bytes are then copied from the temporary array to dest.

comment:3 Changed 9 years ago by Bruno Cornec

Description: modified (diff)

comment:4 Changed 9 years ago by Bruno Cornec

Resolution: fixed
Status: assignedclosed

I adopted your proposal patch in rev [2946]

Note: See TracTickets for help on using tickets.