Package: insserv / 1.14.0-5

150_core_string_test.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: 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:
Author: Ben Harris <bjh21@cam.ac.uk>
Bug-Debian: bugs.debian.org/611292
---
--- a/insserv.c
+++ b/insserv.c
@@ -2768,7 +2768,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;