Changeset 1540


Ignore:
Timestamp:
Jul 20, 2007, 1:28:27 AM (12 years ago)
Author:
bruno
Message:

exclude_path should be 4*MAX_STR_LEN everywhere. Fixed now.
Increasing that value will allow to having larger exclude paths.
Should solve bug #137 (and maybe #3 as well)

Location:
branches/2.2.5/mondo/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/common/libmondo-devices.c

    r1522 r1540  
    23252325            ("Exclude paths",
    23262326             "Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.",
    2327              bkpinfo->exclude_paths, MAX_STR_LEN)) {
     2327             bkpinfo->exclude_paths, (4*MAX_STR_LEN)-1)) {
    23282328            log_to_screen("User has chosen not to backup the PC");
    23292329            finish(1);
  • branches/2.2.5/mondo/src/common/libmondo-filelist.c

    r1485 r1540  
    16961696    malloc_string(sz_filelist);
    16971697    malloc_string(g_skeleton_filelist);
    1698     if (!(exclude_paths = malloc(1000))) {
     1698    if (!(exclude_paths = malloc(8*MAX_STR_LEN))) {
    16991699        fatal_error("Cannot malloc exclude_paths");
    17001700    }
     
    17491749        log_msg(2, "include_paths = '%s'", include_paths);
    17501750        log_msg(1, "Calculating filelist");
    1751         sprintf(exclude_paths, " %s %s %s %s %s %s . .. \
     1751        snprintf(exclude_paths, (size_t)8*MAX_STR_LEN," %s %s %s %s %s %s . .. \
    17521752" MNT_CDROM " " MNT_FLOPPY " /media \
    17531753/proc /sys /root/images/mondo " MINDI_CACHE, excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
  • branches/2.2.5/mondo/src/mondoarchive/mondo-cli.c

    r1236 r1540  
    725725        strncpy(psz, list_of_NFS_mounts_only(), MAX_STR_LEN);
    726726        if (bkpinfo->exclude_paths[0]) {
    727             strncat(bkpinfo->exclude_paths, " ", MAX_STR_LEN);
    728         }
    729         strncat(bkpinfo->exclude_paths, psz, MAX_STR_LEN);
     727            strncat(bkpinfo->exclude_paths, " ", 4*MAX_STR_LEN);
     728        }
     729        strncat(bkpinfo->exclude_paths, psz, 4*MAX_STR_LEN);
    730730        log_msg(3, "-N means we're now excluding %s",
    731731                bkpinfo->exclude_paths);
    732732    }
    733     if (strlen(bkpinfo->exclude_paths) >= MAX_STR_LEN) {
     733    if (strlen(bkpinfo->exclude_paths) >= 4*MAX_STR_LEN) {
    734734        fatal_error
    735             ("Your '-E' parameter is too long. Please use '-J'. (See manual.)");
     735            ("Your '-E' parameter is too long. Increase MAX_STR_LEN");
    736736    }
    737737    if (flag_set['b']) {
Note: See TracChangeset for help on using the changeset viewer.