Changeset: 3f0304dd2809 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3f0304dd2809
Modified Files:
        sql/server/sql_privileges.c
Branch: Jun2023
Log Message:

Adds important comments for CREATE USER with DEFAULT ROLE


diffs (14 lines):

diff --git a/sql/server/sql_privileges.c b/sql/server/sql_privileges.c
--- a/sql/server/sql_privileges.c
+++ b/sql/server/sql_privileges.c
@@ -840,6 +840,10 @@ sql_create_user(mvc *sql, char *user, ch
        /* the default role must explicitly granted to the new user */
        if (role_id) {
                str r;
+               /* - we don't grant the default role WITH ADMIN OPTION hence 
admin=0
+                * - we should use sql->role_id instead of sql->user_id 
otherwise a user with high privs
+                * (e.g. sysadmin) might not be able to GRANT the DEFAULT ROLE 
(see sql_grant_role() impl)
+                */
                if ((r = sql_grant_role(sql, user, role, sql->role_id, 0)))
                        return r;
        }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to