Changeset 3826 in MondoRescue


Ignore:
Timestamp:
Mar 4, 2024, 1:23:30 PM (4 months ago)
Author:
Bruno Cornec
Message:

manages postnuke_tarball dynamically

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

Legend:

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

    r3823 r3826  
    15911591    }
    15921592
    1593     if (bkpinfo->call_before_iso[0] != NULL) {
     1593    if (bkpinfo->call_before_iso != 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

    r3823 r3826  
    719719    if (!flag_set['d'] && (flag_set['c'] || flag_set['w'] || flag_set['C'])) {
    720720        if (g_kernel_version >= 2.6) {
    721             tmp1 = popup_and_get_string("Device", "Please specify the device",bkpinfo->media_device, MAX_STR_LEN / 4);
     721            tmp1 = mr_popup_and_get_string("Device", "Please specify the device",bkpinfo->media_device);
    722722            if (tmp1 == NULL) {
    723723                retval++;
     
    826826
    827827    if ((flag_set['P']) && (! bkpinfo->restore_data)) {
    828         strncpy(bkpinfo->postnuke_tarball, flag_val['P'], MAX_STR_LEN);
     828        mr_asprintf(bkpinfo->postnuke_tarball, "%s", flag_val['P']);
    829829    }
    830830
  • branches/3.3/mondo/src/common/libmondo-devices.c

    r3823 r3826  
    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 = mr_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);
    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 = 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);
     2337                    tmp2 = mr_popup_and_get_string("/dev entry?", "What is the /dev entry of your USB Disk/Key, please?", bkpinfo->media_device);
    23382338                } else {
    23392339                    if (g_kernel_version < 2.6) {
    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);
     2340                        tmp2 = mr_popup_and_get_string("Device node?", "What is the SCSI node of your CD (re)writer, please?", bkpinfo->media_device);
    23412341                    } else {
    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);
     2342                        tmp2 = mr_popup_and_get_string("/dev entry?", "What is the /dev entry of your CD (re)writer, please?", bkpinfo->media_device);
    23432343                    }
    23442344                }
     
    23922392        }
    23932393        if (bkpinfo->media_device == NULL) {
    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);
     2394            tmp2 = mr_popup_and_get_string("Device name?", "What is the /dev entry of your tape streamer?", bkpinfo->media_device);
    23952395            if (tmp2 == NULL) {
    23962396                log_to_screen("User has chosen not to backup the machine");
  • branches/3.3/mondo/src/common/libmondo-files.c

    r3821 r3826  
    10801080    mr_free(command);
    10811081
    1082     if (bkpinfo->postnuke_tarball[0]) {
     1082    if (bkpinfo->postnuke_tarball != NULL) {
    10831083        mr_asprintf(command, "cp -f %s %s/post-nuke.tgz", bkpinfo->postnuke_tarball, bkpinfo->tmpdir);
    10841084        res = run_program_and_log_output(command, FALSE);
  • branches/3.3/mondo/src/common/libmondo-tools.c

    r3823 r3826  
    687687    }
    688688    g_current_media_number = 1;
    689     bkpinfo->postnuke_tarball[0] = '\0';
    690689    return (res);
    691690}
     
    861860    bkpinfo->netfs_user = NULL;
    862861    bkpinfo->netfs_remote_dir = NULL;
    863     bkpinfo->postnuke_tarball[0] = '\0';
     862    bkpinfo->postnuke_tarball = NULL;
    864863    bkpinfo->subdir = NULL;
    865864    bkpinfo->wipe_media_first = FALSE;
  • branches/3.3/mondo/src/common/mondostructures.h

    r3823 r3826  
    593593  /**
    594594   * A tarball containing a program called "usr/bin/post-nuke" that will be run
    595    * after nuking the system. If "", do not use a post-nuke tarball.
    596    */
    597     char postnuke_tarball[MAX_STR_LEN];
     595   * after nuking the system. If NULL, do not use a post-nuke tarball.
     596   */
     597    char *postnuke_tarball;
    598598
    599599  /**
  • branches/3.3/mondo/src/common/newt-specific.c

    r3822 r3826  
    430430        mr_free(bkpinfo->image_devs);
    431431        mr_free(bkpinfo->media_device);
     432        mr_free(bkpinfo->postnuke_tarball);
    432433        /* Then free the structure */
    433434        paranoid_free(bkpinfo);
Note: See TracChangeset for help on using the changeset viewer.