Changes in kernel/generic/src/security/perm.c [719a208:a53ed3a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/security/perm.c
r719a208 ra53ed3a 84 84 * 85 85 */ 86 static sysarg_t perm_grant(task_id_t taskid, perm_t perms)86 static errno_t perm_grant(task_id_t taskid, perm_t perms) 87 87 { 88 88 if (!(perm_get(TASK) & PERM_PERM)) 89 return (sysarg_t)EPERM;89 return EPERM; 90 90 91 91 irq_spinlock_lock(&tasks_lock, true); … … 94 94 if ((!task) || (!container_check(CONTAINER, task->container))) { 95 95 irq_spinlock_unlock(&tasks_lock, true); 96 return (sysarg_t)ENOENT;96 return ENOENT; 97 97 } 98 98 … … 102 102 103 103 irq_spinlock_unlock(&tasks_lock, true); 104 return 0;104 return EOK; 105 105 } 106 106 … … 116 116 * 117 117 */ 118 static sysarg_t perm_revoke(task_id_t taskid, perm_t perms)118 static errno_t perm_revoke(task_id_t taskid, perm_t perms) 119 119 { 120 120 irq_spinlock_lock(&tasks_lock, true); … … 123 123 if ((!task) || (!container_check(CONTAINER, task->container))) { 124 124 irq_spinlock_unlock(&tasks_lock, true); 125 return (sysarg_t)ENOENT;125 return ENOENT; 126 126 } 127 127 … … 136 136 irq_spinlock_unlock(&TASK->lock, false); 137 137 irq_spinlock_unlock(&tasks_lock, true); 138 return (sysarg_t)EPERM;138 return EPERM; 139 139 } 140 140 … … 143 143 144 144 irq_spinlock_unlock(&tasks_lock, true); 145 return 0;145 return EOK; 146 146 } 147 147 … … 158 158 * 159 159 */ 160 sys arg_t sys_perm_grant(sysarg64_t *uspace_taskid, perm_t perms)160 sys_errno_t sys_perm_grant(sysarg64_t *uspace_taskid, perm_t perms) 161 161 { 162 162 sysarg64_t taskid; 163 int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t));164 if (rc != 0)165 return (sys arg_t) rc;163 errno_t rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t)); 164 if (rc != EOK) 165 return (sys_errno_t) rc; 166 166 167 167 return perm_grant((task_id_t) taskid, perms); … … 179 179 * 180 180 */ 181 sys arg_t sys_perm_revoke(sysarg64_t *uspace_taskid, perm_t perms)181 sys_errno_t sys_perm_revoke(sysarg64_t *uspace_taskid, perm_t perms) 182 182 { 183 183 sysarg64_t taskid; 184 int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t));185 if (rc != 0)186 return (sys arg_t) rc;184 errno_t rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t)); 185 if (rc != EOK) 186 return (sys_errno_t) rc; 187 187 188 188 return perm_revoke((task_id_t) taskid, perms); … … 203 203 * 204 204 */ 205 sys arg_t sys_perm_grant(sysarg_t taskid, perm_t perms)205 sys_errno_t sys_perm_grant(sysarg_t taskid, perm_t perms) 206 206 { 207 207 return perm_grant((task_id_t) taskid, perms); … … 219 219 * 220 220 */ 221 sys arg_t sys_perm_revoke(sysarg_t taskid, perm_t perms)221 sys_errno_t sys_perm_revoke(sysarg_t taskid, perm_t perms) 222 222 { 223 223 return perm_revoke((task_id_t) taskid, perms);
Note:
See TracChangeset
for help on using the changeset viewer.