/* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege,
and not a printer admin, then fail */
- if ((p->server_info->utok.uid != 0) &&
+ if ((p->server_info->utok.uid != sec_initial_uid()) &&
!user_has_privileges(p->server_info->ptok, &se_printop) &&
!token_contains_name_in_list(uidtoname(p->server_info->utok.uid),
NULL, NULL,
goto done;
}
+ become_root();
write_ntforms(&list, count);
+ unbecome_root();
/*
* ChangeID must always be set if this is a printer
WERROR status = WERR_OK;
NT_PRINTER_INFO_LEVEL *printer = NULL;
SE_PRIV se_printop = SE_PRINT_OPERATOR;
+ bool ret = false;
DEBUG(5,("_spoolss_DeleteForm\n"));
goto done;
}
- if ((p->server_info->utok.uid != 0) &&
+ if ((p->server_info->utok.uid != sec_initial_uid()) &&
!user_has_privileges(p->server_info->ptok, &se_printop) &&
!token_contains_name_in_list(uidtoname(p->server_info->utok.uid),
NULL, NULL,
count = get_ntforms(&list);
- if ( !delete_a_form(&list, form_name, &count, &status ))
+ become_root();
+ ret = delete_a_form(&list, form_name, &count, &status);
+ unbecome_root();
+ if (ret == false) {
goto done;
+ }
/*
* ChangeID must always be set if this is a printer
/* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege,
and not a printer admin, then fail */
- if ((p->server_info->utok.uid != 0) &&
+ if ((p->server_info->utok.uid != sec_initial_uid()) &&
!user_has_privileges(p->server_info->ptok, &se_printop) &&
!token_contains_name_in_list(uidtoname(p->server_info->utok.uid),
NULL, NULL,
count = get_ntforms(&list);
update_a_form(&list, form, count);
+ become_root();
write_ntforms(&list, count);
+ unbecome_root();
/*
* ChangeID must always be set if this is a printer