Changeset 3211 for branches/3.2


Ignore:
Timestamp:
Dec 10, 2013, 8:50:44 AM (6 years ago)
Author:
bruno
Message:
  • Fi a bug with the cfg_file variable which wasn't initialized correctly (strcpy) while managed dynamically
File:
1 edited

Legend:

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

    r3207 r3211  
    655655
    656656if (!cfgf) {
    657     strcpy(cfg_file, g_mondo_cfg_file);
     657    mr_asprintf(cfg_file, "%s", g_mondo_cfg_file);
    658658} else {
    659     strcpy(cfg_file, cfgf);
     659    mr_asprintf(cfg_file, "%s", cfgf);
    660660}
    661661
     
    848848}
    849849
    850 read_cfg_var(g_mondo_cfg_file, "please-dont-eject", value);
     850read_cfg_var(cfg_file, "please-dont-eject", value);
    851851if (value[0] || strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "donteject")) {
    852852    bkpinfo->please_dont_eject = TRUE;
     
    864864        log_msg(2, "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place");
    865865    } else {
    866         read_cfg_var(g_mondo_cfg_file, "netfs-server-mount", value);
     866        read_cfg_var(cfg_file, "netfs-server-mount", value);
    867867        mr_free(bkpinfo->netfs_mount);
    868868        mr_asprintf(bkpinfo->netfs_mount, "%s", value);
    869869
    870         read_cfg_var(g_mondo_cfg_file, "netfs-server-path", value);
     870        read_cfg_var(cfg_file, "netfs-server-path", value);
    871871        mr_free(bkpinfo->netfs_remote_dir);
    872872        mr_asprintf(bkpinfo->netfs_remote_dir, "%s", value);
     
    908908    */
    909909    mr_asprintf(old_isodir, "%s", bkpinfo->isodir);
    910     read_cfg_var(g_mondo_cfg_file, "iso-mnt", iso_mnt);
    911     read_cfg_var(g_mondo_cfg_file, "isodir", iso_path);
     910    read_cfg_var(cfg_file, "iso-mnt", iso_mnt);
     911    read_cfg_var(cfg_file, "isodir", iso_path);
    912912    sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
    913913    if (!bkpinfo->isodir[0]) {
     
    920920        }
    921921    }
     922    mr_free(old_isodir);
     923
    922924    if (g_isodir_device[0] == '\0') {
    923925        /*  We don't want to loose our conf made earlier in iso_fiddly_bits
    924926         *  so go here only if job not done already */
    925         read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device);
     927        read_cfg_var(cfg_file, "iso-dev", g_isodir_device);
    926928    }
    927929
     
    965967    }
    966968}
     969mr_free(cfg_file);
    967970
    968971if (media_specified_by_user != none) {
Note: See TracChangeset for help on using the changeset viewer.