| 1615 | } |
| 1616 | |
| 1617 | static int |
| 1618 | shm_chmod(struct file *fp, mode_t mode, struct ucred *active_cred, |
| 1619 | struct thread *td) |
| 1620 | { |
| 1621 | struct shmfd *shmfd; |
| 1622 | int error; |
| 1623 | |
| 1624 | error = 0; |
| 1625 | shmfd = fp->f_data; |
| 1626 | mtx_lock(&shm_timestamp_lock); |
| 1627 | /* |
| 1628 | * SUSv4 says that x bits of permission need not be affected. |
| 1629 | * Be consistent with our shm_open there. |
| 1630 | */ |
| 1631 | #ifdef MAC |
| 1632 | error = mac_posixshm_check_setmode(active_cred, shmfd, mode); |
| 1633 | if (error != 0) |
| 1634 | goto out; |
| 1635 | #endif |
| 1636 | error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, shmfd->shm_gid, |
| 1637 | VADMIN, active_cred); |
| 1638 | if (error != 0) |
| 1639 | goto out; |
| 1640 | shmfd->shm_mode = mode & ACCESSPERMS; |
| 1641 | out: |
| 1642 | mtx_unlock(&shm_timestamp_lock); |
| 1643 | return (error); |
| 1644 | } |
| 1645 | |
| 1646 | static int |
| 1647 | shm_chown(struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred, |
nothing calls this directly
no test coverage detected