Commit 3d7f1e91 authored by Baptiste Daroussin's avatar Baptiste Daroussin
Browse files

triggers: only consider .ucl files

parent 0cb9b984
...@@ -287,9 +287,16 @@ triggers_load(bool cleanup_only) ...@@ -287,9 +287,16 @@ triggers_load(bool cleanup_only)
schema = trigger_open_schema(); schema = trigger_open_schema();
while ((e = readdir(d)) != NULL) { while ((e = readdir(d)) != NULL) {
const char *ext;
/* ignore all hidden files */ /* ignore all hidden files */
if (e->d_name[0] == '.') if (e->d_name[0] == '.')
continue; continue;
/* only consider files ending with .ucl */
ext = strrchr(e->d_name, '.');
if (ext == NULL)
continue;
if (strcmp(ext, ".ucl") != 0)
continue;
/* only regular files are considered */ /* only regular files are considered */
if (fstatat(dfd, e->d_name, &st, AT_SYMLINK_NOFOLLOW) != 0) { if (fstatat(dfd, e->d_name, &st, AT_SYMLINK_NOFOLLOW) != 0) {
pkg_emit_errno("fstatat", e->d_name); pkg_emit_errno("fstatat", e->d_name);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment