+Thu Oct 19 00:59:40 CEST 2000 Wichert Akkerman <wakkerma@debian.org>
+
+ * utils/start-stop-daemon.c
+ + fix a buffer overflow in cmdname handling
+ + Only abort if we fail to open an existing pidfile
+
Wed Oct 18 17:48:15 CEST 2000 Wichert Akkerman <wakkerma@debian.org>
* scripts/dpkg-source.pl: patch from Colin Watson to not rename a
* dpkg-scanpackages now uses the most recent version if multiple versions
of a package are found.
* don't rename a file to itself in dpkg-source. Closes: Bug#75060
+ * Fix buffer overflow in cmdname handling in start-stop-daemon.
+ Closes: Bug#75103
+ * Don't abort if start-stop-daemon tries to read a non-existing pidfile.
+ Closes: Bug#75105
-- Wichert Akkerman <wakkerma@debian.org> UNRELEASED
if (fscanf(f, "%d", &pid) == 1)
check(pid);
fclose(f);
- }
+ } else if (errno != ENOENT)
+ fatal("open pidfile %s: %s", name, strerror(errno));
+
}
/* WTA: this needs to be an autoconf check for /proc/pid existance.
static int
do_stop(void)
{
- char what[1024];
+ char what[2048];
struct pid_list *p;
int retval = 0;
if (cmdname)
- strcpy(what, cmdname);
+ snprintf(what, sizeof(what), "%s", cmdname);
else if (execname)
- strcpy(what, execname);
+ snprintf(what, sizeof(what), "%s", execname);
else if (pidfile)
- sprintf(what, "process in pidfile `%s'", pidfile);
+ snprintf(what, sizeof(what), "process in pidfile `%s'", pidfile);
else if (userspec)
- sprintf(what, "process(es) owned by `%s'", userspec);
+ snprintf(what, sizeof(what), "process(es) owned by `%s'", userspec);
else
fatal("internal error, please report");