mirror of
https://github.com/drasko/codezero.git
synced 2026-01-13 19:33:15 +01:00
Fixed minor issues on capability list sharing.
This commit is contained in:
@@ -69,24 +69,43 @@ int cap_share_single(struct capability *user)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Shares the whole list */
|
||||
int cap_share_all(void)
|
||||
/*
|
||||
* Shares the whole capability list.
|
||||
*
|
||||
* FIXME: Make sure each and every capability has its
|
||||
* share right set!
|
||||
*/
|
||||
int cap_share_all(unsigned int flags)
|
||||
{
|
||||
cap_list_move(&curcont->cap_list,
|
||||
¤t->space->cap_list);
|
||||
if (flags == CAP_SHARE_ALL_CONTAINER) {
|
||||
|
||||
/* Move all private caps to container */
|
||||
cap_list_move(&curcont->cap_list,
|
||||
¤t->cap_list);
|
||||
|
||||
/*
|
||||
* Move all space caps to container, also.
|
||||
*
|
||||
* FIXME: Make sure all space capabilities
|
||||
* are owned by the sharer!!!
|
||||
*/
|
||||
cap_list_move(&curcont->cap_list,
|
||||
¤t->space->cap_list);
|
||||
} else if (flags == CAP_SHARE_ALL_SPACE) {
|
||||
|
||||
/* Move all private caps to space */
|
||||
cap_list_move(¤t->space->cap_list,
|
||||
¤t->cap_list);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int cap_share(struct capability *cap, unsigned int flags)
|
||||
{
|
||||
if (flags & CAP_SHARE_SINGLE)
|
||||
cap_share_single(cap);
|
||||
if (flags == CAP_SHARE_SINGLE)
|
||||
return cap_share_single(cap);
|
||||
else
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
return cap_share_all(flags);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -665,6 +684,9 @@ int sys_capability_control(unsigned int req, unsigned int flags, void *userbuf)
|
||||
return err;
|
||||
break;
|
||||
case CAP_CONTROL_SHARE:
|
||||
if (flags == CAP_SHARE_ALL_CONTAINER ||
|
||||
flags == CAP_SHARE_ALL_SPACE)
|
||||
break;
|
||||
case CAP_CONTROL_GRANT:
|
||||
case CAP_CONTROL_SPLIT:
|
||||
case CAP_CONTROL_REPLICATE:
|
||||
|
||||
Reference in New Issue
Block a user