Preserve Windows target write authorization for atomic editor saves
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 38/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- node.js, typescript
Piste de recherche
Start with src/integrations/editor/DiffViewProvider.ts and inspect saveDirectly, safeWriteText, and the relevant Windows filesystem tests. First clarify the maintainer’s intended authorization check, then reproduce the DACL case where direct writes are denied but replacement and fs.access(..., W_OK) succeed. Done means the save rejects without changing the target, and error and missing-target paths pass on the rebased head.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Problem
At PR #1395 head 925f8b7bf9f90e69cd83e12a4dfcf08483d7213f, DiffViewProvider.saveDirectly in src/integrations/editor/DiffViewProvider.ts checks the existing target with fs.access(..., W_OK) before publishing with safeWriteText. On Windows, that check does not establish authorization under the target's DACL. A target can deny file writes while its parent permits replacement, so rename-based publication can replace a file that the previous fs.writeFile path would reject.
Required work
- Obtain the maintainer decision on the authorization check that
saveDirectlyshould own. - Implement the selected check without truncating the existing target before publication. Preserve the intended atomic publication behavior.
- Add a Windows real-filesystem regression test for
saveDirectly. Establish that direct file writes are denied, replacement is permitted, andfs.access(..., W_OK)succeeds. Verify that the save rejects and the target content remains unchanged. - Retest the relevant error and missing-target paths, and verify the final implementation on the rebased head.
The Windows DACL integration case in PR #2385 at 078cd7eb84c7377bdf8741f3564bfd14e5d69e82 exercises safeWriteText and post-publication DACL preservation or restore reporting. It does not verify the saveDirectly authorization decision.
Reported sizing
The author reported a candidate at 43e7d85ba63712abde83b8396aaa8d45220fab53 costing 11 counted executable lines and 3 selector ranges on a separate plain-fs.writeFile branch. The author reported 487 of 500 counted lines with that candidate alone at the measured chain top, and 505 of 500 with both review changes. These are author measurements, not a verified estimate for a fix to the rename-based path. Recalculate the cost for the chosen implementation.
Requested by @easonLiangWorldedtech.
PR: https://github.com/Zoo-Code-Org/Zoo-Code/pull/1395
Review finding: https://github.com/Zoo-Code-Org/Zoo-Code/pull/1395#discussion_r4510971756
- Langage dominant
- TypeScript
- Étoiles
- 2k
- Forks
- 301
- Merge moyen
- 3 j 14 h
- PR mergées (30 j)
- 103
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de Zoo-Code-Org/Zoo-Code
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Zoo-Code-Org/Zoo-Code#2773 · 1 commentaire ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Zoo-Code-Org/Zoo-Code#2717 · 1 commentaire ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Zoo-Code-Org/Zoo-Code#2515 ·
Les mainteneurs répondent en général sous 3 jours
-
fix(scripts): stryker-diff.mjs spawns the extensionless .bin shim and cannot run on WindowsPeut-être pris @easonLiangWorldedtech l’a pris il y a 15 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Zoo-Code-Org/Zoo-Code#2514 ·
Les mainteneurs répondent en général sous 3 jours
-
[BUG] search_files hides matching text on long linesPeut-être pris @DananjayaNadun l’a pris il y a 9 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Zoo-Code-Org/Zoo-Code#2496 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de Zoo-Code-Org/Zoo-Code
Issues similaires
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
ci
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
ClickHouse/clickhouse-js#1248 ·
Les mainteneurs répondent en général sous 1 jour
-
E2E: Darlehen-Test wartet auf die gebuchte Auszahlung, bevor er zur Liquiditätsvorschau wechseltOuvertetechnik
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
SR5-FoundryVTT/SR5-FoundryVTT#2162 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
AhmedNAgy25/analysor#25 ·
Les mainteneurs répondent en général sous 1 jour