Changeset: 6019abc61afd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6019abc61afd
Modified Files:
        NT/monetdb_config.h.in
        clients/Tests/exports.stable.out
        common/options/monet_options.c
        common/utils/msabaoth.c
        common/utils/msabaoth.h
        configure.ag
        monetdb5/mal/mal.c
        monetdb5/mal/mal.h
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_resource.c
        monetdb5/mal/mal_session.c
        monetdb5/modules/atoms/uuid.c
        monetdb5/modules/mal/clients.c
        monetdb5/tools/Tests/mserver5--help.stable.err
        monetdb5/tools/Tests/mserver5--help.stable.err.Windows
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/vaults/bam/Tests/bam_lib_mal.stable.err
        sql/backends/monet5/vaults/bam/Tests/bam_lib_mal.stable.out
        
sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128
        testing/Mtest.py.in
        tools/merovingian/daemon/forkmserver.c
        tools/mserver/mserver5.c
Branch: cmake-fun
Log Message:

Merge with default again (it didn't had sql_gencode.c changes),


diffs (truncated from 451 to 300 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -136,9 +136,6 @@
 /* Define if you have the CommonCrypto library */
 /* #undef HAVE_COMMONCRYPTO */
 
-/* If the console should be used */
-#define HAVE_CONSOLE 1
-
 /* Define to 1 if you have the `ctime_r' function. */
 #define HAVE_CTIME_R 1
 
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -300,21 +300,6 @@ AC_ARG_ENABLE(py3integration,
        enable_py3integration=$enableval,
        enable_py3integration=$dft_py3integration)
 
-# The console is a direct client hooked onto the kernel with full
-# administrative privileges, bypassing any security checks.  It is
-# handy only during development.
-# We simply can't disable it for now because Testing gets hopelessly
-# upset about it, but we can offer to the user to disable it for
-# increased security.
-dft_console=yes
-AC_ARG_ENABLE([console],
-       [AS_HELP_STRING([--enable-console],
-               [enables direct console on the server (involves security risks) 
(default=yes)])],
-       [enable_console="$enableval"],
-       [enable_console=$dft_console])
-AS_VAR_IF([enable_console], [no], [],
-       [AC_DEFINE([HAVE_CONSOLE], 1, [If the console should be used])])
-
 dft_int128=auto
 AC_ARG_ENABLE([int128],
        [AS_HELP_STRING([--enable-int128],
@@ -2954,7 +2939,6 @@ for comp in \
        'monetdb5      ' \
        'sql           ' \
        'geom          ' \
-       'console       ' \
        'py2integration' \
        'py3integration' \
        'rintegration  ' \
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -7,11 +7,10 @@
  */
 
 /*
- * Clients gain access to the Monet server through a internet connection
- * or through its server console.  Access through the internet requires
- * a client program at the source, which addresses the default port of a
- * running server.  The functionality of the server console is limited.
- * It is a textual interface for expert use.
+ * Clients gain access to the Monet server through a internet connection.  
+ * Access through the internet requires a client program at the source, 
+ * which addresses the default port of a running server. It is a textual 
+ * interface for expert use.
  *
  * At the server side, each client is represented by a session record
  * with the current status, such as name, file descriptors, namespace,
@@ -19,8 +18,7 @@
  * control.
  *
  * The number of clients permitted concurrent access is a run time
- * option. The console is the first and is always present.  It reads
- * from standard input and writes to standard output.
+ * option. 
  *
  * Client sessions remain in existence until the corresponding
  * communication channels break.
@@ -77,9 +75,7 @@ MCinit(void)
                }
        }
 
-       MAL_MAXCLIENTS =
-               /* console */ 1 +
-               /* client connections */ maxclients;
+       MAL_MAXCLIENTS = /* client connections */ maxclients;
        mal_clients = GDKzalloc(sizeof(ClientRec) * MAL_MAXCLIENTS);
        if( mal_clients == NULL){
                fprintf(stderr,"#MCinit:" MAL_MALLOC_FAIL);
@@ -138,11 +134,6 @@ MCnewClient(void)
 {
        Client c;
        MT_lock_set(&mal_contextLock);
-       if (mal_clients[CONSOLE].user && mal_clients[CONSOLE].mode == 
FINISHCLIENT) {
-               /*system shutdown in progress */
-               MT_lock_unset(&mal_contextLock);
-               return NULL;
-       }
        for (c = mal_clients; c < mal_clients + MAL_MAXCLIENTS; c++) {
                if (c->mode == FREECLIENT) {
                        c->mode = RUNCLIENT;
@@ -227,7 +218,6 @@ MCinitClientRecord(Client c, oid user, b
        c->listing = 0;
        c->fdout = fout ? fout : GDKstdout;
        c->mdb = 0;
-       c->history = 0;
        c->curprg = c->backup = 0;
        c->glb = 0;
 
@@ -474,9 +464,9 @@ MCstopClients(Client cntxt)
        Client c = mal_clients;
 
        MT_lock_set(&mal_contextLock);
-       for(c= mal_clients +1;  c < mal_clients+MAL_MAXCLIENTS; c++)
-       if( cntxt != c){
-               if ( c->mode == RUNCLIENT)
+       for(c = mal_clients;  c < mal_clients+MAL_MAXCLIENTS; c++)
+       if (cntxt != c){
+               if (c->mode == RUNCLIENT)
                        c->mode = FINISHCLIENT; 
                else if (c->mode == FREECLIENT)
                        c->mode = BLOCKCLIENT;
@@ -491,13 +481,13 @@ MCactiveClients(void)
        int freeclient=0, finishing=0, running=0, blocked = 0;
        Client cntxt = mal_clients;
 
-       for(cntxt= mal_clients+1;  cntxt<mal_clients+MAL_MAXCLIENTS; cntxt++){
+       for(cntxt = mal_clients;  cntxt<mal_clients+MAL_MAXCLIENTS; cntxt++){
                freeclient += (cntxt->mode == FREECLIENT);
                finishing += (cntxt->mode == FINISHCLIENT);
                running += (cntxt->mode == RUNCLIENT);
                blocked += (cntxt->mode == BLOCKCLIENT);
        }
-       return finishing+running +1 /* the admin */;
+       return finishing+running;
 }
 
 void
@@ -507,14 +497,7 @@ MCcloseClient(Client c)
        fprintf(stderr,"closeClient %d " OIDFMT "\n", (int) (c - mal_clients), 
c->user);
 #endif
        /* free resources of a single thread */
-       if (!isAdministrator(c)) {
-               MCfreeClient(c);
-               return;
-       }
-
-       /* adm is set to disallow new clients entering */
-       mal_clients[CONSOLE].mode = FINISHCLIENT;
-       mal_exit(0);
+       MCfreeClient(c);
 }
 
 str
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -17,9 +17,6 @@
 
 #define SCENARIO_PROPERTIES 8
 
-#define CONSOLE     0
-#define isAdministrator(X) (X==mal_clients)
-
 enum clientmode {
        FREECLIENT,
        FINISHCLIENT,
@@ -31,9 +28,8 @@ enum clientmode {
 
 /*
  * The prompt structure is designed to simplify recognition of the
- * language framework for interaction. For direct console access it is a
- * short printable ASCII string. For access through an API we assume the
- * prompt is an ASCII string surrounded by a \001 character. This
+ * language framework for interaction. For access through an API we 
+ * assume the prompt is an ASCII string surrounded by a \001 character. This
  * simplifies recognition.  The information between the prompt brackets
  * can be used to pass the mode to the front-end. Moreover, the prompt
  * can be dropped if a single stream of information is expected from the
@@ -127,7 +123,6 @@ typedef struct CLIENT {
         */
        int debug;
        void  *mdb;            /* context upon suspend */
-       str    history;        /* where to keep console history */
        enum clientmode mode;  /* FREECLIENT..BLOCKED */
        /*
         * Client records are organized into a two-level dependency tree,
diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c
--- a/monetdb5/mal/mal_debugger.c
+++ b/monetdb5/mal/mal_debugger.c
@@ -1051,7 +1051,7 @@ mdbStep(Client cntxt, MalBlkPtr mb, MalS
        if (stk->cmd == 0)
                stk->cmd = 'n';
        /* a trapped call leads to process suspension */
-       /* then the console can be used to attach a debugger */
+       /* which can be used to attach a debugger */
        if (mb->trap) {
                mdbTrap(cntxt, mb, stk, getInstrPtr(mb,pc));
                return;
@@ -1405,7 +1405,7 @@ mdbHelp(stream *f)
        mnstr_printf(f, "down             -- go down the stack\n");
        mnstr_printf(f, "up               -- go up the stack\n");
        mnstr_printf(f, "trace <var>      -- trace assignment to variables\n");
-       mnstr_printf(f, "trap <mod>.<fcn> -- catch MAL function call in 
console\n");
+       mnstr_printf(f, "trap <mod>.<fcn> -- catch MAL function call in 
debugger\n");
        mnstr_printf(f, "help             -- this message\n");
 }
 
diff --git a/monetdb5/mal/mal_resource.c b/monetdb5/mal/mal_resource.c
--- a/monetdb5/mal/mal_resource.c
+++ b/monetdb5/mal/mal_resource.c
@@ -203,7 +203,7 @@ MALresourceFairness(lng usec)
                                break;
                }
                MT_sleep_ms(DELAYUNIT);
-               users= MCactiveClients(); // users excluding console
+               users= MCactiveClients();
                rss = GDKmem_cursize();
                clk -= DELAYUNIT;
        }
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
@@ -479,7 +479,7 @@ MSserveClient(Client c)
        MalBlkPtr mb;
        str msg = 0;
 
-       if (!isAdministrator(c) && MCinitClientThread(c) < 0) {
+       if (MCinitClientThread(c) < 0) {
                MCcloseClient(c);
                return MAL_SUCCEED;
        }
@@ -536,8 +536,7 @@ MSserveClient(Client c)
        }
        */
 
-       if (!isAdministrator(c))
-               MCcloseClient(c);
+       MCcloseClient(c);
        if (c->usermodule /*&& strcmp(c->usermodule->name, "user") == 0*/) {
                freeModule(c->usermodule);
                c->usermodule = NULL;
diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err 
b/monetdb5/tools/Tests/mserver5--help.stable.err
--- a/monetdb5/tools/Tests/mserver5--help.stable.err
+++ b/monetdb5/tools/Tests/mserver5--help.stable.err
@@ -14,7 +14,6 @@ Usage: mserver5 [options] [scripts]
     --dbpath=<directory>      Specify database location
     --dbextra=<directory>     Directory for transient BATs
     --config=<config_file>    Use config_file to read options from
-    --daemon=yes|no           Do not read commands from standard input [no]
     --single-user             Allow only one user at a time
     --readonly                Safeguard database
     --set <option>=<value>    Set configuration option
@@ -32,7 +31,6 @@ The debug, testing & trace options:
      --algorithms
      --performance
      --optimizers
-     --trace
      --forcemito
      --debug=<bitmask>
 
diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows 
b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
--- a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
+++ b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows
@@ -9,7 +9,6 @@ Usage: mserver5.exe [options] [scripts]
     --dbpath=<directory>      Specify database location
     --dbextra=<directory>     Directory for transient BATs
     --config=<config_file>    Use config_file to read options from
-    --daemon=yes|no           Do not read commands from standard input [no]
     --single-user             Allow only one user at a time
     --readonly                Safeguard database
     --set <option>=<value>    Set configuration option
@@ -27,7 +26,6 @@ The debug, testing & trace options:
      --algorithms
      --performance
      --optimizers
-     --trace
      --forcemito
      --debug=<bitmask>
 
diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -52,6 +52,7 @@
 #include "rel_dump.h"
 #include "rel_remote.h"
 
+#include "msabaoth.h"          /* msab_getUUID */
 #include "muuid.h"
 
 int
@@ -424,17 +425,21 @@ static int
        }
        pushInstruction(curBlk, p);
 
-       if (mal_session_uuid) {
+       char *mal_session_uuid, *err;
+       if ((err = msab_getUUID(&mal_session_uuid)) == NULL) {
                str rsupervisor_session = GDKstrdup(mal_session_uuid);
                if (rsupervisor_session == NULL) {
+                       free(mal_session_uuid);
                        return -1;
                }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to