Changeset 96b02eb9 in mainline for kernel/generic/src/security/cap.c
- Timestamp:
- 2010-12-14T12:52:38Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6b10dab
- Parents:
- 554debd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/security/cap.c
r554debd r96b02eb9 85 85 * 86 86 */ 87 unative_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps)87 sysarg_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps) 88 88 { 89 89 if (!(cap_get(TASK) & CAP_CAP)) 90 return ( unative_t) EPERM;90 return (sysarg_t) EPERM; 91 91 92 92 sysarg64_t taskid_arg; 93 93 int rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t)); 94 94 if (rc != 0) 95 return ( unative_t) rc;95 return (sysarg_t) rc; 96 96 97 97 irq_spinlock_lock(&tasks_lock, true); … … 100 100 if ((!task) || (!context_check(CONTEXT, task->context))) { 101 101 irq_spinlock_unlock(&tasks_lock, true); 102 return ( unative_t) ENOENT;102 return (sysarg_t) ENOENT; 103 103 } 104 104 … … 122 122 * 123 123 */ 124 unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps)124 sysarg_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps) 125 125 { 126 126 sysarg64_t taskid_arg; 127 127 int rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t)); 128 128 if (rc != 0) 129 return ( unative_t) rc;129 return (sysarg_t) rc; 130 130 131 131 irq_spinlock_lock(&tasks_lock, true); … … 134 134 if ((!task) || (!context_check(CONTEXT, task->context))) { 135 135 irq_spinlock_unlock(&tasks_lock, true); 136 return ( unative_t) ENOENT;136 return (sysarg_t) ENOENT; 137 137 } 138 138 … … 147 147 irq_spinlock_unlock(&TASK->lock, false); 148 148 irq_spinlock_unlock(&tasks_lock, true); 149 return ( unative_t) EPERM;149 return (sysarg_t) EPERM; 150 150 } 151 151
Note:
See TracChangeset
for help on using the changeset viewer.