Changeset: 4128de126569 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4128de126569
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/exports.stable.out
monetdb5/mal/mal_authorize.c
monetdb5/mal/mal_authorize.h
monetdb5/modules/mal/clients.c
Branch: userprofile
Log Message:
comment out code to be removed
diffs (truncated from 1229 to 300 lines):
diff --git a/clients/Tests/MAL-signatures-hge.test
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -33319,11 +33319,6 @@ pattern batsql.ntile(X_0:bat[:any], X_1:
SQLntile;
return the groups divided as equally as possible
batsql
-password
-pattern batsql.password(X_0:bat[:str]):bat[:str]
-db_password_wrap;
-Return password hash of user
-batsql
percent_rank
pattern batsql.percent_rank(X_0:bat[:any_1], X_1:any_2, X_2:any_3):bat[:dbl]
SQLpercent_rank;
@@ -43799,26 +43794,11 @@ pattern capi.subeval_aggr(X_0:ptr, X_1:b
CUDFevalAggr;
grouped aggregates through CUDF
clients
-addUser
-unsafe pattern clients.addUser(X_0:str, X_1:str):oid
-CLTaddUser;
-Allow user with password access to the given scenarios
-clients
backendsum
command clients.backendsum(X_0:str):str
CLTbackendsum;
Return hex string representation of the currently used hash of the given string
clients
-changePassword
-unsafe pattern clients.changePassword(X_0:str, X_1:str):void
-CLTchangePassword;
-Change the password for the current user
-clients
-changeUsername
-unsafe pattern clients.changeUsername(X_0:str, X_1:str):void
-CLTchangeUsername;
-Change the username of the user into the new string
-clients
checkPermission
pattern clients.checkPermission(X_0:str, X_1:str):void
CLTcheckPermission;
@@ -43859,11 +43839,6 @@ pattern clients.getUsername():str
CLTgetUsername;
Return the username of the currently logged in user
clients
-getUsers
-pattern clients.getUsers() (X_0:bat[:oid], X_1:bat[:str])
-CLTgetUsers;
-return a BAT with user id and one with name available in the system
-clients
getprofile
pattern clients.getprofile() (X_0:str, X_1:int, X_2:int, X_3:int, X_4:int)
CLTgetProfile;
@@ -43884,11 +43859,6 @@ unsafe pattern clients.quit(X_0:int):voi
CLTquit;
Terminate the session for a single client using a soft error.@It is the
privilege of the console user.
clients
-removeUser
-unsafe pattern clients.removeUser(X_0:str):void
-CLTremoveUser;
-Remove the given user from the system
-clients
ripemd160sum
command clients.ripemd160sum(X_0:str):str
CLTripemd160sum;
@@ -43899,11 +43869,6 @@ unsafe pattern clients.setListing(X_0:in
CLTsetListing;
Turn on/off echo of MAL instructions:@1 - echo input,@2 - show mal
instruction,@4 - show details of type resolutoin, @8 - show binding information.
clients
-setPassword
-unsafe pattern clients.setPassword(X_0:str, X_1:str):void
-CLTsetPassword;
-Set the password for the given user
-clients
setQryTimeoutMicro
unsafe pattern clients.setQryTimeoutMicro(X_0:lng):void
CLTqueryTimeoutMicro;
@@ -48444,11 +48409,6 @@ command sql.date_trunc(X_0:str, X_1:time
date_trunc;
Truncate a timestamp to (millennium,
century,decade,year,quarter,month,week,day,hour,minute,second,
milliseconds,microseconds)
sql
-db_users
-pattern sql.db_users():bat[:str]
-db_users_wrap;
-return table of users with sql scenario
-sql
delete
unsafe pattern sql.delete(X_0:int, X_1:str, X_2:str, X_3:any):int
mvc_delete_wrap;
@@ -48761,7 +48721,7 @@ getPipeCatalog;
sql
password
pattern sql.password(X_0:str):str
-db_password_wrap;
+SQLuser_password;
Return password hash of user
sql
percent_rank
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -730,9 +730,6 @@ str AUTHRegisterGetPasswordHandler(get_u
str AUTHRegisterGetUserNameHandler(get_user_name_handler callback);
str AUTHRegisterGetUserOIDHandler(get_user_oid_handler callback);
str AUTHaddRemoteTableCredentials(const char *local_table, const char
*localuser, const char *uri, const char *remoteuser, const char *pass, bool
pw_encrypted);
-str AUTHaddUser(oid *ret, Client c, const char *user, const char *pass);
-str AUTHchangePassword(Client c, const char *oldpass, const char *passwd);
-str AUTHchangeUsername(Client c, const char *olduser, const char *newuser);
str AUTHcheckCredentials(oid *ret, Client c, const char *user, const char
*passwd, const char *challenge, const char *algo);
str AUTHcypherValue(str *ret, const char *value);
str AUTHdecypherValue(str *ret, const char *value);
@@ -740,12 +737,8 @@ str AUTHdeleteRemoteTableCredentials(con
str AUTHgetPasswordHash(str *ret, Client c, const char *username);
str AUTHgetRemoteTableCredentials(const char *local_table, str *uri, str
*username, str *password);
str AUTHgetUsername(str *ret, Client c);
-str AUTHgetUsers(BAT **ret1, BAT **ret2, Client c);
str AUTHinitTables(const char *passwd);
-str AUTHremoveUser(Client c, const char *username);
str AUTHrequireAdmin(Client c);
-str AUTHresolveUser(str *ret, oid uid);
-str AUTHsetPassword(Client c, const char *username, const char *passwd);
str AUTHunlockVault(const char *password);
str AUTHverifyPassword(const char *passwd);
str BATinfo(BAT **key, BAT **val, const bat bid);
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -32,9 +32,9 @@
static BUN lookupRemoteTableKey(const char *key);
-static BAT *user = NULL;
-static BAT *pass = NULL;
-static BAT *duser = NULL;
+// static BAT *user = NULL;
+// static BAT *pass = NULL;
+// static BAT *duser = NULL;
/* Remote table bats */
static BAT *rt_key = NULL;
@@ -54,37 +54,37 @@ static AUTHCallbackCntx authCallbackCntx
void AUTHreset(void)
{
//if( user) BBPunfix(user->batCacheid);
- user = NULL;
+ // user = NULL;
//if( pass) BBPunfix(pass->batCacheid);
- pass = NULL;
+ // pass = NULL;
//if( duser) BBPunfix(duser->batCacheid);
- duser = NULL;
+ // duser = NULL;
if (vaultKey != NULL)
GDKfree(vaultKey);
vaultKey = NULL;
}
-static BUN
-AUTHfindUser(const char *username)
-{
- BATiter cni = bat_iterator(user);
- BUN p;
-
- if (BAThash(user) == GDK_SUCCEED) {
- MT_rwlock_rdlock(&user->thashlock);
- HASHloop_str(cni, user->thash, p, username) {
- oid pos = p;
- if (BUNfnd(duser, &pos) == BUN_NONE) {
- MT_rwlock_rdunlock(&user->thashlock);
- bat_iterator_end(&cni);
- return p;
- }
- }
- MT_rwlock_rdunlock(&user->thashlock);
- }
- bat_iterator_end(&cni);
- return BUN_NONE;
-}
+// static BUN
+// AUTHfindUser(const char *username)
+// {
+// BATiter cni = bat_iterator(user);
+// BUN p;
+//
+// if (BAThash(user) == GDK_SUCCEED) {
+// MT_rwlock_rdlock(&user->thashlock);
+// HASHloop_str(cni, user->thash, p, username) {
+// oid pos = p;
+// if (BUNfnd(duser, &pos) == BUN_NONE) {
+// MT_rwlock_rdunlock(&user->thashlock);
+// bat_iterator_end(&cni);
+// return p;
+// }
+// }
+// MT_rwlock_rdunlock(&user->thashlock);
+// }
+// bat_iterator_end(&cni);
+// return BUN_NONE;
+// }
/**
* Requires the current client to be the admin user thread. If not the case,
@@ -92,23 +92,29 @@ AUTHfindUser(const char *username)
*/
str
AUTHrequireAdmin(Client cntxt) {
- oid id;
+ assert(cntxt);
+
+ if (cntxt->user != MAL_ADMIN)
+ throw(MAL, "AUTHrequireAdmin", INVCRED_ACCESS_DENIED);
+ return(MAL_SUCCEED);
- if (cntxt == NULL)
- return(MAL_SUCCEED);
- id = cntxt->user;
+ // oid id;
+
+ // if (cntxt == NULL)
+ // return(MAL_SUCCEED);
+ // id = cntxt->user;
- if (id != MAL_ADMIN) {
- str user = NULL;
- str tmp;
+ // if (id != MAL_ADMIN) {
+ // str user = NULL;
+ // str tmp;
- rethrow("requireAdmin", tmp, AUTHresolveUser(&user, id));
- tmp = createException(INVCRED, "requireAdmin",
INVCRED_ACCESS_DENIED " '%s'", user);
- GDKfree(user);
- return tmp;
- }
+ // rethrow("requireAdmin", tmp, AUTHresolveUser(&user, id));
+ // tmp = createException(INVCRED, "requireAdmin",
INVCRED_ACCESS_DENIED " '%s'", user);
+ // GDKfree(user);
+ // return tmp;
+ // }
- return(MAL_SUCCEED);
+ // return(MAL_SUCCEED);
}
/**
@@ -116,24 +122,24 @@ AUTHrequireAdmin(Client cntxt) {
* the given username. If not the case, this function returns an
* InvalidCredentialsException.
*/
-static str
-AUTHrequireAdminOrUser(Client cntxt, const char *username) {
- oid id = cntxt->user;
- str user = NULL;
- str tmp = MAL_SUCCEED;
-
- /* MAL_ADMIN then all is well */
- if (id == MAL_ADMIN)
- return(MAL_SUCCEED);
-
- rethrow("requireAdminOrUser", tmp, AUTHresolveUser(&user, id));
- if (username == NULL || strcmp(username, user) != 0)
- tmp = createException(INVCRED, "requireAdminOrUser",
- INVCRED_ACCESS_DENIED
" '%s'", user);
-
- GDKfree(user);
- return tmp;
-}
+// static str
+// AUTHrequireAdminOrUser(Client cntxt, const char *username) {
+// oid id = cntxt->user;
+// str user = NULL;
+// str tmp = MAL_SUCCEED;
+//
+// /* MAL_ADMIN then all is well */
+// if (id == MAL_ADMIN)
+// return(MAL_SUCCEED);
+//
+// rethrow("requireAdminOrUser", tmp, AUTHresolveUser(&user, id));
+// if (username == NULL || strcmp(username, user) != 0)
+// tmp = createException(INVCRED, "requireAdminOrUser",
+// INVCRED_ACCESS_DENIED
" '%s'", user);
+//
+// GDKfree(user);
+// return tmp;
+// }
static void
AUTHcommit(void)
@@ -142,12 +148,12 @@ AUTHcommit(void)
blist[0] = 0;
- assert(user);
- blist[1] = user->batCacheid;
- assert(pass);
- blist[2] = pass->batCacheid;
- assert(duser);
- blist[3] = duser->batCacheid;
+ // assert(user);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]