Changeset 1126 in MondoRescue for branches/stable/mondo
- Timestamp:
- Feb 10, 2007, 1:21:15 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/libmondo-devices.c
r1125 r1126 18 18 #include "libmondo-stream-EXT.h" 19 19 #include "mr_mem.h" 20 #include "mr_msg .h"20 #include "mr_msg" 21 21 22 22 #include <sys/ioctl.h> … … 1178 1178 char *device = NULL; 1179 1179 char *mddevice = NULL; 1180 char command[MAX_STR_LEN];1180 char *command = NULL; 1181 1181 int vndev = 2; 1182 1182 1183 if (atoi 1183 1184 (call_program_and_get_last_line_of_output 1184 1185 ("/sbin/sysctl -n kern.osreldate")) < 500000) { 1185 1186 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 1188 1192 if (vndev > 10) { 1193 mr_free(command); 1194 mr_free(mddevice); 1189 1195 return NULL; 1190 1196 } 1191 1197 } 1192 1198 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 1196 1205 if (!strstr(mddevice, "md")) { 1206 mr_free(mddevice); 1197 1207 return NULL; 1198 1208 } 1199 1209 } 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 } 1204 1214 1205 1215 … … 1214 1224 int kick_vn(char *dname) 1215 1225 { 1216 char command[MAX_STR_LEN]; 1226 char *command; 1227 int ret = 0; 1217 1228 1218 1229 if (strncmp(dname, "/dev/", 5) == 0) { … … 1223 1234 (call_program_and_get_last_line_of_output 1224 1235 ("/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 returnsystem(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); 1232 1243 } 1233 1244 #endif … … 1327 1338 1328 1339 /*@ buffers ********************************************************* */ 1329 char *tmp ;1330 char *request ;1340 char *tmp = NULL; 1341 char *request = NULL; 1331 1342 1332 1343 assert(bkpinfo != NULL); … … 1340 1351 return; 1341 1352 } 1342 malloc_string(tmp); 1343 malloc_string(request); 1344 sprintf(tmp, "mkdir -p " MNT_CDROM); 1353 mr_asprintf(&tmp, "mkdir -p " MNT_CDROM); 1345 1354 run_program_and_log_output(tmp, 5); 1355 mr_free(tmp); 1356 1346 1357 if (g_ISO_restore_mode || bkpinfo->backup_media_type == iso 1347 1358 || bkpinfo->backup_media_type == nfs) { … … 1354 1365 } 1355 1366 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, 1357 1368 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 1358 1369 cd_number_i_want); 1359 1370 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", 1361 1373 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 1362 1374 cd_number_i_want); … … 1372 1384 fatal_error("Mommy!"); 1373 1385 } 1374 // g_current_media_number = cd_number_i_want; 1375 // return; 1386 mr_free(tmp); 1376 1387 } 1377 1388 if ((res = what_number_cd_is_this(bkpinfo)) != cd_number_i_want) { 1378 1389 mr_msg(3, "Currently, we hold %d but we want %d", res, 1379 1390 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, 1382 1393 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, 1385 1396 cd_number_i_want); 1386 1397 mr_msg(3, tmp); 1398 mr_free(tmp); 1399 1387 1400 while (what_number_cd_is_this(bkpinfo) != cd_number_i_want) { 1388 paranoid_system("sync");1401 sync(); 1389 1402 if (is_this_device_mounted(MNT_CDROM)) { 1390 1403 res = … … 1394 1407 } 1395 1408 if (res) { 1396 log_to_screen( "WARNING - failed to unmount CD-ROM drive");1409 log_to_screen(_("WARNING - failed to unmount CD-ROM drive")); 1397 1410 } 1398 1411 if (!bkpinfo->please_dont_eject) { … … 1402 1415 } 1403 1416 if (res) { 1404 log_to_screen( "WARNING - failed to eject CD-ROM disk");1417 log_to_screen(_("WARNING - failed to eject CD-ROM disk")); 1405 1418 } 1406 1419 popup_and_OK(request); … … 1408 1421 inject_device(bkpinfo->media_device); 1409 1422 } 1410 paranoid_system("sync"); 1411 } 1423 sync(); 1424 } 1425 mr_free(request); 1426 1412 1427 mr_msg(1, "Thankyou. Proceeding..."); 1413 1428 g_current_media_number = cd_number_i_want; 1414 1429 } 1415 mr_free(tmp); 1416 mr_free(request); 1417 } 1418 1430 } 1419 1431 /* @} - end of deviceGroup */ 1420 1421 1422 1423 1424 1432 1425 1433 … … 1440 1448 // archiving_to_media is FALSE if I'm being called by mondorestore 1441 1449 { 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 1455 1460 assert(bkpinfo != NULL); 1456 sz_size[0] = '\0';1457 1461 bkpinfo->nonbootable_backup = FALSE; 1458 1462 … … 1463 1467 which_backup_media_type(bkpinfo->restore_data); 1464 1468 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")); 1466 1470 finish(1); 1467 1471 } 1468 1472 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)")); 1470 1474 } 1471 1475 mr_msg(3, "media type = %s", … … 1490 1494 if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) { 1491 1495 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?"))) 1493 1497 { 1494 1498 bkpinfo->manual_cd_tray = TRUE; … … 1497 1501 if ((bkpinfo->compression_level = 1498 1502 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")); 1500 1504 finish(1); 1501 1505 } 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); 1504 1508 if (bkpinfo->backup_media_type == dvd) { 1505 1509 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 MB1510 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 1508 1512 mr_msg(1, "Setting to DVD defaults"); 1509 1513 } else if (bkpinfo->backup_media_type == usb) { … … 1512 1516 } else { 1513 1517 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"); 1516 1520 mr_msg(1, "Setting to CD defaults"); 1517 1521 } 1518 1522 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")); 1521 1525 finish(1); 1522 1526 } 1523 1527 } 1528 mr_free(comment); 1529 1524 1530 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")); 1530 1539 finish(1); 1531 1540 } 1541 mr_free(comment); 1542 1532 1543 for (i = 0; i <= MAX_NOOF_MEDIA; i++) { 1533 1544 bkpinfo->media_size[i] = atoi(sz_size); 1534 1545 } 1546 mr_free(sz_size); 1547 1535 1548 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")); 1537 1550 finish(1); 1538 1551 } … … 1554 1567 mr_msg(1, "bkpinfo->media_device = %s", 1555 1568 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); 1560 1572 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")); 1564 1575 finish(1); 1565 1576 } 1577 mr_free(comment); 1566 1578 } 1567 1579 mr_msg(2, "%s device found at %s", 1568 media_descriptor_string(bkpinfo->backup_media_type),1580 bkpinfo->backup_media_string, 1569 1581 bkpinfo->media_device); 1570 1582 } else { … … 1573 1585 } 1574 1586 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, 1579 1590 bkpinfo->media_device); 1580 1591 if (!ask_me_yes_or_no(tmp)) { 1581 1592 bkpinfo->media_device[0] = '\0'; 1582 1593 } 1583 }1584 if (!bkpinfo->media_device[0]){1594 mr_free(tmp); 1595 } else { 1585 1596 if (g_kernel_version < 2.6) { 1586 1597 i = popup_and_get_string("Device node?", … … 1595 1606 } 1596 1607 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")); 1598 1609 finish(1); 1599 1610 } … … 1608 1619 case udev: 1609 1620 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")); 1612 1623 finish(1); 1613 1624 } … … 1632 1643 } 1633 1644 } 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?"), 1641 1647 bkpinfo->media_device); 1642 1648 if (!ask_me_yes_or_no(tmp)) { 1643 1649 bkpinfo->media_device[0] = '\0'; 1644 1650 } 1645 }1646 if (!bkpinfo->media_device[0]){1651 mr_free(tmp); 1652 } else { 1647 1653 if (!popup_and_get_string 1648 1654 ("Device name?", … … 1653 1659 } 1654 1660 } 1655 sprintf(tmp, "ls -l %s", bkpinfo->media_device);1661 mr_asprintf(&tmp, "ls -l %s", bkpinfo->media_device); 1656 1662 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")); 1658 1664 finish(1); 1659 1665 } 1666 mr_free(tmp); 1660 1667 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; 1675 1670 mr_msg(4, "media_size[0] = %ld", bkpinfo->media_size[0]); 1676 1671 if (bkpinfo->media_size[0] <= 0) { … … 1683 1678 if ((bkpinfo->compression_level = 1684 1679 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")); 1686 1681 finish(1); 1687 1682 } … … 1713 1708 if ((bkpinfo->compression_level = 1714 1709 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")); 1716 1711 finish(1); 1717 1712 } … … 1719 1714 // check whether already mounted - we better remove 1720 1715 // surrounding spaces and trailing '/' for this 1716 /* BERLIOS: Useless 1721 1717 strip_spaces(bkpinfo->nfs_mount); 1718 */ 1722 1719 if (bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] == '/') 1723 1720 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", 1725 1722 bkpinfo->nfs_mount); 1726 1723 strcpy(bkpinfo->isodir, 1727 1724 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")); 1733 1731 finish(1); 1734 1732 } 1733 mr_free(comment); 1735 1734 for (i = 0; i <= MAX_NOOF_MEDIA; i++) { 1736 1735 bkpinfo->media_size[i] = atoi(sz_size); 1737 1736 } 1738 1737 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")); 1740 1739 finish(1); 1741 1740 } … … 1753 1752 sprintf(bkpinfo->isodir, "/tmp/isodir.mondo.%d", 1754 1753 (int) (random() % 32768)); 1755 sprintf(command, "mkdir -p %s", bkpinfo->isodir);1754 mr_asprintf(&command, "mkdir -p %s", bkpinfo->isodir); 1756 1755 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, 1758 1759 bkpinfo->isodir); 1759 1760 run_program_and_log_output(tmp, 5); 1761 mr_free(tmp); 1760 1762 malloc_string(g_selfmounted_isodir); 1761 1763 strcpy(g_selfmounted_isodir, bkpinfo->isodir); … … 1763 1765 if (!is_this_device_mounted(bkpinfo->nfs_mount)) { 1764 1766 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.")); 1766 1768 finish(1); 1767 1769 } 1768 strcpy(tmp, bkpinfo->nfs_remote_dir);1770 mr_asprintf(&tmp, bkpinfo->nfs_remote_dir); 1769 1771 if (!popup_and_get_string 1770 1772 ("Directory", "Which directory within that mountpoint?", tmp, … … 1774 1776 } 1775 1777 strcpy(bkpinfo->nfs_remote_dir, tmp); 1778 mr_free(tmp); 1776 1779 // check whether writable - we better remove surrounding spaces for this 1777 1780 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, 1779 1782 bkpinfo->nfs_remote_dir); 1780 1783 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); 1785 1788 if (!popup_and_get_string 1786 1789 ("Directory", prompt, tmp, MAX_STR_LEN)) { … … 1788 1791 finish(1); 1789 1792 } 1793 mr_free(prompt); 1794 1790 1795 strcpy(bkpinfo->nfs_remote_dir, tmp); 1796 mr_free(tmp); 1791 1797 // check whether writable - we better remove surrounding space s for this 1792 1798 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, 1794 1802 bkpinfo->nfs_remote_dir); 1795 1803 } 1804 mr_free(command); 1805 1796 1806 if (!popup_and_get_string 1797 1807 ("Prefix.", … … 1823 1833 if ((bkpinfo->compression_level = 1824 1834 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")); 1826 1836 finish(1); 1827 1837 } … … 1855 1865 ("I, Mojo Jojo, shall defeat those pesky Powerpuff Girls!"); 1856 1866 } 1857 1858 1867 if (archiving_to_media) { 1859 1868 … … 1905 1914 if (i == 'U') { 1906 1915 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?"))) 1908 1917 { 1909 1918 i = 'R'; // raw 1910 1919 } else { 1911 1920 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.")); 1913 1922 finish(1); 1914 1923 } … … 1924 1933 finish(1); 1925 1934 } 1926 strcpy(tmp, list_of_NFS_mounts_only());1935 mr_asprintf(&tmp, list_of_NFS_mounts_only()); 1927 1936 if (strlen(tmp) > 2) { 1928 1937 if (bkpinfo->exclude_paths[0]) { … … 1931 1940 strncpy(bkpinfo->exclude_paths, tmp, MAX_STR_LEN); 1932 1941 } 1942 mr_free(tmp); 1933 1943 // NTFS 1934 strcpy(tmp,1944 mr_asprintf(&tmp, 1935 1945 call_program_and_get_last_line_of_output 1936 1946 ("parted2fdisk -l | grep -i ntfs | awk '{ print $1};' | tr -s '\\n' ' ' | awk '{ print $0};'")); … … 1945 1955 strncpy(bkpinfo->image_devs, tmp, MAX_STR_LEN / 4); 1946 1956 } 1947 1957 mr_free(tmp); 1948 1958 1949 1959 if (!popup_and_get_string … … 1958 1968 bkpinfo->verify_data = 1959 1969 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?")); 1961 1971 1962 1972 #ifndef __FreeBSD__ … … 1969 1979 1970 1980 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")); 1973 1983 finish(1); 1974 1984 } … … 1985 1995 #else 1986 1996 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));1990 1997 mr_msg(3, "I think the NFS mount is mounted at %s", 1991 1998 bkpinfo->isodir); … … 1997 2004 log_it("media device = %s", bkpinfo->media_device); 1998 2005 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); 2001 2007 log_it("prefix = %s", bkpinfo->prefix); 2002 2008 log_it("compression = %ld", bkpinfo->compression_level); … … 2015 2021 } 2016 2022 } 2017 mr_free(tmp);2018 mr_free(sz_size);2019 mr_free(command);2020 mr_free(comment);2021 mr_free(prompt);2022 2023 return (0); 2023 2024 } 2024 2025 2026 2027 2025 2028 2026 /**
Note:
See TracChangeset
for help on using the changeset viewer.