Ignore:
Timestamp:
Feb 10, 2007, 1:21:15 AM (17 years ago)
Author:
Bruno Cornec
Message:

Idem + merge trunk memory managemnt in libmondo-devices.c

File:
1 edited

Legend:

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

    r1125 r1126  
    1818#include "libmondo-stream-EXT.h"
    1919#include "mr_mem.h"
    20 #include "mr_msg.h"
     20#include "mr_msg"
    2121
    2222#include <sys/ioctl.h>
     
    11781178    char *device = NULL;
    11791179    char *mddevice = NULL;
    1180     char command[MAX_STR_LEN];
     1180    char *command = NULL;
    11811181    int vndev = 2;
     1182
    11821183    if (atoi
    11831184        (call_program_and_get_last_line_of_output
    11841185         ("/sbin/sysctl -n kern.osreldate")) < 500000) {
    11851186        do {
    1186             sprintf(mddevice, "vn%ic", vndev++);
    1187             sprintf(command, "vnconfig %s %s", mddevice, fname);
     1187            mr_free(mddevice);
     1188            mr_asprintf(&mddevice, "vn%ic", vndev++);
     1189            mr_free(command);
     1190            mr_asprintf(&command, "vnconfig %s %s", mddevice, fname);
     1191
    11881192            if (vndev > 10) {
     1193                mr_free(command);
     1194                mr_free(mddevice);
    11891195                return NULL;
    11901196            }
    11911197        }
    11921198        while (system(command));
    1193     } else {
    1194         sprintf(command, "mdconfig -a -t vnode -f %s", fname);
    1195         mddevice = call_program_and_get_last_line_of_output(command);
     1199        mr_free(command);
     1200    } else {
     1201        mr_asprintf(&command, "mdconfig -a -t vnode -f %s", fname);
     1202        mr_asprintf(&mddevice, call_program_and_get_last_line_of_output(command));
     1203        mr_free(command);
     1204
    11961205        if (!strstr(mddevice, "md")) {
     1206            mr_free(mddevice);
    11971207            return NULL;
    11981208        }
    11991209    }
    1200     sprintf(device, "/dev/%s", mddevice);
    1201     return device;
    1202 }
    1203 
     1210    mr_asprintf(&device, "/dev/%s", mddevice);
     1211    mr_free(mddevice);
     1212    return(device);
     1213}
    12041214
    12051215
     
    12141224int kick_vn(char *dname)
    12151225{
    1216     char command[MAX_STR_LEN];
     1226    char *command;
     1227    int ret = 0;
    12171228
    12181229    if (strncmp(dname, "/dev/", 5) == 0) {
     
    12231234        (call_program_and_get_last_line_of_output
    12241235         ("/sbin/sysctl -n kern.osreldate")) < 500000) {
    1225         sprintf(command, "vnconfig -d %s", dname);
    1226         return system(command);
    1227     } else {
    1228         sprintf(command, "mdconfig -d -u %s", dname);
    1229         return system(command);
    1230     }
    1231      /*NOTREACHED*/ return 255;
     1236        mr_asprintf(&command, "vnconfig -d %s", dname);
     1237    } else {
     1238        mr_asprintf(&command, "mdconfig -d -u %s", dname);
     1239    }
     1240    ret = system(command);
     1241    mr_free(command);
     1242    return(ret);
    12321243}
    12331244#endif
     
    13271338
    13281339    /*@ buffers ********************************************************* */
    1329     char *tmp;
    1330     char *request;
     1340    char *tmp = NULL;
     1341    char *request = NULL;
    13311342
    13321343    assert(bkpinfo != NULL);
     
    13401351        return;
    13411352    }
    1342     malloc_string(tmp);
    1343     malloc_string(request);
    1344     sprintf(tmp, "mkdir -p " MNT_CDROM);
     1353    mr_asprintf(&tmp, "mkdir -p " MNT_CDROM);
    13451354    run_program_and_log_output(tmp, 5);
     1355    mr_free(tmp);
     1356
    13461357    if (g_ISO_restore_mode || bkpinfo->backup_media_type == iso
    13471358        || bkpinfo->backup_media_type == nfs) {
     
    13541365        }
    13551366        system("mkdir -p /tmp/isodir &> /dev/null");
    1356         sprintf(tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir,
     1367        mr_asprintf(&tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir,
    13571368                bkpinfo->nfs_remote_dir, bkpinfo->prefix,
    13581369                cd_number_i_want);
    13591370        if (!does_file_exist(tmp)) {
    1360             sprintf(tmp, "/tmp/isodir/%s/%s-%d.iso",
     1371            mr_free(tmp);
     1372            mr_asprintf(&tmp, "/tmp/isodir/%s/%s-%d.iso",
    13611373                    bkpinfo->nfs_remote_dir, bkpinfo->prefix,
    13621374                    cd_number_i_want);
     
    13721384            fatal_error("Mommy!");
    13731385        }
    1374 //    g_current_media_number = cd_number_i_want;
    1375 //    return;
     1386        mr_free(tmp);
    13761387    }
    13771388    if ((res = what_number_cd_is_this(bkpinfo)) != cd_number_i_want) {
    13781389        mr_msg(3, "Currently, we hold %d but we want %d", res,
    13791390                cd_number_i_want);
    1380         sprintf(tmp, "Insisting on %s #%d",
    1381                 media_descriptor_string(bkpinfo->backup_media_type),
     1391        mr_asprintf(&tmp, "Insisting on %s #%d",
     1392                bkpinfo->backup_media_string,
    13821393                cd_number_i_want);
    1383         sprintf(request, "Please insert %s #%d and press Enter.",
    1384                 media_descriptor_string(bkpinfo->backup_media_type),
     1394        mr_asprintf(&request, "Please insert %s #%d and press Enter.",
     1395                bkpinfo->backup_media_string,
    13851396                cd_number_i_want);
    13861397        mr_msg(3, tmp);
     1398        mr_free(tmp);
     1399
    13871400        while (what_number_cd_is_this(bkpinfo) != cd_number_i_want) {
    1388             paranoid_system("sync");
     1401            sync();
    13891402            if (is_this_device_mounted(MNT_CDROM)) {
    13901403                res =
     
    13941407            }
    13951408            if (res) {
    1396                 log_to_screen("WARNING - failed to unmount CD-ROM drive");
     1409                log_to_screen(_("WARNING - failed to unmount CD-ROM drive"));
    13971410            }
    13981411            if (!bkpinfo->please_dont_eject) {
     
    14021415            }
    14031416            if (res) {
    1404                 log_to_screen("WARNING - failed to eject CD-ROM disk");
     1417                log_to_screen(_("WARNING - failed to eject CD-ROM disk"));
    14051418            }
    14061419            popup_and_OK(request);
     
    14081421                inject_device(bkpinfo->media_device);
    14091422            }
    1410             paranoid_system("sync");
    1411         }
     1423            sync();
     1424        }
     1425        mr_free(request);
     1426
    14121427        mr_msg(1, "Thankyou. Proceeding...");
    14131428        g_current_media_number = cd_number_i_want;
    14141429    }
    1415     mr_free(tmp);
    1416     mr_free(request);
    1417 }
    1418 
     1430}
    14191431/* @} - end of deviceGroup */
    1420 
    1421 
    1422 
    1423 
    14241432
    14251433
     
    14401448// archiving_to_media is FALSE if I'm being called by mondorestore
    14411449{
    1442     char *tmp;
    1443     char *sz_size;
    1444     char *command;
    1445     char *comment;
    1446     char *prompt;
    1447     int i;
    1448     FILE *fin;
    1449 
    1450     malloc_string(tmp);
    1451     malloc_string(sz_size);
    1452     malloc_string(command);
    1453     malloc_string(comment);
    1454     malloc_string(prompt);
     1450    char *tmp = NULL;
     1451    char *tmp1 = NULL;
     1452    char *tmp2 = NULL;
     1453    char *sz_size = NULL;
     1454    char *command = NULL;
     1455    char *comment = NULL;
     1456    char *prompt = NULL;
     1457    int i = 0;
     1458    FILE *fin = NULL;
     1459
    14551460    assert(bkpinfo != NULL);
    1456     sz_size[0] = '\0';
    14571461    bkpinfo->nonbootable_backup = FALSE;
    14581462
     
    14631467        which_backup_media_type(bkpinfo->restore_data);
    14641468    if (bkpinfo->backup_media_type == none) {
    1465         log_to_screen("User has chosen not to backup the PC");
     1469        log_to_screen(_("User has chosen not to backup the PC"));
    14661470        finish(1);
    14671471    }
    14681472    if (bkpinfo->backup_media_type == tape && bkpinfo->restore_data) {
    1469         popup_and_OK("Please remove CD/floppy from drive(s)");
     1473        popup_and_OK(_("Please remove CD/floppy from drive(s)"));
    14701474    }
    14711475    mr_msg(3, "media type = %s",
     
    14901494            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    14911495                if (ask_me_yes_or_no
    1492                     ("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?"))
     1496                    (_("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")))
    14931497                {
    14941498                    bkpinfo->manual_cd_tray = TRUE;
     
    14971501            if ((bkpinfo->compression_level =
    14981502                 which_compression_level()) == -1) {
    1499                 log_to_screen("User has chosen not to backup the PC");
     1503                log_to_screen(_("User has chosen not to backup the PC"));
    15001504                finish(1);
    15011505            }
    1502             sprintf(comment, "What speed is your %s (re)writer?",
    1503                     media_descriptor_string(bkpinfo->backup_media_type));
     1506            mr_asprintf(&comment, _("What speed is your %s (re)writer?"),
     1507                    bkpinfo->backup_media_string);
    15041508            if (bkpinfo->backup_media_type == dvd) {
    15051509                find_dvd_device(bkpinfo->media_device, FALSE);
    1506                 strcpy(tmp, "1");
    1507                 sprintf(sz_size, "%d", DEFAULT_DVD_DISK_SIZE);  // 4.7 salesman's GB = 4.482 real GB = 4582 MB
     1510                mr_asprintf(&tmp, "1");
     1511                mr_asprintf(&sz_size, "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB
    15081512                mr_msg(1, "Setting to DVD defaults");
    15091513            } else if (bkpinfo->backup_media_type == usb) {
     
    15121516            } else {
    15131517                strcpy(bkpinfo->media_device, VANILLA_SCSI_CDROM);
    1514                 strcpy(tmp, "4");
    1515                 strcpy(sz_size, "650");
     1518                mr_asprintf(&tmp, "4");
     1519                mr_asprintf(&sz_size, "650");
    15161520                mr_msg(1, "Setting to CD defaults");
    15171521            }
    15181522            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    1519                 if (!popup_and_get_string("Speed", comment, tmp, 4)) {
    1520                     log_to_screen("User has chosen not to backup the PC");
     1523                if (!popup_and_get_string(_("Speed"), comment, tmp)) {
     1524                    log_to_screen(_("User has chosen not to backup the PC"));
    15211525                    finish(1);
    15221526                }
    15231527            }
     1528            mr_free(comment);
     1529
    15241530            bkpinfo->cdrw_speed = atoi(tmp);    // if DVD then this shouldn't ever be used anyway :)
    1525             sprintf(comment,
    1526                     "How much data (in Megabytes) will each %s store?",
    1527                     media_descriptor_string(bkpinfo->backup_media_type));
    1528             if (!popup_and_get_string("Size", comment, sz_size, 5)) {
    1529                 log_to_screen("User has chosen not to backup the PC");
     1531            mr_free(tmp);
     1532
     1533            mr_asprintf(&comment,
     1534                    _("How much data (in Megabytes) will each %s store?"),
     1535                    bkpinfo->backup_media_string);
     1536
     1537            if (!popup_and_get_string("Size", comment, sz_size)) {
     1538                log_to_screen(_("User has chosen not to backup the PC"));
    15301539                finish(1);
    15311540            }
     1541            mr_free(comment);
     1542
    15321543            for (i = 0; i <= MAX_NOOF_MEDIA; i++) {
    15331544                bkpinfo->media_size[i] = atoi(sz_size);
    15341545            }
     1546            mr_free(sz_size);
     1547
    15351548            if (bkpinfo->media_size[0] <= 0) {
    1536                 log_to_screen("User has chosen not to backup the PC");
     1549                log_to_screen(_("User has chosen not to backup the PC"));
    15371550                finish(1);
    15381551            }
     
    15541567                mr_msg(1, "bkpinfo->media_device = %s",
    15551568                        bkpinfo->media_device);
    1556                 sprintf(comment,
    1557                         "Please specify your %s drive's /dev entry",
    1558                         media_descriptor_string(bkpinfo->
    1559                                                 backup_media_type));
     1569                mr_asprintf(&comment,
     1570                        _("Please specify your %s drive's /dev entry"),
     1571                        bkpinfo->backup_media_string);
    15601572                if (!popup_and_get_string
    1561                     ("Device?", comment, bkpinfo->media_device,
    1562                      MAX_STR_LEN / 4)) {
    1563                     log_to_screen("User has chosen not to backup the PC");
     1573                    (_("Device?"), comment, bkpinfo->media_device)) {
     1574                    log_to_screen(_("User has chosen not to backup the PC"));
    15641575                    finish(1);
    15651576                }
     1577                mr_free(comment);
    15661578            }
    15671579            mr_msg(2, "%s device found at %s",
    1568                     media_descriptor_string(bkpinfo->backup_media_type),
     1580                    bkpinfo->backup_media_string,
    15691581                    bkpinfo->media_device);
    15701582        } else {
     
    15731585            }
    15741586            if (bkpinfo->media_device[0]) {
    1575                 sprintf(tmp,
    1576                         "I think I've found your %s burner at SCSI node %s. Is this correct? (Say no if you have an IDE burner and you are running a 2.6 kernel. You will then be prompted for further details.)",
    1577                         media_descriptor_string(bkpinfo->
    1578                                                 backup_media_type),
     1587                mr_asprintf(&tmp,
     1588                        _("I think I've found your %s burner at SCSI node %s; Is this correct ? (say no if you have an IDE burner and you are running a 2.6 kernel. You will then be prompted for further details."),
     1589                        bkpinfo->backup_media_string,
    15791590                        bkpinfo->media_device);
    15801591                if (!ask_me_yes_or_no(tmp)) {
    15811592                    bkpinfo->media_device[0] = '\0';
    15821593                }
    1583             }
    1584             if (!bkpinfo->media_device[0]) {
     1594                mr_free(tmp);
     1595            } else {
    15851596                if (g_kernel_version < 2.6) {
    15861597                    i = popup_and_get_string("Device node?",
     
    15951606                }
    15961607                if (!i) {
    1597                     log_to_screen("User has chosen not to backup the PC");
     1608                    log_to_screen(_("User has chosen not to backup the PC"));
    15981609                    finish(1);
    15991610                }
     
    16081619    case udev:
    16091620        if (!ask_me_yes_or_no
    1610             ("This option is for advanced users only. Are you sure?")) {
    1611             log_to_screen("User has chosen not to backup the PC");
     1621            (_("This option is for advanced users only. Are you sure?"))) {
     1622            log_to_screen(_("User has chosen not to backup the PC"));
    16121623            finish(1);
    16131624        }
     
    16321643                }
    16331644            }
    1634             sprintf(tmp,
    1635                     "I think I've found your tape streamer at %s; am I right on the money?",
    1636                     bkpinfo->media_device);
    1637         }
    1638         if (bkpinfo->media_device[0]) {
    1639             sprintf(tmp,
    1640                     "I think I've found your tape streamer at %s; am I right on the money?",
     1645            mr_asprintf(&tmp,
     1646                    _("I think I've found your tape streamer at %s; am I right on the money?"),
    16411647                    bkpinfo->media_device);
    16421648            if (!ask_me_yes_or_no(tmp)) {
    16431649                bkpinfo->media_device[0] = '\0';
    16441650            }
    1645         }
    1646         if (!bkpinfo->media_device[0]) {
     1651            mr_free(tmp);
     1652        } else {
    16471653            if (!popup_and_get_string
    16481654                ("Device name?",
     
    16531659            }
    16541660        }
    1655         sprintf(tmp, "ls -l %s", bkpinfo->media_device);
     1661        mr_asprintf(&tmp, "ls -l %s", bkpinfo->media_device);
    16561662        if (run_program_and_log_output(tmp, FALSE)) {
    1657             log_to_screen("User has not specified a valid /dev entry");
     1663            log_to_screen(_("User has not specified a valid /dev entry"));
    16581664            finish(1);
    16591665        }
     1666        mr_free(tmp);
    16601667        mr_msg(4, "sz_size = %s", sz_size);
    1661         sz_size[0] = '\0';
    1662 /*
    1663     if ((size_sz[0]=='\0' || atol(size_sz)==0) && archiving_to_media)
    1664       {
    1665         if (!popup_and_get_string("Tape size", "How much COMPRESSED data will one of your tape cartridges hold? (e.g. 4GB for 4 gigabytes)", size_sz, 16))
    1666           { log_to_screen("User has chosen not to backup the PC"); finish(1); }
    1667       }
    1668 */
    1669         if (sz_size[0] == '\0') {
    1670             bkpinfo->media_size[0] = 0;
    1671         } else {
    1672             bkpinfo->media_size[0] =
    1673                 friendly_sizestr_to_sizelong(sz_size) / 2 - 50;
    1674         }
     1668        mr_free(sz_size);
     1669        bkpinfo->media_size[0] = 0;
    16751670        mr_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]);
    16761671        if (bkpinfo->media_size[0] <= 0) {
     
    16831678            if ((bkpinfo->compression_level =
    16841679                 which_compression_level()) == -1) {
    1685                 log_to_screen("User has chosen not to backup the PC");
     1680                log_to_screen(_("User has chosen not to backup the PC"));
    16861681                finish(1);
    16871682            }
     
    17131708                if ((bkpinfo->compression_level =
    17141709                     which_compression_level()) == -1) {
    1715                     log_to_screen("User has chosen not to backup the PC");
     1710                    log_to_screen(_("User has chosen not to backup the PC"));
    17161711                    finish(1);
    17171712                }
     
    17191714            // check whether already mounted - we better remove
    17201715            // surrounding spaces and trailing '/' for this
     1716            /* BERLIOS: Useless
    17211717            strip_spaces(bkpinfo->nfs_mount);
     1718            */
    17221719            if (bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] == '/')
    17231720                bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] = '\0';
    1724             sprintf(command, "mount | grep \"%s \" | cut -d' ' -f3",
     1721            mr_asprintf(&command, "mount | grep \"%s \" | cut -d' ' -f3",
    17251722                    bkpinfo->nfs_mount);
    17261723            strcpy(bkpinfo->isodir,
    17271724                   call_program_and_get_last_line_of_output(command));
    1728 
    1729             sprintf(comment,
    1730                     "How much data (in Megabytes) will each media store?");
    1731             if (!popup_and_get_string("Size", comment, sz_size, 5)) {
    1732                 log_to_screen("User has chosen not to backup the PC");
     1725            mr_free(command);
     1726
     1727            mr_asprintf(&comment,
     1728                    _("How much data (in Megabytes) will each media store?"));
     1729            if (!popup_and_get_string(_("Size"), comment, sz_size, 5)) {
     1730                log_to_screen(_("User has chosen not to backup the PC"));
    17331731                finish(1);
    17341732            }
     1733            mr_free(comment);
    17351734            for (i = 0; i <= MAX_NOOF_MEDIA; i++) {
    17361735                bkpinfo->media_size[i] = atoi(sz_size);
    17371736            }
    17381737            if (bkpinfo->media_size[0] <= 0) {
    1739                 log_to_screen("User has chosen not to backup the PC");
     1738                log_to_screen(_("User has chosen not to backup the PC"));
    17401739                finish(1);
    17411740            }
     
    17531752            sprintf(bkpinfo->isodir, "/tmp/isodir.mondo.%d",
    17541753                    (int) (random() % 32768));
    1755             sprintf(command, "mkdir -p %s", bkpinfo->isodir);
     1754            mr_asprintf(&command, "mkdir -p %s", bkpinfo->isodir);
    17561755            run_program_and_log_output(command, 5);
    1757             sprintf(tmp, "mount -t nfs -o nolock %s %s", bkpinfo->nfs_mount,
     1756            mr_free(command);
     1757
     1758            mr_asprintf(&tmp, "mount -t nfs -o nolock %s %s", bkpinfo->nfs_mount,
    17581759                    bkpinfo->isodir);
    17591760            run_program_and_log_output(tmp, 5);
     1761            mr_free(tmp);
    17601762            malloc_string(g_selfmounted_isodir);
    17611763            strcpy(g_selfmounted_isodir, bkpinfo->isodir);
     
    17631765        if (!is_this_device_mounted(bkpinfo->nfs_mount)) {
    17641766            popup_and_OK
    1765                 ("Please mount that partition before you try to backup to or restore from it.");
     1767                (_("Please mount that partition before you try to backup to or restore from it."));
    17661768            finish(1);
    17671769        }
    1768         strcpy(tmp, bkpinfo->nfs_remote_dir);
     1770        mr_asprintf(&tmp, bkpinfo->nfs_remote_dir);
    17691771        if (!popup_and_get_string
    17701772            ("Directory", "Which directory within that mountpoint?", tmp,
     
    17741776        }
    17751777        strcpy(bkpinfo->nfs_remote_dir, tmp);
     1778        mr_free(tmp);
    17761779        // check whether writable - we better remove surrounding spaces for this
    17771780        strip_spaces(bkpinfo->nfs_remote_dir);
    1778         sprintf(command, "echo hi > %s/%s/.dummy.txt", bkpinfo->isodir,
     1781        mr_asprintf(&command, "echo hi > '%s/%s/.dummy.txt'", bkpinfo->isodir,
    17791782                bkpinfo->nfs_remote_dir);
    17801783        while (run_program_and_log_output(command, FALSE)) {
    1781             strcpy(tmp, bkpinfo->nfs_remote_dir);
    1782             sprintf(prompt,
    1783                     "Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup.",
    1784                     bkpinfo->nfs_remote_dir, bkpinfo->isodir);
     1784            mr_asprintf(&tmp, bkpinfo->nfs_remote_dir);
     1785            mr_asprintf(&prompt,
     1786                     _("Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup."),
     1787                     bkpinfo->nfs_remote_dir, bkpinfo->isodir);
    17851788            if (!popup_and_get_string
    17861789                ("Directory", prompt, tmp, MAX_STR_LEN)) {
     
    17881791                finish(1);
    17891792            }
     1793            mr_free(prompt);
     1794
    17901795            strcpy(bkpinfo->nfs_remote_dir, tmp);
     1796            mr_free(tmp);
    17911797            // check whether writable - we better remove surrounding space s for this
    17921798            strip_spaces(bkpinfo->nfs_remote_dir);
    1793             sprintf(command, "echo hi > %s/%s/.dummy.txt", bkpinfo->isodir,
     1799
     1800            mr_free(command);
     1801            mr_asprintf(&command, "echo hi > '%s/%s/.dummy.txt'", bkpinfo->isodir,
    17941802                    bkpinfo->nfs_remote_dir);
    17951803        }
     1804        mr_free(command);
     1805
    17961806        if (!popup_and_get_string
    17971807            ("Prefix.",
     
    18231833                if ((bkpinfo->compression_level =
    18241834                     which_compression_level()) == -1) {
    1825                     log_to_screen("User has chosen not to backup the PC");
     1835                    log_to_screen(_("User has chosen not to backup the PC"));
    18261836                    finish(1);
    18271837                }
     
    18551865            ("I, Mojo Jojo, shall defeat those pesky Powerpuff Girls!");
    18561866    }
    1857 
    18581867    if (archiving_to_media) {
    18591868
     
    19051914            if (i == 'U') {
    19061915                if (ask_me_yes_or_no
    1907                     ("Unidentified boot loader. Shall I restore it byte-for-byte at restore time and hope for the best?"))
     1916                    (_("Unidentified boot loader. Shall I restore it byte-for-byte at restore time and hope for the best?")))
    19081917                {
    19091918                    i = 'R';    // raw
    19101919                } else {
    19111920                    log_to_screen
    1912                         ("I cannot find your boot loader. Please run mondoarchive with parameters.");
     1921                        (_("I cannot find your boot loader. Please run mondoarchive with parameters."));
    19131922                    finish(1);
    19141923                }
     
    19241933            finish(1);
    19251934        }
    1926         strcpy(tmp, list_of_NFS_mounts_only());
     1935        mr_asprintf(&tmp, list_of_NFS_mounts_only());
    19271936        if (strlen(tmp) > 2) {
    19281937            if (bkpinfo->exclude_paths[0]) {
     
    19311940            strncpy(bkpinfo->exclude_paths, tmp, MAX_STR_LEN);
    19321941        }
     1942        mr_free(tmp);
    19331943// NTFS
    1934         strcpy(tmp,
     1944        mr_asprintf(&tmp,
    19351945               call_program_and_get_last_line_of_output
    19361946               ("parted2fdisk -l | grep -i ntfs | awk '{ print $1};' | tr -s '\\n' ' ' | awk '{ print $0};'"));
     
    19451955            strncpy(bkpinfo->image_devs, tmp, MAX_STR_LEN / 4);
    19461956        }
    1947 
     1957        mr_free(tmp);
    19481958
    19491959        if (!popup_and_get_string
     
    19581968        bkpinfo->verify_data =
    19591969            ask_me_yes_or_no
    1960             ("Will you want to verify your backups after Mondo has created them?");
     1970            (_("Will you want to verify your backups after Mondo has created them?"));
    19611971
    19621972#ifndef __FreeBSD__
     
    19691979
    19701980        if (!ask_me_yes_or_no
    1971             ("Are you sure you want to proceed? Hit 'no' to abort.")) {
    1972             log_to_screen("User has chosen not to backup the PC");
     1981            (_("Are you sure you want to proceed? Hit 'no' to abort."))) {
     1982            log_to_screen(_("User has chosen not to backup the PC"));
    19731983            finish(1);
    19741984        }
     
    19851995#else
    19861996    if (bkpinfo->backup_media_type == nfs) {
    1987         sprintf(tmp, "mount | grep \"%s\" | cut -d' ' -f3",
    1988                 bkpinfo->nfs_mount);
    1989 //      strcpy(bkpinfo->isodir, call_program_and_get_last_line_of_output(tmp));
    19901997        mr_msg(3, "I think the NFS mount is mounted at %s",
    19911998                bkpinfo->isodir);
     
    19972004    log_it("media device = %s", bkpinfo->media_device);
    19982005    log_it("media size = %ld", bkpinfo->media_size[1]);
    1999     log_it("media type = %s",
    2000            bkptype_to_string(bkpinfo->backup_media_type));
     2006    log_it("media type = %s", bkpinfo->backup_media_string);
    20012007    log_it("prefix = %s", bkpinfo->prefix);
    20022008    log_it("compression = %ld", bkpinfo->compression_level);
     
    20152021        }
    20162022    }
    2017     mr_free(tmp);
    2018     mr_free(sz_size);
    2019     mr_free(command);
    2020     mr_free(comment);
    2021     mr_free(prompt);
    20222023    return (0);
    20232024}
    2024 
    2025 
    2026 
    20272025
    20282026/**
Note: See TracChangeset for help on using the changeset viewer.