MXS-1354: Prevent removal of last admin account
Removing the last admin account is now forbidden. This should prevent most cases where users could lock themselves out of the administrative interface. This change does allow a non-root network user to be the last admin account. In practice this does not prevent the root user from gaining access to maxadmin. Access can be gained by removing the users file and restarting MaxScale or by editing the users file by hand.
This commit is contained in:
@ -109,13 +109,13 @@ bool users_find(USERS* users, const char* user);
|
||||
bool users_is_admin(USERS* users, const char* user);
|
||||
|
||||
/**
|
||||
* Check if at least one admin account exists
|
||||
* Check how many admin account exists
|
||||
*
|
||||
* @param users Users to check
|
||||
*
|
||||
* @return True if at least one admin account exists
|
||||
* @return Number of admin accounts
|
||||
*/
|
||||
bool users_have_admin(USERS* users);
|
||||
int users_admin_count(USERS* users);
|
||||
|
||||
/**
|
||||
* Dump users as JSON
|
||||
|
Reference in New Issue
Block a user