OLD | NEW |
1 /* | 1 /* |
2 * softoken.h - private data structures and prototypes for the softoken lib | 2 * softoken.h - private data structures and prototypes for the softoken lib |
3 * | 3 * |
4 * This Source Code Form is subject to the terms of the Mozilla Public | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
5 * License, v. 2.0. If a copy of the MPL was not distributed with this | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
7 | 7 |
8 #ifndef _SOFTOKEN_H_ | 8 #ifndef _SOFTOKEN_H_ |
9 #define _SOFTOKEN_H_ | 9 #define _SOFTOKEN_H_ |
10 | 10 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 /* | 146 /* |
147 ** macros to check for forked child process after C_Initialize | 147 ** macros to check for forked child process after C_Initialize |
148 */ | 148 */ |
149 #if defined(XP_UNIX) && !defined(NO_FORK_CHECK) | 149 #if defined(XP_UNIX) && !defined(NO_FORK_CHECK) |
150 | 150 |
151 #ifdef DEBUG | 151 #ifdef DEBUG |
152 | 152 |
153 #define FORK_ASSERT() \ | 153 #define FORK_ASSERT() \ |
154 { \ | 154 { \ |
155 char* forkAssert = getenv("NSS_STRICT_NOFORK"); \ | 155 char* forkAssert = PR_GetEnvSecure("NSS_STRICT_NOFORK"); \ |
156 if ( (!forkAssert) || (0 == strcmp(forkAssert, "1")) ) { \ | 156 if ( (!forkAssert) || (0 == strcmp(forkAssert, "1")) ) { \ |
157 PORT_Assert(0); \ | 157 PORT_Assert(0); \ |
158 } \ | 158 } \ |
159 } | 159 } |
160 | 160 |
161 #else | 161 #else |
162 | 162 |
163 #define FORK_ASSERT() | 163 #define FORK_ASSERT() |
164 | 164 |
165 #endif | 165 #endif |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 if (!sftkForkCheckDisabled && PARENT_FORKED()) { \ | 232 if (!sftkForkCheckDisabled && PARENT_FORKED()) { \ |
233 FORK_ASSERT(); \ | 233 FORK_ASSERT(); \ |
234 return CKR_DEVICE_ERROR; \ | 234 return CKR_DEVICE_ERROR; \ |
235 } \ | 235 } \ |
236 } while (0) | 236 } while (0) |
237 | 237 |
238 #define SKIP_AFTER_FORK(x) if (!parentForkedAfterC_Initialize) x | 238 #define SKIP_AFTER_FORK(x) if (!parentForkedAfterC_Initialize) x |
239 | 239 |
240 #define ENABLE_FORK_CHECK() \ | 240 #define ENABLE_FORK_CHECK() \ |
241 { \ | 241 { \ |
242 char* doForkCheck = getenv("NSS_STRICT_NOFORK"); \ | 242 char* doForkCheck = PR_GetEnvSecure("NSS_STRICT_NOFORK"); \ |
243 if ( doForkCheck && !strcmp(doForkCheck, "DISABLED") ) { \ | 243 if ( doForkCheck && !strcmp(doForkCheck, "DISABLED") ) { \ |
244 sftkForkCheckDisabled = PR_TRUE; \ | 244 sftkForkCheckDisabled = PR_TRUE; \ |
245 } \ | 245 } \ |
246 } | 246 } |
247 | 247 |
248 | 248 |
249 #else | 249 #else |
250 | 250 |
251 /* non-Unix platforms, or fork check disabled */ | 251 /* non-Unix platforms, or fork check disabled */ |
252 | 252 |
253 #define CHECK_FORK() | 253 #define CHECK_FORK() |
254 #define SKIP_AFTER_FORK(x) x | 254 #define SKIP_AFTER_FORK(x) x |
255 #define ENABLE_FORK_CHECK() | 255 #define ENABLE_FORK_CHECK() |
256 | 256 |
257 #ifndef NO_FORK_CHECK | 257 #ifndef NO_FORK_CHECK |
258 #define NO_FORK_CHECK | 258 #define NO_FORK_CHECK |
259 #endif | 259 #endif |
260 | 260 |
261 #endif | 261 #endif |
262 | 262 |
263 | 263 |
264 SEC_END_PROTOS | 264 SEC_END_PROTOS |
265 | 265 |
266 #endif /* _SOFTOKEN_H_ */ | 266 #endif /* _SOFTOKEN_H_ */ |
OLD | NEW |