Ignore:
Timestamp:
Aug 18, 2009, 2:37:58 PM (11 years ago)
Author:
Bruno Cornec
Message:

r3333@localhost: bruno | 2009-08-08 01:58:31 +0200

  • bkpinfo->prefix is now dynamically assigned
  • Fix newt mondoarchive
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c

    r2321 r2322  
    772772        }
    773773    }
     774    mr_free(bkpinfo->prefix);
    774775    if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
    775             strcpy(bkpinfo->prefix,value);
     776        mr_asprintf(&tmp1, "%s", value);
    776777    } else {
    777             strcpy(bkpinfo->prefix,STD_PREFIX);
    778     }
     778        mr_asprintf(&tmp1, "%s", STD_PREFIX);
     779    }
     780    bkpinfo->prefix = tmp1;
    779781} else if (!strcmp(value, "nfs")) {
    780782    bkpinfo->backup_media_type = nfs;
    781783    bkpinfo->please_dont_eject = TRUE;
     784    mr_free(bkpinfo->prefix);
    782785    if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
    783             strcpy(bkpinfo->prefix,value);
     786        mr_asprintf(&tmp1, "%s", value);
    784787    } else {
    785             strcpy(bkpinfo->prefix,STD_PREFIX);
    786     }
    787     if (strstr(call_program_and_get_last_line_of_output
    788        ("cat /proc/cmdline"), "pxe")) {
     788        mr_asprintf(&tmp1, "%s", STD_PREFIX);
     789    }
     790    bkpinfo->prefix = tmp1;
     791
     792    if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "pxe")) {
    789793        /* We need to override prefix value in PXE mode as it's
    790794        * already done in start-nfs */
     
    793797            fatal_error("no imgname variable in environment");
    794798        }
    795         strcpy(bkpinfo->prefix,envtmp1);
     799        mr_free(bkpinfo->prefix);
     800        mr_asprintf(&tmp1, "%s", envtmp1);
     801        bkpinfo->prefix = tmp1;
    796802    }
    797803
Note: See TracChangeset for help on using the changeset viewer.