Skip to content

Commit 2bf8005

Browse files
authored
limit scp mark of the web attempt to pull case and change logging to debug3 (#652)
1 parent ba5a84b commit 2bf8005

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

contrib/win32/win32compat/misc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,24 +2177,24 @@ add_mark_of_web(const char* filename)
21772177

21782178
int ofd, status = 0;
21792179
char* zoneIdentifierStr = NULL;
2180-
size_t zoneIndentifierLen = strlen("[ZoneTransfer]\nZoneId=") + 1 + 1;
2180+
size_t zoneIdentifierLen = strlen("[ZoneTransfer]\nZoneId=") + 1 + 1;
21812181

2182-
zoneIdentifierStr = malloc(zoneIndentifierLen * sizeof(char));
2182+
zoneIdentifierStr = malloc(zoneIdentifierLen * sizeof(char));
21832183

21842184
if (zoneIdentifierStr == NULL) {
21852185
status = -1;
21862186
goto cleanup;
21872187
}
21882188

2189-
sprintf_s(zoneIdentifierStr, zoneIndentifierLen, "[ZoneTransfer]\nZoneId=%d", motw_zone_id);
2189+
sprintf_s(zoneIdentifierStr, zoneIdentifierLen, "[ZoneTransfer]\nZoneId=%d", motw_zone_id);
21902190

21912191
// create zone identifer file stream and then write the Mark of the Web to it
21922192
if ((ofd = open(fileStreamPath, O_WRONLY | O_CREAT, USHRT_MAX)) == -1) {
21932193
status = -1;
21942194
goto cleanup;
21952195
}
21962196

2197-
if (atomicio(vwrite, ofd, zoneIdentifierStr, zoneIndentifierLen) != zoneIndentifierLen) {
2197+
if (atomicio(vwrite, ofd, zoneIdentifierStr, zoneIdentifierLen) != zoneIdentifierLen) {
21982198
status = -1;
21992199
}
22002200

scp.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,10 +2081,9 @@ sink(int argc, char **argv, const char *src)
20812081
omode = mode;
20822082
mode |= S_IWUSR;
20832083
#ifdef WINDOWS
2084-
if (add_mark_of_web(np) == -1) {
2085-
if (verbose_mode) {
2086-
note_err("%s: add_mark_of_web failed\n", np);
2087-
}
2084+
// only attempt mark of the web for pull case (from remote to local)
2085+
if (!iamremote && add_mark_of_web(np) == -1) {
2086+
debug3_f("%s: add_mark_of_web failed\n", np);
20882087
}
20892088

20902089
// In windows, we would like to inherit the parent folder permissions by setting mode to USHRT_MAX.

0 commit comments

Comments
 (0)