mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Fix bug with certificate approval
This commit is contained in:
parent
928838886e
commit
203205849e
@ -203,7 +203,6 @@ approve_cert() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Look for an unused filename.
|
// Look for an unused filename.
|
||||||
string pathname;
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
char buf [PATH_MAX];
|
char buf [PATH_MAX];
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -217,7 +216,7 @@ approve_cert() {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
if (stat(pathname.c_str(), &statbuf) != 0) {
|
if (stat(buf, &statbuf) != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -226,7 +225,7 @@ approve_cert() {
|
|||||||
|
|
||||||
// Sure, there's a slight race condition right now: another process
|
// Sure, there's a slight race condition right now: another process
|
||||||
// might attempt to create the same filename. So what.
|
// might attempt to create the same filename. So what.
|
||||||
FILE *fp = fopen(pathname.c_str(), "w");
|
FILE *fp = fopen(buf, "w");
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
PEM_write_X509(fp, _cert);
|
PEM_write_X509(fp, _cert);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user