sftp: Add new quote commands 'atime' and 'mtime'#5810
sftp: Add new quote commands 'atime' and 'mtime'#5810COFFEETALES wants to merge 1 commit intocurl:masterfrom COFFEETALES:sftp_atime_mtime
Conversation
lib/vssh/libssh.c
Outdated
There was a problem hiding this comment.
The two else if statements look very similar.
Why not try to put them into one and obfuscate the code a bit :-)
|
Thanks! |
|
@COFFEETALES @bagder I've been trying for 2 days now to get this working with curl version Server: Client: Am I missing something? Are there server-side requirements? Verbose output doesn't provide any additional insights. Looking through the server logs didn't show any clear causes. Or sshd is logging the error to some log unknown to me. |
|
$ curl -Q "mtime $now data/bar" -u sftp:pass sftp://server.my.corp:22/data/
The parser expects a single argument for the date, so you need to either use a
format without spaces (e.g. $(date +%s)) or quote it.
|
|
@dfandrich thanks for the reply. Are you actually getting successful results with that? I should clarify that both the client and server are both Fedora 37 machines. |
|
It looks like the +%s format isn't actually supported, but this works fine:
$ curl -Q "mtime \"$(date -R)\" /tmp/foo" sftp://server/tmp/foo
|
|
Wow. That's a very specific syntax. I wouldn't have thought of explicitly using escaped double-quotes. |
In some situations, you may have to change the modified or last accessed date of a specific file.
This PR add new quote commands for sftp only.