Changeset: e5e304cabe16 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e5e304cabe16
Modified Files:
        sql/backends/monet5/Makefile.ag
        sql/backends/monet5/sql_user.c
Branch: sciql
Log Message:

merged with defaul


diffs (251 lines):

diff --git a/clients/mapilib/Makefile.ag b/clients/mapilib/Makefile.ag
--- a/clients/mapilib/Makefile.ag
+++ b/clients/mapilib/Makefile.ag
@@ -18,7 +18,7 @@
 MTSAFE
 
 INCLUDES = ../../common/options ../../common/stream ../../common/utils \
-                  $(openssl_CFLAGS) $(MSGCONTROL_FLAGS)
+                  $(MSGCONTROL_FLAGS)
 
 lib_mapi = {
        VERSION = $(MAPI_VERSION)
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -831,10 +831,6 @@ _CRTIMP char *__cdecl crypt(const char *
 # endif
 #endif
 
-#include <openssl/md5.h>
-#include <openssl/sha.h>
-#include <openssl/ripemd.h>
-
 #ifndef INVALID_SOCKET
 #define INVALID_SOCKET (-1)
 #endif
diff --git a/common/utils/Makefile.ag b/common/utils/Makefile.ag
--- a/common/utils/Makefile.ag
+++ b/common/utils/Makefile.ag
@@ -19,6 +19,8 @@
 
 MTSAFE
 
+INCLUDES = $(openssl_CFLAGS)
+
 lib_mutils  =  {
        NOINST
        SOURCES = mutils.c mutils.h
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -523,6 +523,9 @@ AC_DEFUN([MCHECK_ADD_FLAG],
 #include <string.h>
 #endif
 
+#if -_LARGEFILE64_SOURCE - -1 == 1
+#include <stdio.h>
+#endif
 int main(int argc, char **av) {
        char buf[24];
        double d = atof("4.2");
@@ -903,7 +906,6 @@ dnl                 deb  ass  opt  war  
 dnl   debug          \    C    X    C    C    C
 dnl   assert         C    \    C    C    C    C
 dnl   optimize       X    C    \    C    X    X
-dnl   warnings       C    C    C    \    C    C
 dnl   profile        C    C    X    C    \    C
 dnl   instrument     C    C    X    C    C    \
 
@@ -2541,7 +2543,7 @@ AC_COMPILE_IFELSE(
 
 dnl     checks for library functions
 case $host in
-       *-darwin1[01234]*)
+       *-darwin1[[01234]]*)
                # OSX 10.6 (Snow Leopard) and up somehow makes configure believe
                # that fdatasync exists, in reality however, it does not on this
                # platform.
diff --git a/monetdb5/mal/Makefile.ag b/monetdb5/mal/Makefile.ag
--- a/monetdb5/mal/Makefile.ag
+++ b/monetdb5/mal/Makefile.ag
@@ -21,7 +21,7 @@ INCLUDES = ../misc \
                   ../../common/utils \
                   ../../clients/mapilib \
                   ../../gdk \
-                  $(READLINE_INCS) $(openssl_CFLAGS)
+                  $(READLINE_INCS)
 MTSAFE
 
 lib_mal = {
diff --git a/monetdb5/optimizer/Tests/dataflow.mal 
b/monetdb5/optimizer/Tests/dataflow.mal
--- a/monetdb5/optimizer/Tests/dataflow.mal
+++ b/monetdb5/optimizer/Tests/dataflow.mal
@@ -1,13 +1,12 @@
 # a simple dataflow test
 
-function slow():bat[:oid,:lng];
-r:= mmath.srand(0);
-b:= bat.new(:oid,:lng);
+function slow():bat[:oid,:dbl];
+b:= bat.new(:oid,:dbl);
 barrier (go,i):= language.newRange(0:lng);
-       k:= mmath.rand();
-       l:= calc.lng(k);
-       bat.insert(b,nil:oid,l);
-       redo (go,i):= language.nextElement(1:lng,1000000:lng);
+       f:= calc.dbl(i);
+       k:= mmath.sin(f);
+       bat.insert(b,nil:oid,k);
+       redo (go,i):= language.nextElement(1:lng,10000000:lng);
 exit (go,i);
        return b;
 end slow;
@@ -18,7 +17,7 @@ l:= aggr.min(s);
 h:= l;
 #mdb.setTimer(true);
 #mdb.setThread(true);
-z:= nil:bat[:oid,:lng];
+z:= nil:bat[:oid,:dbl];
 barrier go:= language.dataflow();
        t1:= algebra.select(s,l,h);
        t2:= algebra.select(s,l,h);
diff --git a/monetdb5/optimizer/Tests/dataflow.stable.out 
b/monetdb5/optimizer/Tests/dataflow.stable.out
--- a/monetdb5/optimizer/Tests/dataflow.stable.out
+++ b/monetdb5/optimizer/Tests/dataflow.stable.out
@@ -16,14 +16,15 @@ stdout of test 'dataflow` in directory '
 # Listening for connection requests on mapi:monetdb://eir.ins.cwi.nl:32759/
 # MonetDB/GIS module loaded
 # MonetDB/SQL module loaded
-function user.slow():bat[:oid,:lng];
-    r := mmath.srand(0);
-    b := bat.new(:oid,:lng);
+# MonetDB/DataCell module not loaded
+# SQLException:mvc:SQL module not initialized
+function user.slow():bat[:oid,:dbl];
+    b := bat.new(:oid,:dbl);
 barrier (go,i) := language.newRange(0:lng);
-    k := mmath.rand();
-    l := calc.lng(k);
-    bat.insert(b,nil:oid,l);
-    redo (go,i) := language.nextElement(1:lng,1000000:lng);
+    f := calc.dbl(i);
+    k := mmath.sin(f);
+    bat.insert(b,nil:oid,k);
+    redo (go,i) := language.nextElement(1:lng,10000000:lng);
 exit (go,i);
     return slow := b;
 end slow;
@@ -33,7 +34,7 @@ function user.tst():void;
     h := l;
 #mdb.setTimer(true); 
 #mdb.setThread(true); 
-    z := nil:bat[:oid,:lng];
+    z := nil:bat[:oid,:dbl];
 barrier go := language.dataflow();
     t1 := algebra.select(s,l,h);
     t2 := algebra.select(s,l,h);
@@ -56,26 +57,26 @@ function user.main():void;
     user.tst();
 end main;
 function user.tst():void;               #  0 tst:void := user.tst() {G}
-    s := user.slow();                   #  1 s:bat[:oid,:lng] := user.slow() 
{G}
-    l := aggr.min(s);                   #  2 l:lng := 
ALGmin_lng(s:bat[:oid,:lng]) {G}
-    h := l;                             #  3 h:lng := l:lng 
+    s := user.slow();                   #  1 s:bat[:oid,:dbl] := user.slow() 
{G}
+    l := aggr.min(s);                   #  2 l:dbl := 
ALGmin_dbl(s:bat[:oid,:dbl]) {G}
+    h := l;                             #  3 h:dbl := l:dbl 
 #mdb.setTimer(true); 
 #mdb.setThread(true); 
-    z := nil:bat[:oid,:lng];            #  6 z:bat[:oid,:lng] := 
_7:bat[:oid,:lng] {G}
+    z := nil:bat[:oid,:dbl];            #  6 z:bat[:oid,:dbl] := 
_7:bat[:oid,:dbl] {G}
 barrier go := language.dataflow();      #  7 go:int := MALstartDataflow() {J17}
-    t1 := algebra.select(s,l,h);        #  8 t1:bat[:oid,:lng] := 
ALGselect(s:bat[:oid,:lng], l:lng, h:lng) {G}
-    t2 := algebra.select(s,l,h);        #  9 t2:bat[:oid,:lng] := 
ALGselect(s:bat[:oid,:lng], l:lng, h:lng) {G}
-    t3 := algebra.select(s,l,h);        # 10 t3:bat[:oid,:lng] := 
ALGselect(s:bat[:oid,:lng], l:lng, h:lng) {G}
-    t4 := algebra.select(s,l,h);        # 11 t4:bat[:oid,:lng] := 
ALGselect(s:bat[:oid,:lng], l:lng, h:lng) {G}
-    t5 := algebra.select(s,l,h);        # 12 t5:bat[:oid,:lng] := 
ALGselect(s:bat[:oid,:lng], l:lng, h:lng) {G}
-    t6 := algebra.select(s,l,h);        # 13 t6:bat[:oid,:lng] := 
ALGselect(s:bat[:oid,:lng], l:lng, h:lng) {G}
-    t7 := algebra.select(s,l,h);        # 14 t7:bat[:oid,:lng] := 
ALGselect(s:bat[:oid,:lng], l:lng, h:lng) {G}
-    t8 := algebra.select(s,l,h);        # 15 t8:bat[:oid,:lng] := 
ALGselect(s:bat[:oid,:lng], l:lng, h:lng) {G}
-    z := mat.pack(t1,t2,t3,t4,t5,t6,t7,t8);# 16 z:bat[:oid,:lng] := 
MATpack(t1:bat[:oid,:lng], t2:bat[:oid,:lng], t3:bat[:oid,:lng], 
t4:bat[:oid,:lng], t5:bat[:oid,:lng], t6:bat[:oid,:lng], t7:bat[:oid,:lng], 
t8:bat[:oid,:lng]) {G}
+    t1 := algebra.select(s,l,h);        #  8 t1:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
+    t2 := algebra.select(s,l,h);        #  9 t2:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
+    t3 := algebra.select(s,l,h);        # 10 t3:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
+    t4 := algebra.select(s,l,h);        # 11 t4:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
+    t5 := algebra.select(s,l,h);        # 12 t5:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
+    t6 := algebra.select(s,l,h);        # 13 t6:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
+    t7 := algebra.select(s,l,h);        # 14 t7:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
+    t8 := algebra.select(s,l,h);        # 15 t8:bat[:oid,:dbl] := 
ALGselect(s:bat[:oid,:dbl], l:dbl, h:dbl) {G}
+    z := mat.pack(t1,t2,t3,t4,t5,t6,t7,t8);# 16 z:bat[:oid,:dbl] := 
MATpack(t1:bat[:oid,:dbl], t2:bat[:oid,:dbl], t3:bat[:oid,:dbl], 
t4:bat[:oid,:dbl], t5:bat[:oid,:dbl], t6:bat[:oid,:dbl], t7:bat[:oid,:dbl], 
t8:bat[:oid,:dbl]) {G}
 exit go;                                # 17 go:int 
-    s := nil:BAT;                       # 18 s:bat[:oid,:lng] := _23:BAT {G}
+    s := nil:BAT;                       # 18 s:bat[:oid,:dbl] := _23:BAT {G}
     mdb.var();                          # 19 _17:void := MDBvar() 
-    c := aggr.count(z);                 # 20 c:wrd := 
ALGcount_bat(z:bat[:oid,:lng]) {G}
+    c := aggr.count(z);                 # 20 c:wrd := 
ALGcount_bat(z:bat[:oid,:dbl]) {G}
     io.print(c);                        # 21 _19:void := IOprint_val(c:wrd) 
     io.print("done");                   # 22 _20:void := IOprint_val(_21:str) 
{G}
 end tst;                                # 23  
diff --git a/sql/backends/monet5/Makefile.ag b/sql/backends/monet5/Makefile.ag
--- a/sql/backends/monet5/Makefile.ag
+++ b/sql/backends/monet5/Makefile.ag
@@ -31,6 +31,7 @@ INCLUDES = ../../include ../../common ..
                   ../../../clients/mapilib \
                   ../../../common/options \
                   ../../../common/stream \
+                  ../../../common/utils \
                   ../../../gdk \
                   $(RDF_INC) \
                   $(READLINE_INCS)
diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c
--- a/sql/backends/monet5/sql_user.c
+++ b/sql/backends/monet5/sql_user.c
@@ -31,6 +31,7 @@
 #include "sql_mvc.h"
 #include "bat5.h"
 #include "mal_authorize.h"
+#include "mcrypt.h"
 
 #if 0
 int
@@ -111,10 +112,10 @@ monet5_create_user(ptr _mvc, str user, s
        BUNins(scens, "sql", 0, FALSE);
        bid = BBPcacheid(scens);
        if (!enc) {
-               int len = (int) strlen(passwd);
-               if ((ret = AUTHBackendSum(&pwd, &passwd, &len)) != MAL_SUCCEED) 
{
+               pwd = mcrypt_BackendSum(passwd, strlen(passwd));
+               if (pwd != NULL) {
                        BBPunfix(bid);
-                       return ret;
+                       throw(MAL, "sql.create_user", "crypt backend hash not 
found");
                }
        } else {
                pwd = passwd;
@@ -277,19 +278,15 @@ monet5_alter_user(ptr _mvc, str user, st
                str pwd = NULL;
                str opwd = NULL;
                if (!enc) {
-                       int len = (int) strlen(passwd);
-                       if ((err = AUTHBackendSum(&pwd, &passwd, &len)) != 
MAL_SUCCEED) {
-                               (void)sql_error(m, 02, "ALTER USER: %s", err);
-                               GDKfree(err);
+                       pwd = mcrypt_BackendSum(passwd, strlen(passwd));
+                       if (pwd == NULL) {
+                               (void)sql_error(m, 02, "ALTER USER: crypt 
backend hash not found");
                                return FALSE;
                        }
                        if (oldpasswd != NULL) {
-                               len = (int)strlen(oldpasswd);
-                               if ((err = AUTHBackendSum(&opwd, &oldpasswd, 
&len))
-                                               != MAL_SUCCEED)
-                               {
-                                       (void)sql_error(m, 02, "ALTER USER: 
%s", err);
-                                       GDKfree(err);
+                               opwd = mcrypt_BackendSum(oldpasswd, 
strlen(oldpasswd));
+                               if (opwd == NULL) {
+                                       (void)sql_error(m, 02, "ALTER USER: 
crypt backend hash not found");
                                        return FALSE;
                                }
                        }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to