- if (ret) {
- acb_info = pdb_get_acct_ctrl(sam_pass);
- }
-
- /* For machine accounts it's the SeMachineAccountPrivilege that counts. */
- if (geteuid() == sec_initial_uid()) {
- can_del_accounts = true;
- } else if (acb_info & ACB_WSTRUST) {
- can_del_accounts = user_has_privileges( p->server_info->ptok, &se_machine_account );
- } else {
- can_del_accounts = user_has_privileges( p->server_info->ptok, &se_add_users );
- }
-
- if (!can_del_accounts) {
- TALLOC_FREE(sam_pass);
- return NT_STATUS_ACCESS_DENIED;
- }
-