| .. | .. |
|---|
| 131 | 131 | printf("[RUN]\tchild: check that we inherited permissions\n"); |
|---|
| 132 | 132 | expect_ok(0x80); |
|---|
| 133 | 133 | expect_gp(0xed); |
|---|
| 134 | + printf("[RUN]\tchild: Extend permissions to 0x81\n"); |
|---|
| 135 | + if (ioperm(0x81, 1, 1) != 0) { |
|---|
| 136 | + printf("[FAIL]\tioperm(0x81, 1, 1) failed (%d)", errno); |
|---|
| 137 | + return 1; |
|---|
| 138 | + } |
|---|
| 139 | + printf("[RUN]\tchild: Drop permissions to 0x80\n"); |
|---|
| 140 | + if (ioperm(0x80, 1, 0) != 0) { |
|---|
| 141 | + printf("[FAIL]\tioperm(0x80, 1, 0) failed (%d)", errno); |
|---|
| 142 | + return 1; |
|---|
| 143 | + } |
|---|
| 144 | + expect_gp(0x80); |
|---|
| 134 | 145 | return 0; |
|---|
| 135 | 146 | } else { |
|---|
| 136 | 147 | int status; |
|---|
| .. | .. |
|---|
| 146 | 157 | } |
|---|
| 147 | 158 | } |
|---|
| 148 | 159 | |
|---|
| 149 | | - /* Test the capability checks. */ |
|---|
| 160 | + /* Verify that the child dropping 0x80 did not affect the parent */ |
|---|
| 161 | + printf("\tVerify that unsharing the bitmap worked\n"); |
|---|
| 162 | + expect_ok(0x80); |
|---|
| 150 | 163 | |
|---|
| 164 | + /* Test the capability checks. */ |
|---|
| 151 | 165 | printf("\tDrop privileges\n"); |
|---|
| 152 | 166 | if (setresuid(1, 1, 1) != 0) { |
|---|
| 153 | 167 | printf("[WARN]\tDropping privileges failed\n"); |
|---|