| 1 | %start Map1::Start |
| 2 | %class rootjail |
| 3 | %header chroot_jail.h |
| 4 | |
| 5 | %map Map1 |
| 6 | %% |
| 7 | //STATE TRANSITION END STATE ACTION(S) |
| 8 | |
| 9 | Start |
| 10 | { |
| 11 | chroot(pid: int, newroot:char*) Newroot {savepid(pid); savenewroot(newroot);} |
| 12 | Default |
| 13 | Start |
| 14 | {} |
| 15 | |
| 16 | } |
| 17 | Newroot |
| 18 | { |
| 19 | chdir(pid: int, newdir: char *) |
| 20 | [thisprocess(ctxt, pid)==1 && checknewdir(newdir)==1] Destroy |
| 21 | {destroyfsm();} |
| 22 | chdir(pid: int, newdir: char *) |
| 23 | Newroot |
| 24 | {} |
| 25 | open(pid: int)[thisprocess(ctxt, pid)==1] |
| 26 | Destroy |
| 27 | {warning(); destroyfsm();} |
| 28 | Default |
| 29 | Newroot |
| 30 | {} |
| 31 | } |
| 32 | Destroy |
| 33 | { |
| 34 | Default Destroy {} |
| 35 | } |
| 36 | %% |