Changeset: 97637273ab7e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=97637273ab7e
Modified Files:
clients/mapilib/mapi.c
common/utils/mcrypt.c
Branch: default
Log Message:
Do not exit from library, even when attempting to call unavailable functions.
diffs (92 lines):
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -2646,6 +2646,13 @@ mapi_reconnect(Mapi mid)
return mapi_setError(mid, buf,
"mapi_reconnect", MERROR);
}
+ if (pwdhash == NULL) {
+ snprintf(buf, sizeof(buf), "allocation failure
or unknown hash '%.100s'",
+ serverhash);
+ close_connection(mid);
+ return mapi_setError(mid, buf,
"mapi_reconnect", MERROR);
+ }
+
free(mid->password);
mid->password = malloc(1 + strlen(pwdhash) + 1);
sprintf(mid->password, "\1%s", pwdhash);
diff --git a/common/utils/mcrypt.c b/common/utils/mcrypt.c
--- a/common/utils/mcrypt.c
+++ b/common/utils/mcrypt.c
@@ -97,7 +97,6 @@ mcrypt_MD5Sum(const char *string, size_t
(void) string;
(void) len;
fprintf(stderr, "No MD5 digest function available.\n");
- exit(1);
return NULL;
#endif
}
@@ -135,7 +134,6 @@ mcrypt_SHA1Sum(const char *string, size_
(void) string;
(void) len;
fprintf(stderr, "No SHA1 digest function available.\n");
- exit(1);
return NULL;
#endif
}
@@ -176,7 +174,6 @@ mcrypt_SHA224Sum(const char *string, siz
(void) string;
(void) len;
fprintf(stderr, "No SHA224 digest function available.\n");
- exit(1);
return NULL;
#endif
}
@@ -219,7 +216,6 @@ mcrypt_SHA256Sum(const char *string, siz
(void) string;
(void) len;
fprintf(stderr, "No SHA256 digest function available.\n");
- exit(1);
return NULL;
#endif
}
@@ -266,7 +262,6 @@ mcrypt_SHA384Sum(const char *string, siz
(void) string;
(void) len;
fprintf(stderr, "No SHA384 digest function available.\n");
- exit(1);
return NULL;
#endif
}
@@ -318,7 +313,6 @@ mcrypt_SHA512Sum(const char *string, siz
(void) string;
(void) len;
fprintf(stderr, "No SHA512 digest function available.\n");
- exit(1);
return NULL;
#endif
}
@@ -356,7 +350,6 @@ mcrypt_RIPEMD160Sum(const char *string,
(void) string;
(void) len;
fprintf(stderr, "No RIPEMD160 digest function available.\n");
- exit(1);
return NULL;
#endif
}
@@ -376,7 +369,6 @@ mcrypt_BackendSum(const char *string, si
(void) string;
(void) len;
fprintf(stderr, "No digest function available.\n");
- exit(1);
return NULL;
#endif
}
@@ -492,7 +484,6 @@ mcrypt_hashPassword(
(void) password;
(void) challenge;
fprintf(stderr, "MonetDB was built without OpenSSL, but what
you are trying to do requires it.\n");
- exit(1);
return NULL;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list