Mercurial > trustbridge
comparison cinst/nssstore_win.c @ 399:55cbe0a482ce
merged.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 16 Apr 2014 10:01:02 +0200 |
parents | 8090a1bc1b5b |
children | 17e1c8f37d72 |
comparison
equal
deleted
inserted
replaced
398:9e6a2c2033ed | 399:55cbe0a482ce |
---|---|
96 | 96 |
97 write_stream = _fdopen(cHandle, "w"); | 97 write_stream = _fdopen(cHandle, "w"); |
98 for (i = 0; certificates[i]; i++) | 98 for (i = 0; certificates[i]; i++) |
99 { | 99 { |
100 int ret = 0; | 100 int ret = 0; |
101 DEBUGPRINTF("Writing \n"); | |
102 if (remove) | 101 if (remove) |
103 ret = fprintf (write_stream, "R:%s\n", certificates[i]); | 102 ret = fprintf (write_stream, "R:%s\n", certificates[i]); |
104 else | 103 else |
105 ret = fprintf (write_stream, "I:%s\n", certificates[i]); | 104 ret = fprintf (write_stream, "I:%s\n", certificates[i]); |
106 | 105 |
109 DEBUGPRINTF ("Failed to write everything.\n"); | 108 DEBUGPRINTF ("Failed to write everything.\n"); |
110 break; | 109 break; |
111 } | 110 } |
112 } | 111 } |
113 | 112 |
114 DEBUGPRINTF("Write done\n"); | |
115 return true; | 113 return true; |
116 } | 114 } |
117 | 115 |
118 /**@brief Start the process to install / remove | 116 /**@brief Start the process to install / remove |
119 * | 117 * |
153 } | 151 } |
154 /* TODO! if (is_elevated()) | 152 /* TODO! if (is_elevated()) |
155 restrict token -> hChildToken | 153 restrict token -> hChildToken |
156 */ | 154 */ |
157 | 155 |
158 cmd_line_len = wcslen (lpApplicationName) + wcslen(selection_file) + 1; | 156 cmd_line_len = wcslen (lpApplicationName) + wcslen(selection_file) + 2; |
159 lpCommandLine = xmalloc (cmd_line_len * sizeof(wchar_t)); | 157 lpCommandLine = xmalloc (cmd_line_len * sizeof(wchar_t)); |
160 | 158 |
161 wcscpy_s (lpCommandLine, cmd_line_len, lpApplicationName); | 159 wcscpy_s (lpCommandLine, cmd_line_len, lpApplicationName); |
160 wcscpy_s (lpCommandLine, cmd_line_len, L" "); | |
162 wcscat_s (lpCommandLine, cmd_line_len, selection_file); | 161 wcscat_s (lpCommandLine, cmd_line_len, selection_file); |
162 | |
163 DEBUGPRINTF ("Starting %S with command line %S\n", lpApplicationName, lpCommandLine); | |
163 | 164 |
164 success = CreateProcessAsUserW (hToken, | 165 success = CreateProcessAsUserW (hToken, |
165 lpApplicationName, | 166 lpApplicationName, |
166 lpCommandLine, /* Commandline */ | 167 lpCommandLine, /* Commandline */ |
167 NULL, /* Process attributes. Take hToken */ | 168 NULL, /* Process attributes. Take hToken */ |