Changeset 2211 in MondoRescue for branches/2.2.9/mondo/src/common/libmondo-filelist.c
- Timestamp:
- Jun 3, 2009, 7:10:19 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-filelist.c
r2206 r2211 18 18 #include "libmondo-tools-EXT.h" 19 19 #include "mr_string.h" 20 #include "mr_mem.h" 20 21 21 22 #include <time.h> … … 484 485 log_msg(8, "Analyzing %s", file_to_analyze); 485 486 tmp = mr_stresc(file_to_analyze, "`$\\\"(){}[]'*?&|!#~", '\\'); 486 (void)asprintf(&strtmp, syscall_sprintf, tmp);487 mr_asprintf(&strtmp, syscall_sprintf, tmp); 487 488 paranoid_free(tmp); 488 (void)asprintf(&syscall, "%s 2>> /dev/null", strtmp); // " MONDO_LOGFILE);489 mr_asprintf(&syscall, "%s 2>> /dev/null", strtmp); // " MONDO_LOGFILE); 489 490 paranoid_free(strtmp); 490 491 call_exe_and_pipe_output_to_fd(syscall, pout); … … 1389 1390 malloc_string(name_of_evalcall_form); 1390 1391 malloc_string(find_skeleton_marker); 1391 (void)asprintf(&find_excludes, " ");1392 mr_asprintf(&find_excludes, " "); 1392 1393 while((token = mr_strtok (sth, delims, &lastpos))) { 1393 (void)asprintf(&strtmp,"%s", find_excludes);1394 mr_asprintf(&strtmp,"%s", find_excludes); 1394 1395 paranoid_free(find_excludes); 1395 (void)asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token);1396 mr_asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token); 1396 1397 paranoid_free(strtmp); 1397 1398 paranoid_free(token); … … 1399 1400 #if linux 1400 1401 // 2.6 has /sys as a proc-type thing -- must be excluded 1401 (void)asprintf(&strtmp,1402 mr_asprintf(&strtmp, 1402 1403 "find '%s' -fstype mvfs -prune -o -fstype devpts -prune -o -fstype tmpfs -prune -o -fstype proc -prune -o -fstype sysfs -prune -o %s -type d -print > %s 2> /dev/null", 1403 1404 dir, find_excludes, g_skeleton_filelist); 1404 1405 #else 1405 1406 // On BSD, for example, /sys is the kernel sources -- don't exclude 1406 (void)asprintf(&strtmp,1407 mr_asprintf(&strtmp, 1407 1408 "find '%s' -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null", 1408 1409 dir, find_excludes, g_skeleton_filelist); … … 1412 1413 (void)system(strtmp); 1413 1414 paranoid_free(strtmp); 1414 (void)asprintf(&tmp, "wc -l %s | awk '{print $1;}'", g_skeleton_filelist);1415 mr_asprintf(&tmp, "wc -l %s | awk '{print $1;}'", g_skeleton_filelist); 1415 1416 g_skeleton_entries = 1416 1417 1 + atol(call_program_and_get_last_line_of_output(tmp)); … … 1442 1443 #ifndef _XWIN 1443 1444 if (!g_text_mode) { 1444 (void)asprintf(&tmp, "Reading %-68s", dir);1445 mr_asprintf(&tmp, "Reading %-68s", dir); 1445 1446 newtDrawRootText(0, g_noof_rows - 3, tmp); 1446 1447 paranoid_free(tmp); … … 1456 1457 // log_msg(0, "Cataloguing %s", dir); 1457 1458 if (sth[0] == ' ') { 1458 (void)asprintf(&skip_these, "%s", sth);1459 mr_asprintf(&skip_these, "%s", sth); 1459 1460 } else { 1460 (void)asprintf(&skip_these, " %s ", sth);1461 } 1462 (void)asprintf(&new_with_spaces, " %s ", dir);1461 mr_asprintf(&skip_these, " %s ", sth); 1462 } 1463 mr_asprintf(&new_with_spaces, " %s ", dir); 1463 1464 if ((dip = opendir(dir)) == NULL) { 1464 (void)asprintf(&tmp,"opendir %s", dir);1465 mr_asprintf(&tmp,"opendir %s", dir); 1465 1466 log_OS_error(tmp); 1466 1467 paranoid_free(tmp); … … 1472 1473 i++; 1473 1474 if (strcmp(dir, "/")) { 1474 (void)asprintf(&new,"%s/%s",dir,dit->d_name);1475 mr_asprintf(&new,"%s/%s",dir,dit->d_name); 1475 1476 } else { 1476 (void)asprintf(&new,"%s%s",dir,dit->d_name);1477 mr_asprintf(&new,"%s%s",dir,dit->d_name); 1477 1478 } 1478 1479 paranoid_free(new_with_spaces); 1479 (void)asprintf(&new_with_spaces, " %s ", new);1480 mr_asprintf(&new_with_spaces, " %s ", new); 1480 1481 if (strstr(skip_these, new_with_spaces)) { 1481 1482 fprintf(fout, "%s\n", new); … … 1496 1497 counter = 0; 1497 1498 uberctr++; 1498 (void)asprintf(&tmp, " %c ",1499 mr_asprintf(&tmp, " %c ", 1499 1500 special_dot_char(uberctr)); 1500 1501 #ifndef _XWIN … … 1550 1551 bool in_quotes = FALSE; 1551 1552 1552 (void)asprintf(&sz_res, "%s", incoming);1553 mr_asprintf(&sz_res, "%s", incoming); 1553 1554 p = sz_res; 1554 1555 while ((*p != ' ' || in_quotes) && *p != '\0') { … … 1598 1599 fatal_error("Cannot malloc exclude_paths"); 1599 1600 } 1600 (void)asprintf(&sz_datefile,MONDO_CACHE"/difflevel.%d" , 0);1601 mr_asprintf(&sz_datefile,MONDO_CACHE"/difflevel.%d" , 0); 1601 1602 if (!include_paths && !userdef_filelist) { 1602 1603 fatal_error … … 1606 1607 sprintf(command, "mkdir -p %s/archives", scratchdir); 1607 1608 paranoid_system(command); 1608 (void)asprintf(&sz_filelist, "%s/tmpfs/filelist.full", tmpdir);1609 mr_asprintf(&sz_filelist, "%s/tmpfs/filelist.full", tmpdir); 1609 1610 make_hole_for_file(sz_filelist); 1610 1611 … … 1646 1647 log_msg(2, "include_paths = '%s'", include_paths); 1647 1648 log_msg(1, "Calculating filelist"); 1648 (void)asprintf(&tmp2, "%s", call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'"));1649 mr_asprintf(&tmp2, "%s", call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'")); 1649 1650 if (strlen(tmp2) < 1) { 1650 (void)asprintf(&tmp1," ");1651 mr_asprintf(&tmp1," "); 1651 1652 } else { 1652 1653 log_msg(2, "Found windows FS: %s",tmp2); 1653 (void)asprintf(&tmp1, "find %s -name '/win386.swp' -o -name '/hiberfil.sys' -o -name '/pagefile.sys' 2> /dev/null\n",tmp2);1654 mr_asprintf(&tmp1, "find %s -name '/win386.swp' -o -name '/hiberfil.sys' -o -name '/pagefile.sys' 2> /dev/null\n",tmp2); 1654 1655 paranoid_free(tmp2); 1655 (void)asprintf(&tmp2, "%s", call_program_and_get_last_line_of_output(tmp1));1656 mr_asprintf(&tmp2, "%s", call_program_and_get_last_line_of_output(tmp1)); 1656 1657 log_msg(2, "Found windows files: %s",tmp2); 1657 1658 }
Note:
See TracChangeset
for help on using the changeset viewer.