BUG: https://bugzilla.samba.org/show_bug.cgi?id=13070
This avoids running event script copies left by a package manager.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
return 0;
}
+ /* Ignore filenames with multiple '.'s */
+ ptr = index(&de->d_name[3], '.');
+ if (ptr != NULL) {
+ return 0;
+ }
+
return 1;
}
As a special case, any eventscript that ends with a '~' character will be
ignored since this is a common postfix that some editors will append to
-older versions of a file.
+older versions of a file. Similarly, any eventscript with multiple '.'s
+will be ignored as package managers can create copies with additional
+suffix starting with '.' (e.g. .rpmnew, .dpkg-dist).
Only executable event scripts are run by CTDB. Any event script that
does not have execute permission is ignored.