session: disallow destroying the null session
This commit is contained in:
parent
ae63188069
commit
00a3ec2e52
1 changed files with 3 additions and 0 deletions
|
@ -751,6 +751,9 @@ rpc_handle_destroy(struct ubus_context *ctx, struct ubus_object *obj,
|
|||
if (!tb)
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (!strcmp(blobmsg_get_string(tb), RPC_DEFAULT_SESSION_ID))
|
||||
return UBUS_STATUS_PERMISSION_DENIED;
|
||||
|
||||
ses = rpc_session_get(blobmsg_data(tb));
|
||||
if (!ses)
|
||||
return UBUS_STATUS_NOT_FOUND;
|
||||
|
|
Loading…
Add table
Reference in a new issue