Changeset 2206


Ignore:
Timestamp:
May 14, 2009, 4:23:28 AM (11 years ago)
Author:
Bruno Cornec
Message:

-Improvements in tests for mountlist

  • escape remaining chars [{&...
Location:
branches/2.2.9/mondo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-filelist.c

    r2203 r2206  
    483483        }
    484484        log_msg(8, "Analyzing %s", file_to_analyze);
    485         tmp = mr_stresc(file_to_analyze, "`$\\\"()'|!#~", '\\');
     485        tmp = mr_stresc(file_to_analyze, "`$\\\"(){}[]'*?&|!#~", '\\');
    486486        (void)asprintf(&strtmp, syscall_sprintf, tmp);
    487487        paranoid_free(tmp);
     
    13781378    time_t this_time;
    13791379
    1380     dir = mr_stresc(dir1, "`$\\\"()'|!#~", '\\');
     1380    dir = mr_stresc(dir1, "`$\\\"(){}'[]&*?|!#~", '\\');
    13811381    p = strrchr(dir, '/');
    13821382    if (p) {
  • branches/2.2.9/mondo/src/common/libmondo-mountlist.c

    r2205 r2206  
    673673
    674674        (void) truncate_to_drive_name(drive);
     675        log_msg(8, "drive truncated to %s", drive);
     676
    675677        for (j = 0;
    676678             j < noof_drives
    677679             && strcmp(drivelist->el[j].device, drive) != 0; j++) {
    678             paranoid_free(drive);
    679680            continue;
    680681        }
    681682        if (j == noof_drives) {
    682             strcpy(drivelist->el[noof_drives++].device, drive);
     683            strncpy(drivelist->el[noof_drives++].device, drive, 63);
    683684        }
    684685        paranoid_free(drive);
     
    817818        if (res < 5) {
    818819            /* no label found */
    819             asprintf(&tmp, "%s", "");
    820             mountlist->el[items].label = tmp;
     820            log_msg(4, "no label found for %s",mountlist->el[items].device);
     821            strcpy(mountlist->el[items].label,"");
    821822        }
    822823#elif __FreeBSD__
     
    826827               mountlist->el[items].mountpoint,
    827828               mountlist->el[items].format, siz);
    828         asprintf(&tmp, "%s", "");
    829         mountlist->el[items].label = tmp;
     829        strcpy(mountlist->el[items].label,"");
    830830#endif
    831831
     
    846846        if (mountlist->el[items].device[0] != '\0'
    847847            && mountlist->el[items].device[0] != '#') {
    848             if (items >= ARBITRARY_MAXIMUM) {
    849                 log_to_screen("Too many lines in mountlist.. ABORTING");
    850                 finish(1);
    851             }
    852848            for (j = 0;
    853849                 j < items
     
    884880                     mountlist->el[items].label);
    885881            items++;
     882            if (items >= MAX_MOUNTLIST_ENTRIES) {
     883                log_to_screen("Too many lines in mountlist.. ABORTING");
     884                finish(1);
     885            }
    886886        }
    887887        (void) fgets(incoming, MAX_STR_LEN - 1, fin);
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-tools.c

    r2195 r2206  
    22052205    char *ramdisk_fname;
    22062206    char *mountlist_file;
    2207     bool extract_mountlist_stub;
    2208     bool extract_i_want_my_lvm;
     2207    bool extract_mountlist_stub = FALSE;
     2208    bool extract_i_want_my_lvm = FALSE;
    22092209
    22102210    bool try_plan_B;
  • branches/2.2.9/mondo/test/test-mountlist.c

    r2204 r2206  
    4545    asprintf(&MONDO_LOGFILE,"/tmp/mrtest-mountlist.log");
    4646
     47    /* Globals */
    4748    g_loglevel = 99;
    4849    g_text_mode = FALSE;
     50    g_main_pid = getpid();
     51
    4952    if (!(mountlist = malloc(sizeof(struct mountlist_itself)))) {
    5053        fatal_error("Cannot malloc mountlist");
     
    5760setup_newt_stuff();
    5861asprintf(&g_mountlist_fname, "/tmp/mountlist.txt");
     62log_it("before mountlist");
    5963load_mountlist(mountlist, g_mountlist_fname);
     64log_it("after mountlist");
    6065resize_mountlist_proportionately_to_suit_new_drives(mountlist);
     66log_it("after resize_mountlist_proportionately_to_suit_new_drives");
    6167load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
     68log_it("after load_raidtab_into_raidlist");
    6269edit_mountlist(g_mountlist_fname, mountlist, raidlist);
     70log_it("after edit_mountlist");
    6371exit(0);
    6472}
Note: See TracChangeset for help on using the changeset viewer.