Changeset 3823 in MondoRescue for branches/3.3/mondo/src/common


Ignore:
Timestamp:
Mar 3, 2024, 2:57:40 AM (4 months ago)
Author:
Bruno Cornec
Message:

manages call_before_iso dynamically

Location:
branches/3.3/mondo/src/common
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/common/libmondo-archive.c

    r3822 r3823  
    15911591    }
    15921592
    1593     if (bkpinfo->call_before_iso[0] != '\0') {
     1593    if (bkpinfo->call_before_iso[0] != NULL) {
    15941594        mr_asprintf(message_to_screen, "Running pre-ISO call for CD#%d", g_current_media_number);
    15951595        res = eval_call_to_make_ISO(bkpinfo->call_before_iso, destfile, g_current_media_number, MONDO_LOGFILE, message_to_screen);
  • branches/3.3/mondo/src/common/libmondo-cli.c

    r3822 r3823  
    796796
    797797    if ((flag_set['B']) && (! bkpinfo->restore_data)) {
    798         strncpy(bkpinfo->call_before_iso, flag_val['B'], MAX_STR_LEN);
     798        mr_asprintf(bkpinfo->call_before_iso, "%s", flag_val['B']);
    799799    }
    800800
  • branches/3.3/mondo/src/common/libmondo-devices.c

    r3822 r3823  
    23082308                log_msg(1, "bkpinfo->media_device = %s", bkpinfo->media_device);
    23092309                mr_asprintf(comment, "Please specify your %s drive's /dev entry", mds);
    2310                 tmp2 = popup_and_get_string("Device?", comment, bkpinfo->media_device,(MAX_STR_LEN / 4)-1);
     2310                tmp2 = mr_popup_and_get_string("Device?", comment, bkpinfo->media_device,(MAX_STR_LEN / 4)-1);
    23112311                if (!tmp2) {
    23122312                    log_to_screen("User has chosen not to backup the machine");
     
    23352335            if (bkpinfo->media_device != NULL) {
    23362336                if (bkpinfo->backup_media_type == usb) {
    2337                     tmp2 = popup_and_get_string("/dev entry?", "What is the /dev entry of your USB Disk/Key, please?", bkpinfo->media_device, (MAX_STR_LEN / 4)-1);
     2337                    tmp2 = mr_popup_and_get_string("/dev entry?", "What is the /dev entry of your USB Disk/Key, please?", bkpinfo->media_device, (MAX_STR_LEN / 4)-1);
    23382338                } else {
    23392339                    if (g_kernel_version < 2.6) {
    2340                         tmp2 = popup_and_get_string("Device node?", "What is the SCSI node of your CD (re)writer, please?", bkpinfo->media_device,(MAX_STR_LEN / 4)-1);
     2340                        tmp2 = mr_popup_and_get_string("Device node?", "What is the SCSI node of your CD (re)writer, please?", bkpinfo->media_device,(MAX_STR_LEN / 4)-1);
    23412341                    } else {
    2342                         tmp2 = popup_and_get_string("/dev entry?", "What is the /dev entry of your CD (re)writer, please?", bkpinfo->media_device,(MAX_STR_LEN / 4)-1);
     2342                        tmp2 = mr_popup_and_get_string("/dev entry?", "What is the /dev entry of your CD (re)writer, please?", bkpinfo->media_device,(MAX_STR_LEN / 4)-1);
    23432343                    }
    23442344                }
     
    23922392        }
    23932393        if (bkpinfo->media_device == NULL) {
    2394             tmp2 = popup_and_get_string("Device name?", "What is the /dev entry of your tape streamer?", bkpinfo->media_device,(MAX_STR_LEN / 4)-1);
     2394            tmp2 = mr_popup_and_get_string("Device name?", "What is the /dev entry of your tape streamer?", bkpinfo->media_device,(MAX_STR_LEN / 4)-1);
    23952395            if (tmp2 == NULL) {
    23962396                log_to_screen("User has chosen not to backup the machine");
  • branches/3.3/mondo/src/common/libmondo-tools.c

    r3822 r3823  
    537537
    538538        if (bkpinfo->manual_cd_tray) {
    539             if (bkpinfo->call_before_iso[0] == '\0') {
    540                 sprintf(bkpinfo->call_before_iso, "%s -o %s/"MONDO_TMPISOS" . 2>> _ERR_", mondo_mkisofs_sz, bkpinfo->tmpdir);
     539            if (bkpinfo->call_before_iso == NULL) {
     540                mr_asprintf(bkpinfo->call_before_iso, "%s -o %s/"MONDO_TMPISOS" . 2>> _ERR_", mondo_mkisofs_sz, bkpinfo->tmpdir);
    541541            } else {
    542542                mr_asprintf(call_before_iso_user, "%s", bkpinfo->call_before_iso);
    543                 sprintf(bkpinfo->call_before_iso, "( %s -o %s/"MONDO_TMPISOS" . 2>> _ERR_ ; %s )", mondo_mkisofs_sz, bkpinfo->tmpdir, call_before_iso_user);
     543                mr_free(bkpinfo->call_before_iso);
     544                mr_asprintf(bkpinfo->call_before_iso, "( %s -o %s/"MONDO_TMPISOS" . 2>> _ERR_ ; %s )", mondo_mkisofs_sz, bkpinfo->tmpdir, call_before_iso_user);
    544545                mr_free(call_before_iso_user);
    545546            }
     
    851852    bkpinfo->exclude_devs = NULL;
    852853    bkpinfo->restore_path[0] = '\0';
    853     bkpinfo->call_before_iso[0] = '\0';
     854    bkpinfo->call_before_iso = NULL;
    854855    bkpinfo->call_make_iso[0] = '\0';
    855856    bkpinfo->call_burn_iso[0] = '\0';
  • branches/3.3/mondo/src/common/mondostructures.h

    r3822 r3823  
    540540   * A command to call BEFORE making an ISO image.
    541541   */
    542     char call_before_iso[MAX_STR_LEN];
     542    char *call_before_iso;
    543543
    544544  /**
Note: See TracChangeset for help on using the changeset viewer.