Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10793/src/mal

Modified Files:
      Tag: MonetDB_5-4
        mal_authorize.mx 
Log Message:
don't use values of the bat your changing with BUNinplace. The change is
BUNinplace will do a BUNdel/BUNins which will change values your pointing
at. This fixes bug  1844050       Set a new user password...


Index: mal_authorize.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_authorize.mx,v
retrieving revision 1.56.2.1
retrieving revision 1.56.2.2
diff -u -d -r1.56.2.1 -r1.56.2.2
--- mal_authorize.mx    5 Feb 2008 22:11:54 -0000       1.56.2.1
+++ mal_authorize.mx    16 Feb 2008 21:26:22 -0000      1.56.2.2
@@ -516,6 +516,7 @@
        BUN p, q;
        str tmp;
        BATiter useri;
+       oid id;
 
        rethrow("addUser", tmp, AUTHrequireAdminOrUser(olduser));
 
@@ -536,7 +537,8 @@
 
        /* ok, just do it! (with force, because sql makes view over it) */
        useri = bat_iterator(user);
-       BUNinplace(BATmirror(user), p, *newuser, BUNhead(useri, p), TRUE);
+       id = *(oid*)BUNhead(useri, p);
+       BUNinplace(user, p, &id, *newuser, TRUE);
        AUTHcommit();
 
        return(MAL_SUCCEED);
@@ -577,7 +579,7 @@
        /* cypher the password */
        rethrow("setPassword", tmp, AUTHcypherValue(&hash, passwd));
        /* ok, just overwrite the password field for this user */
-       BUNinplace(pass, p, BUNhead(passi, p), hash, FALSE);
+       BUNinplace(pass, p, &id, hash, FALSE);
        GDKfree(hash);
        AUTHcommit();
 
@@ -628,7 +630,7 @@
        p = BUNfnd(pass, &id);
        assert (p != BUN_NONE);
        passi = bat_iterator(pass);
-       BUNinplace(pass, p, BUNhead(passi, p), hash, FALSE);
+       BUNinplace(pass, p, &id, hash, FALSE);
        GDKfree(hash);
        AUTHcommit();
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to