projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Readd quotes.
[tinc]
/
src
/
process.c
diff --git
a/src/process.c
b/src/process.c
index
c989532
..
5566510
100644
(file)
--- a/
src/process.c
+++ b/
src/process.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: process.c,v 1.1.2.6
5 2003/08/08 14:48:3
3 guus Exp $
+ $Id: process.c,v 1.1.2.6
6 2003/08/08 17:17:1
3 guus Exp $
*/
#include "system.h"
*/
#include "system.h"
@@
-84,6
+84,7
@@
static SERVICE_STATUS_HANDLE statushandle = 0;
bool install_service(void) {
char command[4096] = "";
char **argp;
bool install_service(void) {
char command[4096] = "";
char **argp;
+ bool space;
manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if(!manager) {
manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if(!manager) {
@@
-98,8
+99,13
@@
bool install_service(void) {
strncat(command, program_name, sizeof(command));
for(argp = g_argv + 1; *argp; argp++) {
strncat(command, program_name, sizeof(command));
for(argp = g_argv + 1; *argp; argp++) {
+ space = strchr(*argp, " ");
strncat(command, " ", sizeof(command));
strncat(command, " ", sizeof(command));
+ if(space)
+ strncat(command, "\"", sizeof(command));
strncat(command, *argp, sizeof(command));
strncat(command, *argp, sizeof(command));
+ if(space)
+ strncat(command, "\"", sizeof(command));
}
service = CreateService(manager, identname, identname,
}
service = CreateService(manager, identname, identname,