From 295f6d4e0f5ed983d8f92d9f3af9073a0560e265 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 7 Feb 2007 05:10:58 +0000 Subject: [PATCH] r11676@catbus: nickm | 2007-02-07 00:10:00 -0500 (Hopefully) final changes for 0.1.2.7-alpha: disable checking for whether the user account in question exists on --service install, since that seems to make windows go boom. We can figure out why later. Also, let the admin specify a password for the target user. svn:r9506 --- ChangeLog | 2 +- src/or/main.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1be546cedc..d4e663cc88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,7 +18,7 @@ Changes in version 0.1.2.7-alpha - 2007-02-06 o Major bugfixes (NT services): - Install as NT_AUTHORITY\LocalService rather than as SYSTEM; add a command-line flag so that admins can override the default by saying - "tor --service install --user "SomeUser"". This will not effect + "tor --service install --user "SomeUser"". This will not affect existing installed services. Also, warn the user that the service will look for its configuration file in the service user's %appdata% directory. (We can't do the 'hardwire the user's appdata diff --git a/src/or/main.c b/src/or/main.c index fef93da49a..d56affb5c3 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -2122,7 +2122,7 @@ nt_service_command_line(int *using_default_torrc) smartlist_free(sl); /* Allocate a string for the NT service command line */ - cmdlen = strlen(tor_exe) + strlen(options) + 32; + cmdlen = strlen(tor_exe) + (options?strlen(options):0) + 32; command = tor_malloc(cmdlen); /* Format the service command */ @@ -2161,6 +2161,7 @@ nt_service_install(int argc, char **argv) char *command; char *errmsg; const char *user_acct = GENSRV_USERACCT; + const char *password = ""; int i; OSVERSIONINFOEX info; SID_NAME_USE sidUse; @@ -2180,11 +2181,16 @@ nt_service_install(int argc, char **argv) service_fns.CloseServiceHandle_fn(hSCManager); return -1; } + for (i=1; i < argc; ++i) { if (!strcmp(argv[i], "--user") && i+1