chiark / gitweb /
tmpfiles: use safe_glob()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 26 Apr 2017 03:50:35 +0000 (23:50 -0400)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:52 +0000 (09:46 +0200)
commit9045f431a2a7d05a3a897829eb2c2f0b77edd2be
tree27ad548a1354f633eebbf1ad27284ed08092f26d
parent42031136036b3da794a2575d91de8378931141ed
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