mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
* sftp: create uploaded files with mode 0644 The upload writer carried a 0644 mode that never reached the filer, so the PUT fell back to the filer default of 0660. Pass the mode on the PUT, as OpenSSH's sftp-server creates new files 0666 minus a 022 umask. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: keep an existing file's mode when an upload overwrites it An overwrite went through the same PUT as a new file, so a 0600 file came back with the default mode. Send the stored mode instead, as open(2) on an existing file keeps it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: apply an fsetstat sent while an upload is still buffering "put -p" sets the mode and times on the open handle before closing it, but the upload only reaches the filer on close, so the setstat found no entry and the client failed with "No such file or directory". Keep such attributes on the open upload: a size cuts the buffered bytes, the mode goes on the PUT, and the rest is set once the file is stored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: clear the sub-second part of an mtime a setstat replaces SFTP times are whole seconds, but the stored nanoseconds of the old mtime stayed, so a touched or "put -p" file showed a time the client never set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: set the attributes queued on an upload in its post-upload update A new file can be under its bucket's default retention as soon as the PUT stores it, and a setstat after that is refused, so "put -p" into such a bucket stored the file and then failed the close. Apply the queued attributes in the update that already sets the owner after the upload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: leave a setstat alone when two uploads share its path A setstat carries only the path, so with two uploads of one path open in a session it went to whichever opened last, and a size cut the other upload's bytes. Route it to an upload only when that upload is the only one open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * sftp: fail the close when an upload's queued attributes are not stored The setstat already answered success, so a failed post-upload update was only logged and "put -p" lost the times without the client knowing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>