summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-01-11cli: fix arbitrary execution of program bugag/fix-cve-2021-3013Andrew Gallant
This fixes a bug only present on Windows that would permit someoen to execute an arbitrary program if they crafted an appropriate directory tree. Namely, if someone put an executable named 'xz.exe' in the root of a directory tree and one ran 'rg -z foo' from the root of that tree, then the 'xz.exe' executable in that tree would execute if there are any 'xz' files anywhere in the tree. The root cause of this problem is that 'CreateProcess' on Windows will implicitly look in the current working directory for an executable when it is given a relative path to a program. Rust's standard library allows this behavior to occur, so we work around it here. We work around it by explicitly resolving programs like 'xz' via 'PATH'. That way, we only ever pass an absolute path to 'CreateProcess', which avoids the implicit behavior of checking the current working directory. This fix doesn't apply to non-Windows systems as it is believed to only impact Windows. In theory, the bug could apply on Unix if '.' is in one's PATH, but at that point, you reap what you sow. While the extent to which this is a security problem isn't clear, I think users generally expect to be able to download or clone repositories from the Internet and run ripgrep on them without fear of anything too awful happening. Being able to execute an arbitrary program probably violates that expectation. Therefore, CVE-2021-3013[1] was created for this issue. We apply the same logic to the --pre command, since the --pre command is likely in a user's config file and it would be surprising for something that the user is searching to modify which preprocessor command is used. The --pre and -z/--search-zip flags are the only two ways that ripgrep will invoke external programs, so this should cover any possible exploitable cases of this bug. [1] - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3013
2020-11-23ignore-0.4.17ignore-0.4.17Andrew Gallant
2020-11-23cli: fix stdin detection for Powershell on UnixRoey Darwish Dror
It seems that PowerShell uses sockets instead of FIFOs to redirect the output between commands. So add `is_socket` to our `is_readable_stdin` check. This seems unlikely to cause problems and it probably more generally correct than what we had before. In theory, it could cause problems if it produces false positives, in which case, ripgrep will try to read stdin when it should search the current working directory. (And this usually winds up manifesting as ripgrep blocking forever.) But, if the stdin handle reports itself as a socket, then it seems like we should read it. Fixes #1741, Closes #1742
2020-11-23ignore: provide underlying IO ErrorEd Page
`ignore::Error` wraps `std::io::Error` with additional information (as well as expose non-IO errors). For people wanting to inspect what the error is, they have to recursively match the Enum. This provides `io_error` and `into_io_error` helpers to do this for the user. PR #1740
2020-11-22readme: fix link to .debtleb
This is a common thing to forget to do after a release.
2020-11-20ignore/types: add yang file typeJames Harr
YANG is described in RFC 6020 https://tools.ietf.org/html/rfc6020 PR #1736
2020-11-16ci: update to GITHUB_ENVAndrew Gallant
Apparently ::set-env has been completely disabled. Sigh.
2020-11-16doc: update CI links in crate READMEsAndrew Gallant
I switched to GitHub Actions long ago, which replaces both Travis and AppVeyor. Fixes #1732
2020-11-15doc: sync --help output with man pageAndrew Gallant
The man page had the correct usage hints, but the -h/--help output was using an older more incorrect version of the hints. Closes #1730 (again)
2020-11-15doc: clarify that CLI invocation must always be validAndrew Gallant
This comes up as a corner case where folks provide -e/--regexp in a configuration file and then expect to be able to run 'rg' with no args. However, ripgrep fails because it still expects at least one pattern even though one was specified in the config file. This occurs because ripgrep has to parse its CLI parameters before reading the config file. (For log output settings and to handle the --no-config flag.) This initial parse will fail if there are no patterns specified. The only way to solve this that I can see is to somehow relax the requirements of the initial parse. But this is problematic because we would still need to enforce those requirements in cases where we don't do a second parse (when no config file is present). All in all, this doesn't seem like a problem that is worth solving. Closes #1730
2020-11-09ci: install cross from crates.ioTaiki Endo
A new release of cross has been put out, so we no longer need to install it from git. PR #1728
2020-11-03doc: update several links to use httpsAlex Touchet
PR #1724
2020-11-03doc: add missing backtick in FAQStefan VanBuren
PR #1723
2020-11-02printer: tweak binary detection message formatAndrew Gallant
This roughly matches similar changes made in GNU grep recently.
2020-11-02deps: update base64 to 0.13.0Andrew Gallant
2020-11-02deps: bring in all semver updatesAndrew Gallant
This brings in all other semver updates. This did require updating some tests, since bstr changed its debug output for NUL bytes to be a bit more idiomatic.
2020-11-02deps: targeted update of some dependenciesAndrew Gallant
This updates encoding_rs, crossbeam-utils and crossbeam-channel. This serves two purposes. The encoding_rs update fixes a compilation failure on the latest nightly. The crossbeam updates are good sense and to reduce duplicate dependencies such as cfg-if. (Although, we note that the log crate still pulls in cfg-if 0.1, so ripgrep has a duplicate dependency there for now. But it's very small.) Fixes #1721, Closes #1705
2020-10-31ignore/types: add FutharkVanessa McHale
See: https://futhark-lang.org/ PR #1720
2020-10-23ignore/types: generalize bazel type a bitBrandon Adams
Bazel supports `BUILD.bazel` as well as `WORKSPACE.bazel`. In addition, it is common to ship BUILD/WORKSPACE templates for external repositories suffixed with .bazel for easier tool recognition. Co-authored-by: Brandon Adams <brandon.adams@imc.com> PR #1716
2020-10-21globset-0.4.6globset-0.4.6Andrew Gallant
2020-10-19globset: remove regex unicode dependencyAjeet D'Souza
Since the translation from a glob to a regex always disables Unicode in the regex, it follows that we shouldn't need regex's Unicode features enabled. Now, ripgrep enables Unicode features in its regex dependency and of course uses them, which will cause globset to have it enabled in the ripgrep build as well. So this doesn't actually change anything for ripgrep. But this does slim thing downs for folks using globset independently of ripgrep. PR #1712
2020-10-19ignore/types: add a type for minified filesDương Đỗ Minh Châu
Fixes #1710, PR #1711
2020-10-17doc: clarify how -S/--smart-case worksAndrew Gallant
Whether or not smart case kicks in can be a little subtle in some cases. So we document the specific conditions in which it applies. These conditions were taken directly from the public API docs of the `grep-regex` crate: https://docs.rs/grep-regex/0.1.8/grep_regex/struct.RegexMatcherBuilder.html#method.case_smart Fixes #1708
2020-10-16ignore/types: add flatbuffers typeAndrew Pyatkov
See: https://google.github.io/flatbuffers/ PR #1707
2020-10-16doc: elaborate on the function of -u/--unrestricteddana
Fixes #1703
2020-10-14benchsuite/runs: add updated benchmark, with ugrepAndrew Gallant
2020-10-14benchsuite: add ugrep commands to benchmarksAndrew Gallant
2020-10-14benchsuite: remove -a flag from grepAndrew Gallant
It's not quite clear why I added this originally. ripgrep doesn't have its `-a` flag enabled. It's possible I tricked myself into adding it because ripgrep's binary detection has evolved to be more like GNU grep's nowadays. In any case, using `-a` on data that is non-binary can only improve performance because it removes the overhead for checking whether the data is binary or not. So this was giving an artificial boost to GNU grep.
2020-10-14benchsuite: remove sift, pt and ucgAndrew Gallant
None of these tools got particularly popular (except for pt briefly), but they do not appear to be active projects nowadays. While ucg was fast, sift and pt were ecscruiating slow in a number of cases that required special care in the benchmarks. This also fixes the ordering of benchmark output to reflect the ordering in the source of the benchsuite script.
2020-10-14benchsuite: update subtitle URLsAndrew Gallant
Since the English subtitle file actually changed its content, we tweak the benchmark to use a slightly bigger sample that more closely matches the file size of the Russian subtitle file. Also, the BurntSushi/linux repo has been updated and I've confirmed that it builds on my Linux machine. Fixes #1257
2020-09-22spelling: fix various misspellingsJosh Soref
These were found by the check spelling action[1] and reported here[2]. PR #1685 [1] - https://github.com/marketplace/actions/check-spelling [2] - https://github.com/jsoref/ripgrep/commit/6f02d056716a116b643da1de4b53c6f15118fc38#commitcomment-42625778
2020-09-13doc: fix FAQ orderingAndrew Gallant
The actual answers were in a different order than the table of contents. This commit corrects that. No content has been changed.
2020-09-13doc: document cygwin path translation behaviorAndrew Gallant
Kudos to @Pyker for posting more details about this. Closes #1277
2020-08-27deps: upgrade pcre2-sys to 0.2.5Andrew Gallant
This brings in a PR that disables the JIT on certain Apple targets since it doesn't appear to build. See: https://github.com/BurntSushi/rust-pcre2/pull/16
2020-08-19deps: bump pcre2-sys againAndrew Gallant
The pcre2-sys 0.2.3 release was bunk, since it didn't include the PCRE2 source for some reason.
2020-08-19deps: bump pcre2-sysAndrew Gallant
This should bring a compilation time improvement when building static buils of PCRE2 by enabling parallelism for C compilation. Kudos to @JoshTriplett for the tip!
2020-08-19ignore/types: add vcl (#1659)Andy Freeland
VCL is the Varnish Configuration Language used by Varnish and Fastly. https://varnish-cache.org/docs/trunk/users-guide/vcl.html PR #1659
2020-06-25ignore/types: add racketRaimon Grau (rgrau)
PR #1628
2020-06-09ignore/types: add dvcjtrakk
This provides support for DVC files (https://dvc.org/). PR #1608
2020-06-04doc: fix typosMartin Michlmayr
PR #1605
2020-05-29changelog: add empty TBD section to CHANGELOGAndrew Gallant
And update the release checklist to mention this process.
2020-05-29pkg: update brew tap version to 12.1.1Andrew Gallant
2020-05-2912.1.112.1.1Andrew Gallant
2020-05-29changelog: 12.1.1Andrew Gallant
2020-05-29doc: small release checklist updatesAndrew Gallant
In particular, explicitly note when to update the CHANGELOG. Also, tweak the ripgrep introductory message.
2020-05-29core: update minimal dependency versionsAndrew Gallant
2020-05-29grep-0.2.7grep-0.2.7Andrew Gallant
2020-05-29grep: update minimal dependency versionsAndrew Gallant
2020-05-29grep-cli-0.1.5grep-cli-0.1.5Andrew Gallant
2020-05-29ignore-0.4.16ignore-0.4.16Andrew Gallant