Commit 908a7c1
authored
Preserve file permissions when using reflinks on Linux (#18187)
Fixes an regression from #18117 where executable permissions were not
preserved on reflink. On Linux, the `FICLONE` ioctl only clones data
blocks without preserving file metadata, so permissions must be copied
separately. On macOS, `clonefile` already preserves permissions.
This appears to be a well known issue:
- pnpm/pnpm#8546
-
https://github.com/morelj/reflink/blob/53408edf3bf3c5090b1146923f72066c7f6e9200/cloneflags.go#L6-L22
- python/cpython#81338
Closes #181811 parent 55cfaf9 commit 908a7c1
6 files changed
Lines changed: 122 additions & 8 deletions
File tree
- crates
- uv-fs/src
- uv-test/src
- uv/tests/it
- test/packages/executable_file
- src/executable_file
- bin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
418 | 459 | | |
419 | 460 | | |
420 | 461 | | |
| |||
426 | 467 | | |
427 | 468 | | |
428 | 469 | | |
429 | | - | |
| 470 | + | |
430 | 471 | | |
431 | 472 | | |
432 | 473 | | |
433 | 474 | | |
434 | 475 | | |
435 | 476 | | |
436 | 477 | | |
437 | | - | |
| 478 | + | |
438 | 479 | | |
439 | 480 | | |
440 | 481 | | |
| |||
462 | 503 | | |
463 | 504 | | |
464 | 505 | | |
465 | | - | |
| 506 | + | |
466 | 507 | | |
467 | 508 | | |
468 | 509 | | |
469 | 510 | | |
470 | 511 | | |
471 | 512 | | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
476 | 519 | | |
477 | 520 | | |
478 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
784 | | - | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
785 | 788 | | |
786 | 789 | | |
787 | 790 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3347 | 3347 | | |
3348 | 3348 | | |
3349 | 3349 | | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
3350 | 3406 | | |
3351 | 3407 | | |
3352 | 3408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments