forked from openssh/openssh-portable
-
Notifications
You must be signed in to change notification settings - Fork 325
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
add motw to scp and sftp #614
Merged
tgauth
merged 17 commits into
PowerShell:latestw_all
from
tgauth:tessgauthier/scp-sftp-motw-fix
Sep 8, 2022
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
08f619d
add motw to scp and sftp
tgauth 6b053c8
retrigger appveyor
tgauth fefb6ac
fix motw for filepaths with unicode characters
tgauth 8ae735c
modify error handling
tgauth a0e36bc
add debug for appveyor
tgauth 3fe5bba
modify motw method to use openssh method to open filestream
tgauth b748735
fix return value for null fileStreamPath pointer
tgauth b4b9605
fix spacing, comments, and failure message
tgauth ee6eeb8
clean up mark of the web method
tgauth 77fab9d
incorporate MapUrlToZone for sftp & partially scp
tgauth 1e1973e
update scp for motw failure case
tgauth 967d9f4
Update contrib/win32/win32compat/misc.c
tgauth b769ecc
address pr review comments
tgauth ef40c61
refactor failure handling in motw methods
tgauth d78c66d
add CoUnitialize after CoInitializeEx call
tgauth 56bb9d5
use urlmon.h constants for com instance
tgauth fc43413
update var name for consistency
tgauth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,9 @@ | |
|
||
#include "sftp-common.h" | ||
#include "sftp-client.h" | ||
#ifdef WINDOWS | ||
#include "misc_internal.h" | ||
#endif // WINDOWS | ||
|
||
extern char *__progname; | ||
|
||
|
@@ -1138,6 +1141,9 @@ do_sftp_connect(char *host, char *user, int port, char *sftp_direct, | |
reminp, remoutp, pidp) < 0) | ||
return NULL; | ||
} | ||
#ifdef WINDOWS | ||
get_zone_identifier(host); | ||
#endif // WINDOWS | ||
return do_init(*reminp, *remoutp, 32768, 64, limit_kbps); | ||
} | ||
|
||
|
@@ -1436,6 +1442,9 @@ tolocal(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct) | |
continue; | ||
} | ||
/* SCP */ | ||
#ifdef WINDOWS | ||
get_zone_identifier(host); | ||
#endif // WINDOWS | ||
xasprintf(&bp, "%s -f %s%s", | ||
cmd, *src == '-' ? "-- " : "", src); | ||
if (do_cmd(ssh_program, host, suser, sport, 0, bp, | ||
|
@@ -2074,6 +2083,12 @@ sink(int argc, char **argv, const char *src) | |
omode = mode; | ||
mode |= S_IWUSR; | ||
#ifdef WINDOWS | ||
if (add_mark_of_web(np) == -1) { | ||
if (verbose_mode) { | ||
note_err("%s: add_mark_of_web failed\n", np); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this message handled differently than in sftp-client.c/sftp-server.c (where is uses |
||
} | ||
} | ||
|
||
// In windows, we would like to inherit the parent folder permissions by setting mode to USHRT_MAX. | ||
if ((ofd = open(np, O_WRONLY|O_CREAT, USHRT_MAX)) == -1) { | ||
#else | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a typo in
zoneIndentifierLen
, it should bezoneIdentifierLen
.