From: Matthew Dillon Date: Mon, 17 Dec 2018 21:46:11 +0000 (-0800) Subject: hammer1 - Fix left-over /va/run/hammer.cleanup files X-Git-Tag: v5.7.0~674 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/1156c9984630019bb54e3ad45aebf5b8768b9873 hammer1 - Fix left-over /va/run/hammer.cleanup files * Fix an incorrect API call by hammer1 to the pidfile_*() functions in libutil. This caused hammer1 to leave its lock files sitting in /var/run due to a use-after-free that reared its ugly head after the version update. Reported-by: JustinS --- diff --git a/sbin/hammer/cmd_cleanup.c b/sbin/hammer/cmd_cleanup.c index 87b1585938..d5f993e07a 100644 --- a/sbin/hammer/cmd_cleanup.c +++ b/sbin/hammer/cmd_cleanup.c @@ -535,10 +535,12 @@ do_cleanup(const char *path) /* * Cleanup, and delay a little + * + * NOTE: pidfile_remove() closes, removes, and frees the pfh. + * pidfile_close() closes and frees. */ close(fd); usleep(1000); - pidfile_close(pfh); pidfile_remove(pfh); }