Commit fc46676
committed
linux: reject sysctl kernel.domainname when OCI knob domainname is set
Setting sysctl `kernel.domainname` directly by user is not environment
agnostic, it shows either incorrect ( on non-working ) behaviour in
`rootless` environment.
It was decided to make this part of `runtime-spec` so the OCI runtime
can itself handle this behaviour correctly. As a result a new field
`domainname` was added to `runtime-spec`. Since crun already implementes
this field therefore `sysctl` configured by user conflicts with the
behaviour expected by the OCI runtime.
Runtime-spec PR: opencontainers/runtime-spec#1156
Furthermore a similar `sysctl` `kernal.hostname` is blocked by crun explicitly
to prevent this conflicting behaviour. https://github.com/containers/crun/blob/main/src/libcrun/linux.c#L3203
Following commit ensures that crun rejects sysctl `kernel.domainname`
when OCI field `domainname` is already set.
Signed-off-by: Aditya R <[email protected]>1 parent a73a1d4 commit fc46676
3 files changed
+39
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3161 | 3161 | | |
3162 | 3162 | | |
3163 | 3163 | | |
3164 | | - | |
| 3164 | + | |
3165 | 3165 | | |
3166 | 3166 | | |
3167 | 3167 | | |
| |||
3192 | 3192 | | |
3193 | 3193 | | |
3194 | 3194 | | |
3195 | | - | |
3196 | | - | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
3197 | 3205 | | |
3198 | | - | |
3199 | | - | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
3200 | 3209 | | |
3201 | 3210 | | |
3202 | 3211 | | |
| |||
3256 | 3265 | | |
3257 | 3266 | | |
3258 | 3267 | | |
3259 | | - | |
| 3268 | + | |
3260 | 3269 | | |
3261 | 3270 | | |
3262 | 3271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
47 | 68 | | |
48 | 69 | | |
| 70 | + | |
49 | 71 | | |
50 | 72 | | |
51 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| 489 | + | |
0 commit comments