Ignore:
Timestamp:
Jul 28, 2013, 7:37:35 PM (11 years ago)
Author:
Bruno Cornec
Message:
  • Fix #673 by improving single quote management in mr_stresc, and using single call for getfacl/getfattr and adding tests to test suite.
File:
1 edited

Legend:

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

    r3141 r3171  
    470470        }
    471471        log_msg(8, "Analyzing %s", file_to_analyze);
    472         tmp = mr_stresc(file_to_analyze, " `$\\\"(){}[]'*?&|!#~", '\\');
    473         mr_asprintf(&strtmp, syscall_sprintf, tmp);
     472        tmp = mr_stresc(file_to_analyze, "'", '\\', '\'');
     473        mr_asprintf(&syscall, "%s '%s' 2>> /dev/null", syscall_sprintf, tmp);   // " MONDO_LOGFILE);
    474474        paranoid_free(tmp);
    475         mr_asprintf(&syscall, "%s 2>> /dev/null", strtmp);  // " MONDO_LOGFILE);
    476         paranoid_free(strtmp);
    477475        log_msg(20,"calling %s\n",syscall);
    478476        call_exe_and_pipe_output_to_fd(syscall, pout);
     
    496494        mr_free(command);
    497495
    498         retval =
    499             gen_aux_list(filelist, "getfacl --all-effective -P \"%s\"",
    500                          facl_fname);
     496        retval = gen_aux_list(filelist, "getfacl --all-effective -P ", facl_fname);
    501497    }
    502498    return (retval);
     
    513509        run_program_and_log_output(command, 8);
    514510        mr_free(command);
    515         retval =
    516             gen_aux_list(filelist, "getfattr --en=hex -m - -h -d \"%s\"",
    517                          fattr_fname);
     511        retval = gen_aux_list(filelist, "getfattr --en=hex -m - -h -d ", fattr_fname);
    518512    }
    519513    return (retval);
     
    13501344
    13511345    /* dir is needed when we pass it to the shell */
    1352     dir = mr_stresc(dir1, "`$\\\"(){}'[]&*?|!#~", '\\');
     1346    dir = mr_stresc(dir1, "'", '\\', '\'');
    13531347    p = strrchr(dir1, '/');
    13541348    if (p) {
Note: See TracChangeset for help on using the changeset viewer.