-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request attributes are not being propagated for SSH_FXP_OPEN operation #557
Comments
There are unfortunately known issues with the opening of files and handling of attributes. I’ve done a complete rewrite of the client before, but due to early design decisions some of these just aren’t possible to address. Though… in this case, :squint: it might be possible to bodge in |
If a client sends size 0 because it does not support this optional attribute it will be difficult to distinguish it from clients that support the attribute if they upload a 0 byte file |
Wouldn’t a client that does not support the optional attribute just not even set |
yes @puellanivis, that makes sense, SSH_FILEXFER_ATTR_SIZE check should help figure out if it is actually set and something like the below should help resolve file-size on server side
|
I ended up implementing attrs for the old |
Hi Team, I'm facing the below issue where I'm looking for ways to block interrupted uploads (similar issue). So I want to access request attributes such as file-size during a put command. Even though the client sends the attributes during a put command, sftp-go server library doesn't seem to propagate it to handler
The restriction might be intentional and have a good reason behind it, in which case may I know the details of the reasoning? The library specification document too, doesn't talk about having this restriction. Please correct me if I'm wrong. Thanks in the advance.
`// New Request initialized based on packet data
func requestFromPacket(ctx context.Context, pkt hasPath, baseDir string) *Request {
request := &Request{
Method: requestMethod(pkt),
Filepath: cleanPathWithBase(baseDir, pkt.getPath()),
}
request.ctx, request.cancelCtx = context.WithCancel(ctx)
} `
The text was updated successfully, but these errors were encountered: