diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-25 23:44:34 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-27 13:20:08 -0400 |
commit | 48d7c64805757d6c631a4ea2e973652f59058ac3 (patch) | |
tree | 684f8059f38e683782c850ff5b633011457226d4 /src/basic/glob-util.h | |
parent | 1f0f4f3bfd05fd416e3e2dea10ad225b276a6ef7 (diff) | |
download | systemd-48d7c64805757d6c631a4ea2e973652f59058ac3.tar.gz |
basic: add readdir_no_dot and safe_glob functions
safe_glob filters out "." and "..".
This converts all users of glob_extend() and glob_exists() to safe_glob.
Diffstat (limited to 'src/basic/glob-util.h')
-rw-r--r-- | src/basic/glob-util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/glob-util.h b/src/basic/glob-util.h index 5d8fb47a26..e1f6083afa 100644 --- a/src/basic/glob-util.h +++ b/src/basic/glob-util.h @@ -19,12 +19,16 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <glob.h> #include <stdbool.h> #include <string.h> #include "macro.h" #include "string-util.h" +/* Note: this function modifies pglob to set various functions. */ +int safe_glob(const char *path, int flags, glob_t *pglob); + int glob_exists(const char *path); int glob_extend(char ***strv, const char *path); |