Changeset: 84d9c111e7f3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=84d9c111e7f3
Modified Files:
        monetdb5/mal/mal_authorize.h
        monetdb5/mal/mal_import.c
        monetdb5/mal/mal_session.c
        tools/mserver/shutdowntest.c
Branch: default
Log Message:

Make sure we consistently reference the MAL_ADMIN user.
However, MAL_ADMIN should be replaced with a reference
to the DBAdmin and not accidentally the first user connection.


diffs (66 lines):

diff --git a/monetdb5/mal/mal_authorize.h b/monetdb5/mal/mal_authorize.h
--- a/monetdb5/mal/mal_authorize.h
+++ b/monetdb5/mal/mal_authorize.h
@@ -14,7 +14,7 @@
 #include "mal_instruction.h"
 #include "mal_client.h"
 
-#define MAL_ADMIN 0
+#define MAL_ADMIN (oid) 0
 
 mal_export str AUTHcheckCredentials(oid *ret, Client c, const char *user, 
const char *passwd, const char *challenge, const char *algo);
 mal_export str AUTHaddUser(oid *ret, Client c, const char *user, const char 
*pass);
diff --git a/monetdb5/mal/mal_import.c b/monetdb5/mal/mal_import.c
--- a/monetdb5/mal/mal_import.c
+++ b/monetdb5/mal/mal_import.c
@@ -270,7 +270,7 @@ evalFile(str fname, int listing)
                throw(MAL,"mal.eval", "WARNING: could not open file '%s'\n", 
fname);
        }
 
-       c= MCinitClient((oid)0, bstream_create(fd, 128 * BLOCK),0);
+       c= MCinitClient(MAL_ADMIN, bstream_create(fd, 128 * BLOCK),0);
        if( c == NULL){
                throw(MAL,"mal.eval","Can not create user context");
        }
@@ -356,7 +356,7 @@ compileString(Symbol *fcn, Client cntxt,
        strncpy(fdin->buf, qry, len+1);
 
        // compile in context of called for
-       c= MCinitClient((oid)0, fdin, 0);
+       c= MCinitClient(MAL_ADMIN, fdin, 0);
        if( c == NULL){
                GDKfree(qry);
                GDKfree(b);
@@ -423,7 +423,7 @@ callString(Client cntxt, str s, int list
                GDKfree(qry);
                throw(MAL,"callstring", SQLSTATE(HY013) MAL_MALLOC_FAIL);
        }
-       c= MCinitClient((oid)0, bs, cntxt->fdout);
+       c= MCinitClient(MAL_ADMIN, bs, cntxt->fdout);
        if( c == NULL){
                GDKfree(b);
                GDKfree(qry);
diff --git a/monetdb5/mal/mal_session.c b/monetdb5/mal/mal_session.c
--- a/monetdb5/mal/mal_session.c
+++ b/monetdb5/mal/mal_session.c
@@ -33,7 +33,7 @@ malBootstrap(void)
        str msg = MAL_SUCCEED;
        str bootfile = "mal_init";
 
-       c = MCinitClient((oid) 0, NULL, NULL);
+       c = MCinitClient(MAL_ADMIN, NULL, NULL);
        if(c == NULL) {
                throw(MAL, "malBootstrap", "Failed to initialize client");
        }
diff --git a/tools/mserver/shutdowntest.c b/tools/mserver/shutdowntest.c
--- a/tools/mserver/shutdowntest.c
+++ b/tools/mserver/shutdowntest.c
@@ -47,7 +47,7 @@ static void* monetdb_connect(void) {
        if (!monetdb_initialized) {
                return NULL;
        }
-       conn = MCinitClient((oid) 0, bstream_create(GDKstdin, 0), GDKstdout);
+       conn = MCinitClient(MAL_ADMIN, bstream_create(GDKstdin, 0), GDKstdout);
        if (!MCvalid(conn)) {
                return NULL;
        }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to