Repository navigation
[Bug][fs-local] Files created by the write tool are always 0600 on POSIX, ignoring umask and defeating default ACLs #9292
Replies: 1 comment
Confirmed — the fix point is the
|
Confirmed — the fix point is the
|
Uh oh!
There was an error while loading. Please reload this page.
Package:
@deepseek-ai/dsh-fs-local. Read in 0.1.5-rc.3, 0.2.0-rc.2 and 0.2.1-alpha.2; the code is unchanged across them. Platform: Linux/POSIX.What happens
A file created by the model's write tool (
ctx.fs.writeText→writeFileAtomic) always ends up mode 0600, whatever the process umask and whatever the directory's default ACL say.lib/index.js(0.2.0-rc.2, ~531-546):writeTextpassesexisting?.mode, so for a new filemodeisundefinedand the 0600 staging mode is what gets published.Why it is a problem
git checkoutorcpwould have produced 0664 there.fchmod 0600makes the mask---, so every named-user/named-group entry the default ACL granted is masked off. We see this on a Linux host where several service uids share a workspace through default ACLs: every.mdthe agent creates turns up 0600 /mask::---and needs an external repair.The 0600 is clearly right for the temp file while it sits in the private staging dir. The problem is that it leaks into the published file.
Suggested fix
For a new file,
fchmodthe temp to0o666 & ~process.umask()before publishing, the same waymodeis applied for an existing file. A config key such asnewFileModewould also do. Either way, the result matches what every other writer on the system produces, and default ACLs keep working, because the mask then comes from the group bits the umask allows. Optionally, for edits on Linux, copy the old file'ssystem.posix_acl_accessxattr, mirroring what is already done for Windows DACLs.All reactions