Commit 502a145
committed
Fix user namespace validation for containers in pods
Remove incomplete CLI validation that only checked --pod flag and missed
--pod-id-file (used by quadlet). Move validation to libpod/container_validate.go
to catch all cases where --userns is set with --pod.
The new validation checks if container's ID mappings differ from the pod's
infra container and returns a clearer error message:
'cannot set user namespace mappings that differ from pod'
This addresses the issue request for a better error message that explains
the kernel limitation more clearly.
Fixes: #26848
Signed-off-by: 0xdvc <[email protected]>1 parent 69b397a commit 502a145
File tree
5 files changed
+50
-9
lines changed- cmd/podman/containers
- pkg/specgen/generate
- test
- e2e
- system
5 files changed
+50
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
313 | | - | |
314 | | - | |
| 312 | + | |
| 313 | + | |
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
24 | 38 | | |
25 | 39 | | |
26 | 40 | | |
| |||
214 | 228 | | |
215 | 229 | | |
216 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
217 | 234 | | |
218 | 235 | | |
219 | 236 | | |
| |||
247 | 264 | | |
248 | 265 | | |
249 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
250 | 283 | | |
251 | 284 | | |
252 | 285 | | |
| |||
255 | 288 | | |
256 | 289 | | |
257 | 290 | | |
258 | | - | |
259 | | - | |
260 | 291 | | |
261 | 292 | | |
262 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
685 | 688 | | |
686 | 689 | | |
687 | 690 | | |
688 | 691 | | |
689 | | - | |
| 692 | + | |
690 | 693 | | |
| 694 | + | |
| 695 | + | |
691 | 696 | | |
692 | 697 | | |
693 | 698 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
807 | | - | |
| 807 | + | |
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| |||
0 commit comments