cmap: Check RO flag in adjust int function

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
Jan Friesse 2012-02-06 14:31:53 +01:00
parent c21f9573ce
commit 546aea23cf

View File

@ -338,7 +338,12 @@ static void message_handler_req_lib_cmap_adjust_int(void *conn, const void *mess
struct res_lib_cmap_adjust_int res_lib_cmap_adjust_int;
cs_error_t ret;
ret = icmap_adjust_int((char *)req_lib_cmap_adjust_int->key_name.value, req_lib_cmap_adjust_int->step);
if (icmap_is_key_ro((char *)req_lib_cmap_adjust_int->key_name.value)) {
ret = CS_ERR_ACCESS;
} else {
ret = icmap_adjust_int((char *)req_lib_cmap_adjust_int->key_name.value,
req_lib_cmap_adjust_int->step);
}
memset(&res_lib_cmap_adjust_int, 0, sizeof(res_lib_cmap_adjust_int));
res_lib_cmap_adjust_int.header.size = sizeof(res_lib_cmap_adjust_int);