Changeset 2198 in MondoRescue


Ignore:
Timestamp:
May 12, 2009, 2:56:51 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • Protection of chains (file names) passed to system with mr_stresc which may contain strange chars.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-filelist.c

    r2190 r2198  
    13491349 * @bug Return value should be @c void.
    13501350 */
    1351 int open_and_list_dir(char *dir, char *sth, FILE * fout,
     1351int open_and_list_dir(char *dir1, char *sth, FILE * fout,
    13521352                      time_t time_of_last_full_backup)
    13531353{
     
    13591359    char *new;
    13601360    char *tmp;
     1361    char *dir = NULL;
    13611362    static int percentage = 0;
    13621363    char *skip_these;
     
    13771378    time_t this_time;
    13781379
     1380    dir = mr_stresc(dir1, "`$\\\"", '\\');
    13791381    p = strrchr(dir, '/');
    13801382    if (p) {
     
    13981400        // 2.6 has /sys as a proc-type thing -- must be excluded
    13991401        asprintf(&strtmp,
    1400              "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",
     1402             "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",
    14011403             dir, find_excludes, g_skeleton_filelist);
    14021404#else
    14031405        // On BSD, for example, /sys is the kernel sources -- don't exclude
    14041406        asprintf(&strtmp,
    1405              "find %s -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null",
     1407             "find '%s' -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null",
    14061408                dir, find_excludes, g_skeleton_filelist);
    14071409#endif
     
    14231425    {
    14241426        sprintf(find_skeleton_marker,
    1425                 "grep -Fv \"%s\" %s > %s.new 2> /dev/null", dir,
     1427                "grep -Fv '%s' %s > %s.new 2> /dev/null", dir,
    14261428                g_skeleton_filelist, g_skeleton_filelist);
    14271429//    log_msg(0, "fsm = %s", find_skeleton_marker);
     
    15141516    paranoid_free(new_with_spaces);
    15151517    paranoid_free(skip_these);
     1518    paranoid_free(dir);
    15161519
    15171520    if (dip) {
Note: See TracChangeset for help on using the changeset viewer.