summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@cam.ac.uk>2018-12-12 22:32:47 +0000
committerDmitry Bogatov <KAction@debian.org>2018-12-12 22:32:47 +0000
commit74bfe3f09ce9241fd729ab1240d9e7d14683bd0d (patch)
treebd1f0a56df20a14550dcf202c67a6a10eac1b506
parente9bbe70da7a8cd31abefa6544d30b5263a1a60c7 (diff)
improve detection of old style core dumps
The proposed patch is wrong: as written it arranges to reject filenames that begin with ".core", rather than those that end with ".core". Files whose names end ".core" are already rejected by cfgfile_filter(), and files whose names begin ".core" are rejected by the general rejection of filenames beginning with ".". I think the original test is intended to trap old-style core dumps, which are always called simply "core". This could be correctly achieved by: Bug-Debian: bugs.debian.org/611292 Gbp-Pq: Name 150_core_string_test.patch
-rw-r--r--insserv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/insserv.c b/insserv.c
index 849b890..b47e080 100644
--- a/insserv.c
+++ b/insserv.c
@@ -3078,7 +3078,7 @@ int main (int argc, char *argv[])
continue;
}
- if (!strncmp(d->d_name, "core", strlen("core"))) {
+ if (!strcmp(d->d_name, "core")) {
if (isarg)
warn("script name %s is not valid, skipped!\n", d->d_name);
continue;