From f2a8c2e5e03f288c09325669bc6f5973b1d110c4 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Jan 31 2013 21:47:18 +0000 Subject: Ticket #567 - Restart of Admin server from console fails on segfault Bug description: The order of the argument 2 and 3 for PL_strncpyz was not correct. Definition of PL_strncpyz: char * PL_strncpyz(char *dest, const char *src, PRUint32 max); Fix description: This patch exchanges the 2nd and 3rd arguments. Reviewed by Rich (Thank you!!) --- diff --git a/admserv/cgi-src40/restartsrv.c b/admserv/cgi-src40/restartsrv.c index 6e67d9b..87e76bf 100644 --- a/admserv/cgi-src40/restartsrv.c +++ b/admserv/cgi-src40/restartsrv.c @@ -184,10 +184,10 @@ int main(int argc, char *argv[]) break; case 0: #if defined(WITH_SYSTEMD) - PL_strncpyz(line, sizeof(line), "/bin/systemctl restart " PACKAGE_NAME ".service"); + PL_strncpyz(line, "/bin/systemctl restart " PACKAGE_NAME ".service", sizeof(line)); restart(line); #elif defined(ENABLE_SERVICE) - PL_strncpyz(line, sizeof(line), "service " PACKAGE_NAME " restart"); + PL_strncpyz(line, "service " PACKAGE_NAME " restart", sizeof(line)); restart(line); #else if (util_find_file_in_paths(line, sizeof(line), "restart-ds-admin", CMDBINDIR, "../..", "")) {