Skip to content

add motw to scp and sftp#614

Merged
tgauth merged 17 commits intoPowerShell:latestw_allfrom
tgauth:tessgauthier/scp-sftp-motw-fix
Sep 8, 2022
Merged

add motw to scp and sftp#614
tgauth merged 17 commits intoPowerShell:latestw_allfrom
tgauth:tessgauthier/scp-sftp-motw-fix

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.

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
tgauth and others added 2 commits August 19, 2022 10:02
Co-authored-by: Paul Higinbotham <paulhi@microsoft.com>
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

#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