Changeset 1628


Ignore:
Timestamp:
Sep 9, 2007, 3:14:36 AM (12 years ago)
Author:
bruno
Message:

prefix is also now read from conf file

Location:
branches/stable/mondo/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1627 r1628  
    721721        strcpy(bkpinfo->isodir, "/var/cache/mondo/iso");
    722722    }
    723     strcpy(bkpinfo->prefix, STD_PREFIX);
     723    mr_asprintf(&tmp,mr_conf->prefix);
     724    bkpinfo->prefix = tmp;
    724725
    725726    bkpinfo->scratchdir[0] = '\0';
  • branches/stable/mondo/src/common/mondostructures.h

    r1609 r1628  
    443443   * If backup_media_type is anything else, this is ignored.
    444444   */
    445     char prefix[MAX_STR_LEN / 4];
     445    char *prefix;
    446446
    447447  /**
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r1626 r1628  
    614614
    615615    if (flag_set['p']) {
    616         strncpy(bkpinfo->prefix, flag_val['p'], MAX_STR_LEN / 4);
     616        mr_allocstr(bkpinfo->prefix, flag_val['p']);
    617617    }
    618618
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r1594 r1628  
    800800            }
    801801            if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
    802                     strcpy(bkpinfo->prefix,value);
     802                mr_allocstr(bkpinfo->prefix,value);
    803803            } else {
    804                     strcpy(bkpinfo->prefix,STD_PREFIX);
     804                mr_allocstr(bkpinfo->prefix,STD_PREFIX);
    805805            }
    806806        } else if (!strcmp(value, "nfs")) {
    807807            bkpinfo->backup_media_type = nfs;
    808808            if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
    809                     strcpy(bkpinfo->prefix,value);
     809                mr_allocstr(bkpinfo->prefix,value);
    810810            } else {
    811                     strcpy(bkpinfo->prefix,STD_PREFIX);
     811                mr_allocstr(bkpinfo->prefix,STD_PREFIX);
    812812            }
    813813            if (strstr(call_program_and_get_last_line_of_output
     
    819819                    fatal_error("no imgname variable in environment");
    820820                }
    821                 strcpy(bkpinfo->prefix,envtmp1);
     821                mr_allocstr(bkpinfo->prefix,envtmp1);
    822822            }
    823823
  • branches/stable/mondo/src/mondorestore/mondorestore.c

    r1626 r1628  
    438438    read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
    439439    iamhere("Done loading config file; resizing ML");
    440     strcpy(tmp, bkpinfo->prefix);
    441440    if (popup_and_get_string
    442         ("Prefix", "Prefix of your ISO images ?", tmp, MAX_STR_LEN / 4)) {
    443         strcpy(bkpinfo->prefix, tmp);
     441        ("Prefix", "Prefix of your ISO images ?", bkpinfo->prefix, MAX_STR_LEN / 4)) {
    444442        mr_msg(1, "Prefix set to %s",bkpinfo->prefix);
    445443    }
     
    30473045
    30483046    if (argc == 3 && strcmp(argv[1], "-p") == 0) {
    3049         strcpy(bkpinfo->prefix,argv[2]);
     3047        mr_allocstr(bkpinfo->prefix,argv[2]);
    30503048        mr_msg(1,"Prefix forced to %s",bkpinfo->prefix);
    30513049    }
Note: See TracChangeset for help on using the changeset viewer.