Changeset 2404 in MondoRescue


Ignore:
Timestamp:
Sep 17, 2009, 2:23:18 AM (15 years ago)
Author:
Bruno Cornec
Message:
  • At restore time read the netfs protocol in the conf file
  • Use dir for shell related commands and dir1 for C related actions in open_and_list_dir to avoid missing some files with { in names e.g.

(Backports from 2.2.9)

Location:
branches/2.2.10/mondo/src
Files:
2 edited

Legend:

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

    r2383 r2404  
    13451345    time_t this_time;
    13461346
     1347    /* dir is needed when we pass it to the shell */
    13471348    dir = mr_stresc(dir1, "`$\\\"(){}'[]&*?|!#~", '\\');
    13481349    p = strrchr(dir, '/');
     
    13821383        mr_free(tmp1);
    13831384
    1384         mr_asprintf(name_of_evalcall_form, "Making catalog of %s", dir);
     1385        mr_asprintf(name_of_evalcall_form, "Making catalog of %s", dir1);
    13851386        open_evalcall_form(name_of_evalcall_form);
    13861387        mr_free(name_of_evalcall_form);
     
    14031404                last_time = this_time;
    14041405                if (!g_text_mode) {
    1405                     mr_asprintf(tmp, "Reading %-68s", dir);
     1406                    mr_asprintf(tmp, "Reading %-68s", dir1);
    14061407                    newtDrawRootText(0, g_noof_rows - 3, tmp);
    14071408                    mr_free(tmp);
     
    14211422        mr_asprintf(skip_these, " %s ", sth);
    14221423    }
    1423     mr_asprintf(new_with_spaces, " %s ", dir);
    1424     if ((dip = opendir(dir)) == NULL) {
    1425         mr_asprintf(tmp,"opendir %s", dir);
     1424    mr_asprintf(new_with_spaces, " %s ", dir1);
     1425    if ((dip = opendir(dir1)) == NULL) {
     1426        mr_asprintf(tmp,"opendir %s", dir1);
    14261427        log_OS_error(tmp);
    14271428        mr_free(tmp);
    14281429    } else if (strstr(skip_these, new_with_spaces)) {
    1429         fprintf(fout, "%s\n", dir); // if excluded dir then print dir ONLY
     1430        fprintf(fout, "%s\n", dir1);    // if excluded dir then print dir ONLY
    14301431    } else {
    1431         fprintf(fout, "%s\n", dir);
     1432        fprintf(fout, "%s\n", dir1);
    14321433        while ((dit = readdir(dip)) != NULL) {
    14331434            i++;
    1434             if (strcmp(dir, "/")) {
    1435                 mr_asprintf(new,"%s/%s",dir,dit->d_name);
     1435            if (strcmp(dir1, "/")) {
     1436                mr_asprintf(new,"%s/%s",dir1,dit->d_name);
    14361437            } else {
    1437                 mr_asprintf(new,"%s%s",dir,dit->d_name);
     1438                mr_asprintf(new,"%s%s",dir1,dit->d_name);
    14381439            }
    14391440            mr_free(new_with_spaces);
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c

    r2389 r2404  
    749749        bkpinfo->backup_media_type = netfs;
    750750        bkpinfo->please_dont_eject = TRUE;
     751        mr_free(value);
     752
     753        mr_free(bkpinfo->netfs_proto);
     754        if ((value = read_cfg_var(cfg_file, "netfs-proto")) == 0) {
     755            mr_asprintf(bkpinfo->netfs_proto, "%s", value);
     756        } else {
     757            /* For compatibility, force protocol in old nfs case to be transparent */
     758            mr_asprintf(bkpinfo->netfs_proto, "nfs");
     759        }
     760        mr_free(value);
     761
    751762        mr_free(bkpinfo->prefix);
    752         mr_free(value);
    753763        if ((value = read_cfg_var(cfg_file, "iso-prefix")) == 0) {
    754764            mr_asprintf(bkpinfo->prefix, "%s", value);
     
    756766            mr_asprintf(bkpinfo->prefix, "%s", STD_PREFIX);
    757767        }
     768        mr_free(value);
    758769   
    759770        tmp = call_program_and_get_last_line_of_output("cat " CMDLINE);
     
    769780        }
    770781        mr_free(tmp);
    771     /* For compatibility, force protocol in old nfs case to be transparent */
    772     if (!strcmp(value, "nfs")) {
    773         mr_free(bkpinfo->netfs_proto);
    774         mr_asprintf(bkpinfo->netfs_proto, "nfs");
    775     }
    776782
    777783    } else if (!strcmp(value, "tape")) {
Note: See TracChangeset for help on using the changeset viewer.