| 1497 | "Array of struct msqid_kernel for each potential message queue"); |
| 1498 | |
| 1499 | static int |
| 1500 | msg_prison_check(void *obj, void *data) |
| 1501 | { |
| 1502 | struct prison *pr = obj; |
| 1503 | struct prison *prpr; |
| 1504 | struct vfsoptlist *opts = data; |
| 1505 | int error, jsys; |
| 1506 | |
| 1507 | /* |
| 1508 | * sysvmsg is a jailsys integer. |
| 1509 | * It must be "disable" if the parent jail is disabled. |
| 1510 | */ |
| 1511 | error = vfs_copyopt(opts, "sysvmsg", &jsys, sizeof(jsys)); |
| 1512 | if (error != ENOENT) { |
| 1513 | if (error != 0) |
| 1514 | return (error); |
| 1515 | switch (jsys) { |
| 1516 | case JAIL_SYS_DISABLE: |
| 1517 | break; |
| 1518 | case JAIL_SYS_NEW: |
| 1519 | case JAIL_SYS_INHERIT: |
| 1520 | prison_lock(pr->pr_parent); |
| 1521 | prpr = osd_jail_get(pr->pr_parent, msg_prison_slot); |
| 1522 | prison_unlock(pr->pr_parent); |
| 1523 | if (prpr == NULL) |
| 1524 | return (EPERM); |
| 1525 | break; |
| 1526 | default: |
| 1527 | return (EINVAL); |
| 1528 | } |
| 1529 | } |
| 1530 | |
| 1531 | return (0); |
| 1532 | } |
| 1533 | |
| 1534 | static int |
| 1535 | msg_prison_set(void *obj, void *data) |
nothing calls this directly
no test coverage detected