Lines Matching full:error
102 int error;
108 error = copyin(u_mac, &mac32, sizeof(mac32));
109 if (error != 0)
110 return (error);
117 error = copyin(u_mac, mac, sizeof(*mac));
118 if (error != 0)
119 return (error);
122 error = mac_check_structmac_consistent(mac);
123 if (error != 0)
124 return (error);
128 error = copyinstr(mac->m_string, buffer, mac->m_buflen, NULL);
129 if (error != 0) {
131 return (error);
134 MPASS(error == 0);
170 int error;
172 error = mac_label_copyin(uap->mac_p, &mac, &u_buffer);
173 if (error)
174 return (error);
178 error = ESRCH;
183 error = p_cansee(td, tproc);
184 if (error == 0)
187 if (error)
191 error = mac_cred_externalize_label(tcred->cr_label, mac.m_string,
193 if (error == 0)
194 error = copyout(buffer, u_buffer, strlen(buffer)+1);
200 return (error);
208 int error;
210 error = mac_label_copyin(uap->mac_p, &mac, &u_buffer);
211 if (error)
212 return (error);
215 error = mac_cred_externalize_label(td->td_ucred->cr_label,
217 if (error == 0)
218 error = copyout(buffer, u_buffer, strlen(buffer)+1);
222 return (error);
231 * is not set in case of error, and is set to a non-NULL value on success.
238 int error;
246 error = mac_cred_internalize_label(intlabel, mac->m_string);
247 if (error) {
249 return (error);
265 * error occured under the process lock that obsoletes setting the MAC label).
273 int error;
278 error = mac_cred_check_relabel(p->p_ucred, intlabel);
279 if (error)
280 return (error);
313 int error;
315 error = mac_label_copyin(uap->mac_p, &mac, NULL);
316 if (error)
317 return (error);
319 error = mac_set_proc_prepare(td, &mac, &intlabel);
320 if (error)
329 error = mac_set_proc_core(td, newcred, intlabel);
330 if (error) {
342 mac_set_proc_finish(td, error == 0, intlabel);
345 return (error);
359 int error;
361 error = mac_label_copyin(uap->mac_p, &mac, &u_buffer);
362 if (error)
363 return (error);
366 error = fget(td, uap->fd, cap_rights_init_one(&rights, CAP_MAC_GET),
368 if (error)
375 error = EINVAL;
383 error = mac_vnode_externalize_label(intlabel, mac.m_string,
390 error = EINVAL;
398 error = mac_pipe_externalize_label(intlabel, mac.m_string,
405 error = EINVAL;
413 error = mac_socket_externalize_label(intlabel, mac.m_string,
419 error = EINVAL;
421 if (error == 0)
422 error = copyout(buffer, u_buffer, strlen(buffer)+1);
428 return (error);
453 int error;
458 error = mac_label_copyin(mac_p, &mac, &u_buffer);
459 if (error)
460 return (error);
464 error = namei(&nd);
465 if (error)
470 error = mac_vnode_externalize_label(intlabel, mac.m_string, buffer,
476 if (error == 0)
477 error = copyout(buffer, u_buffer, strlen(buffer)+1);
483 return (error);
497 int error;
499 error = mac_label_copyin(uap->mac_p, &mac, NULL);
500 if (error)
501 return (error);
503 error = fget(td, uap->fd, cap_rights_init_one(&rights, CAP_MAC_SET),
505 if (error)
512 error = EINVAL;
516 error = mac_vnode_internalize_label(intlabel, mac.m_string);
517 if (error) {
522 error = vn_start_write(vp, &mp, V_WAIT | V_PCATCH);
523 if (error != 0) {
528 error = vn_setlabel(vp, intlabel, td->td_ucred);
536 error = EINVAL;
540 error = mac_pipe_internalize_label(intlabel, mac.m_string);
541 if (error == 0) {
544 error = mac_pipe_label_set(td->td_ucred,
553 error = EINVAL;
557 error = mac_socket_internalize_label(intlabel, mac.m_string);
558 if (error == 0) {
560 error = mac_socket_label_set(td->td_ucred, so,
567 error = EINVAL;
573 return (error);
598 int error;
603 error = mac_label_copyin(mac_p, &mac, NULL);
604 if (error)
605 return (error);
608 error = mac_vnode_internalize_label(intlabel, mac.m_string);
610 if (error)
614 error = namei(&nd);
615 if (error == 0) {
616 error = vn_start_write(nd.ni_vp, &mp, V_WAIT | V_PCATCH);
617 if (error == 0) {
618 error = vn_setlabel(nd.ni_vp, intlabel,
627 return (error);
635 int error;
637 error = copyinstr(uap->policy, target, sizeof(target), NULL);
638 if (error)
639 return (error);
641 error = ENOSYS;
645 error = mpc->mpc_ops->mpo_syscall(td,
656 error = mpc->mpc_ops->mpo_syscall(td,
664 return (error);