Changeset 3190 in MondoRescue for branches/3.1/mondo/src/common/libmondo-filelist.c
- Timestamp:
- Sep 25, 2013, 8:55:43 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mondo/src/common/libmondo-filelist.c
r3161 r3190 29 29 30 30 31 extern ssize_t getline(char **lineptr, size_t * n, FILE * stream); 31 32 extern char *MONDO_LOGFILE; 32 33 … … 451 452 } 452 453 log_msg(8, "Analyzing %s", file_to_analyze); 453 tmp = mr_stresc(file_to_analyze, " `$\\\"(){}[]'*?&|!#~", '\\');454 mr_asprintf(s trtmp, syscall_sprintf, tmp);454 tmp = mr_stresc(file_to_analyze, "'", '\\', '\''); 455 mr_asprintf(syscall, "%s '%s' 2>> /dev/null", syscall_sprintf, tmp); // " MONDO_LOGFILE); 455 456 mr_free(tmp); 456 457 mr_asprintf(syscall, "%s 2>> /dev/null", strtmp); // " MONDO_LOGFILE);458 mr_free(strtmp);459 460 457 log_msg(20,"calling %s\n",syscall); 461 458 call_exe_and_pipe_output_to_fd(syscall, pout); … … 480 477 mr_free(command); 481 478 482 retval = 483 gen_aux_list(filelist, "getfacl --all-effective -P \"%s\"", facl_fname); 479 retval = gen_aux_list(filelist, "getfacl --all-effective -P ", facl_fname); 484 480 } 485 481 return (retval); … … 496 492 run_program_and_log_output(command, 8); 497 493 mr_free(command); 498 retval = 499 gen_aux_list(filelist, "getfattr --en=hex -m - -h -d \"%s\"", fattr_fname); 494 retval = gen_aux_list(filelist, "getfattr --en=hex -m - -h -d ", fattr_fname); 500 495 } 501 496 return (retval); … … 1338 1333 1339 1334 /* dir is needed when we pass it to the shell */ 1340 dir = mr_stresc(dir1, " `$\\\"(){}'[]&*?|!#~", '\\');1335 dir = mr_stresc(dir1, "'", '\\', '\''); 1341 1336 p = strrchr(dir1, '/'); 1342 1337 if (p) { … … 1346 1341 } 1347 1342 } 1348 mr_asprintf(find_excludes, " |");1343 mr_asprintf(find_excludes, " "); 1349 1344 1350 1345 if (!depth) { 1351 mr_asprintf(find_excludes, "|");1352 1346 if (sth != NULL) { 1353 while((token = mr_strtok(sth, delims, &lastpos)) ) {1347 while((token = mr_strtok(sth, delims, &lastpos)) != NULL) { 1354 1348 mr_strcat(find_excludes," -path %s -prune -o", token); 1355 1349 mr_free(token); … … 1365 1359 #if linux 1366 1360 // 2.6 has /sys as a proc-type thing -- must be excluded 1367 mr_asprintf(strtmp, "find '%s' -maxdepth %d -fstype mvfs -prune -o -fstype devpts -prune -o -fstype tmpfs -prune -o fstype devtmpfs -prune -o -fstype proc -prune -o -fstype selinuxfs -prune -o -fstype securityfs -prune -o -fstype hugetlbfs -o -fstype cgroup -prune -prune -o -fstype mqueue -prune -o -fstype debugfs -prune -o -fstype sysfs -prune -o -fstype rpc_pipefs -prune -o -fstype none -prune -o %s -type d -print > %s 2> /dev/null", dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);1361 mr_asprintf(strtmp, "find '%s' -maxdepth %d -fstype mvfs -prune -o -fstype devpts -prune -o -fstype tmpfs -prune -o -fstype devtmpfs -prune -o -fstype proc -prune -o -fstype selinuxfs -prune -o -fstype securityfs -prune -o -fstype hugetlbfs -o -fstype cgroup -prune -prune -o -fstype mqueue -prune -o -fstype debugfs -prune -o -fstype sysfs -prune -o -fstype rpc_pipefs -prune -o -fstype none -prune -o %s -type d -print > %s 2> /dev/null", dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist); 1368 1362 #else 1369 1363 // On BSD, for example, /sys is the kernel sources -- don't exclude … … 1422 1416 // log_msg(0, "Cataloguing %s", dir); 1423 1417 mr_asprintf(skip_these, "|%s|", sth); 1418 1424 1419 mr_asprintf(new_with_pipe, "|%s|", dir1); 1425 1420 if ((dip = opendir(dir1)) == NULL) { … … 1441 1436 } 1442 1437 mr_free(new_with_pipe); 1438 mr_asprintf(new_with_pipe, "|%s|", new); 1443 1439 if (strstr(skip_these, new_with_pipe)) { 1444 1440 fprintf(fout, "%s\n", new); … … 1493 1489 1494 1490 1495 1496 1491 /** 1497 1492 * Create the filelist for the backup. It will be stored in [scratchdir]/archives/filelist.full. … … 1592 1587 mr_asprintf(g_skeleton_filelist, "%s/tmpfs/skeleton.txt", bkpinfo->tmpdir); 1593 1588 make_hole_for_file(g_skeleton_filelist); 1589 1594 1590 log_msg(4, "g_skeleton_entries = %ld", g_skeleton_entries); 1595 1591 log_msg(2, "Opening out filelist to %s", sz_filelist); … … 1597 1593 fatal_error("Cannot openout to sz_filelist"); 1598 1594 } 1599 if (( !include_paths) ||(strlen(include_paths) == 0)) {1595 if ((include_paths != NULL) && (strlen(include_paths) == 0)) { 1600 1596 log_msg(1, "Including only '/' in %s", sz_filelist); 1601 1597 open_and_list_dir("/", exclude_paths, fout, … … 1668 1664 1669 1665 if (bkpinfo->make_filelist) { 1670 res = 1671 mondo_makefilelist(MONDO_LOGFILE, bkpinfo->include_paths, bkpinfo->exclude_paths, bkpinfo->differential, NULL); 1666 res = mondo_makefilelist(MONDO_LOGFILE, bkpinfo->include_paths, bkpinfo->exclude_paths, bkpinfo->differential, NULL); 1672 1667 } else { 1673 res = 1674 mondo_makefilelist(MONDO_LOGFILE, NULL, bkpinfo->exclude_paths, bkpinfo->differential, bkpinfo->include_paths); 1668 res = mondo_makefilelist(MONDO_LOGFILE, NULL, bkpinfo->exclude_paths, bkpinfo->differential, bkpinfo->include_paths); 1675 1669 } 1676 1670 … … 1799 1793 } 1800 1794 log_msg(5, "Found '%s'", fname); 1801 tmp = mr_stresc(fname, "[]*?", '\\' );1795 tmp = mr_stresc(fname, "[]*?", '\\', "'"); 1802 1796 mr_free(fname); 1803 1797 fname = tmp;
Note:
See TracChangeset
for help on using the changeset viewer.