Mercurial > trustbridge
comparison cinst/windowsstore.c @ 624:736e95c63b86
Log access to windows stores
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 20 Jun 2014 12:17:47 +0200 |
parents | 3cf72c5282e8 |
children | f595fcbe3e76 |
comparison
equal
deleted
inserted
replaced
623:5042ace08cba | 624:736e95c63b86 |
---|---|
56 void | 56 void |
57 do_remove(HCERTSTORE hStore, char **to_remove) | 57 do_remove(HCERTSTORE hStore, char **to_remove) |
58 { | 58 { |
59 PCCERT_CONTEXT pCert = NULL; | 59 PCCERT_CONTEXT pCert = NULL; |
60 unsigned int i = 0; | 60 unsigned int i = 0; |
61 bool elevated = is_elevated(); | |
61 | 62 |
62 if (!to_remove) | 63 if (!to_remove) |
63 { | 64 { |
64 return; | 65 return; |
65 } | 66 } |
106 char *error = getLastErrorMsg(); | 107 char *error = getLastErrorMsg(); |
107 printf ("Error deleting certificate. %s", error); | 108 printf ("Error deleting certificate. %s", error); |
108 free (error); | 109 free (error); |
109 continue; | 110 continue; |
110 } | 111 } |
112 log_certificate (elevated ? "Local Machine" : "Current User", | |
113 to_remove[i], false); | |
111 } | 114 } |
112 return; | 115 return; |
113 } | 116 } |
114 | 117 |
115 void | 118 void |
116 do_install(HCERTSTORE hStore, char **to_install) | 119 do_install(HCERTSTORE hStore, char **to_install) |
117 { | 120 { |
118 int i = 0, | 121 int i = 0, |
119 ret = -1; | 122 ret = -1; |
123 bool elevated = is_elevated(); | |
120 | 124 |
121 if (!to_install) | 125 if (!to_install) |
122 { | 126 { |
123 return; | 127 return; |
124 } | 128 } |
162 { | 166 { |
163 printf ("Failed to add certificate: %s \n", error); | 167 printf ("Failed to add certificate: %s \n", error); |
164 free (error); | 168 free (error); |
165 } | 169 } |
166 } | 170 } |
171 log_certificate (elevated ? "Local Machine" : "Current User", | |
172 to_install[i], true); | |
167 } | 173 } |
168 return; | 174 return; |
169 } | 175 } |
170 | 176 |
171 int | 177 int |