Skip to content
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
merged 17 commits into from
Sep 8, 2022

Conversation

tgauth
Copy link
Collaborator

@tgauth tgauth commented Jul 25, 2022

PR Summary

address PowerShell/Win32-OpenSSH#1964

PR Context

Add mark of the web for files transferred via scp & sftp to address bypassing protected view for Office files. For scp and the sftp server, if adding the mark of the web fails, file transfer will fail. For the sftp client, if adding the mark of the web fails, the transferred file will be removed.

sftp-server.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
scp.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
sftp-server.c Outdated Show resolved Hide resolved
Copy link

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tgauth tgauth requested a review from PaulHigin August 18, 2022 19:23
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
scp.c Outdated Show resolved Hide resolved
sftp-client.c Outdated Show resolved Hide resolved
tgauth and others added 2 commits August 19, 2022 10:02
Co-authored-by: Paul Higinbotham <paulhi@microsoft.com>
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
contrib/win32/win32compat/misc.c Outdated Show resolved Hide resolved
Copy link

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -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);
Copy link

@rgl rgl Dec 17, 2022

Choose a reason for hiding this comment

The 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 debug instead of note_err)?


int ofd, status = 0;
char* zoneIdentifierStr = NULL;
size_t zoneIndentifierLen = strlen("[ZoneTransfer]\nZoneId=") + 1 + 1;
Copy link

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 be zoneIdentifierLen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants