Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
triggers: only consider .ucl files
Baptiste Daroussin committed 5 years ago
commit 3d7f1e91a2212f33dc0af7e9ce9cb3446cb4e0e5
parent 0cb9b98
1 file changed +7 -0
modified libpkg/triggers.c
@@ -287,9 +287,16 @@ triggers_load(bool cleanup_only)
	schema = trigger_open_schema();

	while ((e = readdir(d)) != NULL) {
+
		const char *ext;
		/* ignore all hidden files */
		if (e->d_name[0] ==  '.')
			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 */
		if (fstatat(dfd, e->d_name, &st, AT_SYMLINK_NOFOLLOW) != 0) {
			pkg_emit_errno("fstatat", e->d_name);