Changeset 2988


Ignore:
Timestamp:
Apr 4, 2012, 2:26:46 PM (7 years ago)
Author:
bruno
Message:

r4625@localhost: bruno | 2012-03-30 10:37:17 +0200

  • Fix #595 (MD core dump issue) by removing an abusive mr_free
  • Fix #596 again by using correctly the --uuid option and getting the value in an adequate manner
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/mondorestore/mondo-prep.c

    r2985 r2988  
    566566  char *tmp1 = NULL;
    567567  char *oldmd = NULL;
    568   char *bootdevice;
    569568  char *name;
    570569  char *ver;
    571570
    572   malloc_string(bootdevice);
    573571  malloc_string(name);
    574572  malloc_string(ver);
     
    626624  //   2) grub bootloader < v1 is used.
    627625  // Otherwise it won't boot which is bad.
    628     if (read_cfg_var(g_mondo_cfg_file, "bootloader.device", bootdevice) != 0) {
    629             log_msg(2, "Unable to find bootloader.device param in %s conf file\n", g_mondo_cfg_file);
    630     }
    631626    if (read_cfg_var(g_mondo_cfg_file, "bootloader.name", name) != 0) {
    632627            log_msg(2, "Unable to find bootloader.name param in %s conf file\n", g_mondo_cfg_file);
     
    640635        if ((strstr(ver, "GRUB 0.9") != NULL) && (strcmp(raidlist->el[i].raid_device,device) == 0)) {
    641636            mr_asprintf(&oldmd, "-e 0.90");
    642             log_it("Forcing old metadata 0.90 for md on %s for old GRUB", device);
     637            log_it("Forcing old metadata (%s) for md on %s for old GRUB", oldmd, device);
    643638        } else {
    644639            mr_asprintf(&oldmd, "");
     
    646641    } else if ((strcmp(name,"LILO") == 0) && (strcmp(raidlist->el[i].raid_device,device) == 0)) {
    647642        mr_asprintf(&oldmd, "-e 0.90");
    648         log_it("Forcing old metadata 0.90 for md on %s for LILO", device);
     643        log_it("Forcing old metadata (%s) for md on %s for LILO", oldmd, device);
    649644    } else {
    650645        mr_asprintf(&oldmd, "");
    651646    }
    652     mr_free(device);
    653647    mr_free(name);
    654648    mr_free(ver);
     
    660654        log_msg(4, "cmd built: %s", program);
    661655  // Restoring the UUID stored at backup time of present
    662   for (v = 0; v++ ; v <= raidlist->el[i].additional_vars.entries) {
     656  for (v = 0; v <= raidlist->el[i].additional_vars.entries ; v++ ) {
    663657    if ((raidlist->el[i].additional_vars.el[v].label != NULL) && (strcmp(raidlist->el[i].additional_vars.el[v].label,"UUID") == 0)) {
    664658        // We have a UUID to handle
     
    666660            // force its restoration in order to avoid modifying all conf files using it
    667661            log_it("Managing previous UUID %s", raidlist->el[i].additional_vars.el[v].value);
    668             mr_strcat(program, " --update=uuid --uuid %s",raidlist->el[i].additional_vars.el[v].value);
     662            mr_strcat(program, " --uuid %s",raidlist->el[i].additional_vars.el[v].value);
    669663            break;
    670664        } else {
Note: See TracChangeset for help on using the changeset viewer.