]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/test/test-path-util.c
tmpfiles: use safe_glob()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 26 Apr 2017 03:50:35 +0000 (23:50 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 27 Apr 2017 17:20:30 +0000 (13:20 -0400)
commit84e72b5ef445ffb256bc4add4209c4c9c9855206
tree6eaac86ff5d25339a140e2dc9303e827bf81342c
parent48d7c64805757d6c631a4ea2e973652f59058ac3
tmpfiles: use safe_glob()

This filters out "." and ".." from glob results. Fixes #5655 and #5644.

Any judgements on whether the path is "safe" are removed. We will not remove
"/" under any name (including "/../" and such), but we will remove stuff that
is specified using paths that include "//", "/./" and "/../". Such paths can be
created when joining strings automatically, or for other reasons, and people
generally know what ".." and "." is.

Tests are added to make sure that the helper functions behave as expected.
src/basic/rm-rf.c
src/test/test-path-util.c
src/tmpfiles/tmpfiles.c