| 2579 | } |
| 2580 | |
| 2581 | static int |
| 2582 | mqf_chown(struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred, |
| 2583 | struct thread *td) |
| 2584 | { |
| 2585 | struct mqfs_node *pn; |
| 2586 | int error; |
| 2587 | |
| 2588 | error = 0; |
| 2589 | pn = fp->f_data; |
| 2590 | sx_xlock(&mqfs_data.mi_lock); |
| 2591 | if (uid == (uid_t)-1) |
| 2592 | uid = pn->mn_uid; |
| 2593 | if (gid == (gid_t)-1) |
| 2594 | gid = pn->mn_gid; |
| 2595 | if (((uid != pn->mn_uid && uid != active_cred->cr_uid) || |
| 2596 | (gid != pn->mn_gid && !groupmember(gid, active_cred))) && |
| 2597 | (error = priv_check_cred(active_cred, PRIV_VFS_CHOWN))) |
| 2598 | goto out; |
| 2599 | pn->mn_uid = uid; |
| 2600 | pn->mn_gid = gid; |
| 2601 | out: |
| 2602 | sx_xunlock(&mqfs_data.mi_lock); |
| 2603 | return (error); |
| 2604 | } |
| 2605 | |
| 2606 | static int |
| 2607 | mqf_kqfilter(struct file *fp, struct knote *kn) |
nothing calls this directly
no test coverage detected