* Determine if the credentials have sufficient permissions for a * specified combination of FREAD and FWRITE. */
| 913 | * specified combination of FREAD and FWRITE. |
| 914 | */ |
| 915 | int |
| 916 | shm_access(struct shmfd *shmfd, struct ucred *ucred, int flags) |
| 917 | { |
| 918 | accmode_t accmode; |
| 919 | int error; |
| 920 | |
| 921 | accmode = 0; |
| 922 | if (flags & FREAD) |
| 923 | accmode |= VREAD; |
| 924 | if (flags & FWRITE) |
| 925 | accmode |= VWRITE; |
| 926 | mtx_lock(&shm_timestamp_lock); |
| 927 | error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, shmfd->shm_gid, |
| 928 | accmode, ucred); |
| 929 | mtx_unlock(&shm_timestamp_lock); |
| 930 | return (error); |
| 931 | } |
| 932 | |
| 933 | static void |
| 934 | shm_init(void *arg) |
no test coverage detected