Commit 1db78ea
[antlir2] Complete fix for file permissions in OCI layer generation
Summary:
D88790669 fixed file permissions for metadata-only changes (Contents::Unset
branch) but missed files with content changes (Contents::File branch). When
D88743755 switched from append_file() to append_data(), both code paths lost
automatic permission preservation. This diff applies the same permission
preservation logic to the Contents::File branch, completing the fix.
The issue was visible in fbcode-buck images where files like /etc/passwd had
incorrect permissions (----------). These files went through the Contents::File
path since they had content modifications, not just metadata changes.
In next diff we will cover the scenario with tests.
Test Plan:
buck2 test fbcode//mode/dev //antlir/antlir2/antlir2_packager/make_oci_layer:test-file-permissions
the previous fix only fixed:
```
liuba ⛅️ ~/fbsource/fbcode
[🥭] → buck run 'mode/opt' //atlas/specs/generated/fbsource-scm-tools:devcompute.image.fbsource-scm-tools-podman-run
```
however it didn't for:
```
liuba ⛅️ ~/fbsource/fbcode
[🍋] → buck run 'mode/opt' //atlas/specs/generated/fbcode-buck:devcompute.image.fbcode-buck-podman-run
```
Reviewed By: c-ryan747
Differential Revision: D88848270
fbshipit-source-id: 00eb26ba5f6f256eab4fc75a4b7e8435c1bbb3ac1 parent cfa6ce7 commit 1db78ea
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
283 | 291 | | |
284 | 292 | | |
285 | 293 | | |
| |||
0 commit comments