Skip to content

Commit

Permalink
Change: Allow any inheritor deleting user from CLI
Browse files Browse the repository at this point in the history
When deleting users using the `--delete-user` option, do not apply any
restrictions on which user can be selected as inheritor.

This gives users with command line access a way to circumvent the
restrictions of the delete_user GMP command and addresses issues
of the command line option being too restrictive to be useful.
  • Loading branch information
timopollmeier committed Nov 29, 2023
1 parent 76b9085 commit 8d4c88f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -53756,7 +53756,9 @@ delete_user (const char *user_id_arg, const char *name_arg, int ultimate,
real_inheritor_id = user_uuid (inheritor);

/* Only the current user, owned users or global users may inherit. */
if (strcmp (real_inheritor_id, current_credentials.uuid)
if (current_credentials.uuid
&& strcmp (current_credentials.uuid, "")
&& strcmp (real_inheritor_id, current_credentials.uuid)
&& sql_int ("SELECT NOT (" ACL_IS_GLOBAL () ")"
" FROM users WHERE id = %llu",
inheritor)
Expand Down

0 comments on commit 8d4c88f

Please sign in to comment.