Changeset 3196


Ignore:
Timestamp:
Oct 1, 2013, 8:20:32 AM (6 years ago)
Author:
bruno
Message:
  • Fix ISO mode when netfs_remote_dir is NULL (wasn't differentiated correctly with dynamic meory allocation)
Location:
branches/3.2/mondo/src/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/common/libmondo-archive.c

    r3191 r3196  
    32103210        log_to_screen("Warning! CD is too big. It occupies %ld KB, which is more than the %ld KB allowed.",(long) space_occupied_by_cd(bkpinfo->scratchdir),(long) bkpinfo->media_size);
    32113211    }
    3212     mr_asprintf(isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir,
    3213             bkpinfo->netfs_remote_dir, bkpinfo->prefix,
    3214             g_current_media_number);
     3212
     3213    if (bkpinfo->netfs_remote_dir) {
     3214        // NETFS
     3215        mr_asprintf(isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number);
     3216    } else {
     3217        // ISO
     3218        mr_asprintf(fname, "%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number);
     3219    }
    32153220    for (that_one_was_ok = FALSE; !that_one_was_ok;) {
    32163221        if (bkpinfo->backup_media_type != usb) {
  • branches/3.2/mondo/src/common/libmondo-devices.c

    r3194 r3196  
    13401340        }
    13411341#ifdef __FreeBSD__
    1342         mr_asprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir,
    1343             bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number);
     1342        if (bkpinfo->netfs_remote_dir) {
     1343            // NETFS
     1344            mr_asprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number);
     1345        } else {
     1346            // ISO
     1347            mr_asprintf(mount_cmd, "/mnt/isodir/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number);
     1348        }
    13441349        mddev = make_vn(mount_cmd);
    13451350        mr_free(mount_cmd);
     
    13471352        mr_asprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
    13481353#else
    1349         mr_asprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
     1354        if (bkpinfo->netfs_remote_dir) {
     1355            // NETFS
     1356            mr_asprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
     1357        } else {
     1358            // ISO
     1359            mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
     1360        }
    13501361#endif
    13511362
     
    25492560            finish(1);
    25502561        }
     2562        if (bkpinfo->netfs_remote_dir == NULL) {
     2563            fatal_error("bkpinfo->netfs_remote_dir shold not be NULL");
     2564        }
    25512565        strcpy(tmp1, bkpinfo->netfs_remote_dir);
    25522566        if (!popup_and_get_string
     
    25562570            finish(1);
    25572571        }
     2572        mr_free(bkpinfo->netfs_remote_dir);
    25582573        mr_asprintf(bkpinfo->netfs_remote_dir, "%s", tmp1);
    25592574
     
    26152630        break;
    26162631    default:
    2617         fatal_error
    2618             ("I, Mojo Jojo, shall defeat those pesky Powerpuff Girls!");
     2632        fatal_error("I, Mojo Jojo, shall defeat those pesky Powerpuff Girls!");
    26192633    }
    26202634
Note: See TracChangeset for help on using the changeset viewer.