Mercurial > hg > vamp-plugin-load-checker
comparison src/helper.cpp @ 51:dd193244d97d
Remove newlines from error messages; try to do something sensible with security errors
author | Chris Cannam |
---|---|
date | Fri, 02 Nov 2018 14:39:51 +0000 |
parents | 5f91094e5680 |
children | 17fb9ff8e072 |
comparison
equal
deleted
inserted
replaced
50:5f91094e5680 | 51:dd193244d97d |
---|---|
251 } | 251 } |
252 } | 252 } |
253 #else | 253 #else |
254 if (!libraryExists(soname)) { | 254 if (!libraryExists(soname)) { |
255 code = PluginCheckCode::FAIL_LIBRARY_NOT_FOUND; | 255 code = PluginCheckCode::FAIL_LIBRARY_NOT_FOUND; |
256 } else if (errno == EPERM) { | |
257 // This may be unreliable, but it seems to be set by | |
258 // something dlopen() calls in the case where a library | |
259 // can't be loaded for code-signing-related reasons on | |
260 // macOS | |
261 code = PluginCheckCode::FAIL_FORBIDDEN; | |
256 } | 262 } |
257 #endif | 263 #endif |
258 return { code, message }; | 264 return { code, message }; |
259 } | 265 } |
260 | 266 |
373 } else { | 379 } else { |
374 if (result.message == "") { | 380 if (result.message == "") { |
375 cout << "FAILURE|" << soname | 381 cout << "FAILURE|" << soname |
376 << "|[" << int(result.code) << "]" << endl; | 382 << "|[" << int(result.code) << "]" << endl; |
377 } else { | 383 } else { |
384 for (size_t i = 0; i < result.message.size(); ++i) { | |
385 if (result.message[i] == '\n' || | |
386 result.message[i] == '\r') { | |
387 result.message[i] = ' '; | |
388 } | |
389 } | |
378 cout << "FAILURE|" << soname | 390 cout << "FAILURE|" << soname |
379 << "|" << result.message << " [" | 391 << "|" << result.message << " [" |
380 << int(result.code) << "]" << endl; | 392 << int(result.code) << "]" << endl; |
381 } | 393 } |
382 allGood = false; | 394 allGood = false; |