mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-29 16:54:51 +02:00
limit scp mark of the web attempt to pull case and change logging to debug3 (#652)
This commit is contained in:
parent
ba5a84ba35
commit
2bf8005da1
@ -2177,16 +2177,16 @@ add_mark_of_web(const char* filename)
|
|||||||
|
|
||||||
int ofd, status = 0;
|
int ofd, status = 0;
|
||||||
char* zoneIdentifierStr = NULL;
|
char* zoneIdentifierStr = NULL;
|
||||||
size_t zoneIndentifierLen = strlen("[ZoneTransfer]\nZoneId=") + 1 + 1;
|
size_t zoneIdentifierLen = strlen("[ZoneTransfer]\nZoneId=") + 1 + 1;
|
||||||
|
|
||||||
zoneIdentifierStr = malloc(zoneIndentifierLen * sizeof(char));
|
zoneIdentifierStr = malloc(zoneIdentifierLen * sizeof(char));
|
||||||
|
|
||||||
if (zoneIdentifierStr == NULL) {
|
if (zoneIdentifierStr == NULL) {
|
||||||
status = -1;
|
status = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf_s(zoneIdentifierStr, zoneIndentifierLen, "[ZoneTransfer]\nZoneId=%d", motw_zone_id);
|
sprintf_s(zoneIdentifierStr, zoneIdentifierLen, "[ZoneTransfer]\nZoneId=%d", motw_zone_id);
|
||||||
|
|
||||||
// create zone identifer file stream and then write the Mark of the Web to it
|
// create zone identifer file stream and then write the Mark of the Web to it
|
||||||
if ((ofd = open(fileStreamPath, O_WRONLY | O_CREAT, USHRT_MAX)) == -1) {
|
if ((ofd = open(fileStreamPath, O_WRONLY | O_CREAT, USHRT_MAX)) == -1) {
|
||||||
@ -2194,7 +2194,7 @@ add_mark_of_web(const char* filename)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (atomicio(vwrite, ofd, zoneIdentifierStr, zoneIndentifierLen) != zoneIndentifierLen) {
|
if (atomicio(vwrite, ofd, zoneIdentifierStr, zoneIdentifierLen) != zoneIdentifierLen) {
|
||||||
status = -1;
|
status = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
7
scp.c
7
scp.c
@ -2081,10 +2081,9 @@ sink(int argc, char **argv, const char *src)
|
|||||||
omode = mode;
|
omode = mode;
|
||||||
mode |= S_IWUSR;
|
mode |= S_IWUSR;
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
if (add_mark_of_web(np) == -1) {
|
// only attempt mark of the web for pull case (from remote to local)
|
||||||
if (verbose_mode) {
|
if (!iamremote && add_mark_of_web(np) == -1) {
|
||||||
note_err("%s: add_mark_of_web failed\n", np);
|
debug3_f("%s: add_mark_of_web failed\n", np);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In windows, we would like to inherit the parent folder permissions by setting mode to USHRT_MAX.
|
// In windows, we would like to inherit the parent folder permissions by setting mode to USHRT_MAX.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user