Skip to content

Windows: Skip symlinks and junctions again #5019 - #5036

Merged
guruz merged 1 commit into
owncloud:2.2from
ckamm:win_reparse_point
Jul 7, 2016
Merged

guruz merged 1 commit into
owncloud:2.2from
ckamm:win_reparse_point

Conversation

@ckamm

@ckamm ckamm commented Jul 6, 2016

Copy link
Copy Markdown
Contributor

Fixes an accidental behavior change introduced in
055c2ef

Affects #4056 and owncloud/enterprise#1225.

@guruz

guruz commented Jul 6, 2016

Copy link
Copy Markdown
Contributor

Where is the mention bot?

@guruz

guruz commented Jul 6, 2016

Copy link
Copy Markdown
Contributor

Thanks @ckamm
Can you make the if() more intuitive? maybe

    if ( (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
         && (handle->ffd.dwReserved0 == IO_REPARSE_TAG_SYMLINK
             || handle->ffd.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT /*junctions*/) ) {
        file_stat->flags |= CSYNC_VIO_FILE_FLAGS_SYMLINK;
        file_stat->type = CSYNC_VIO_FILE_TYPE_SYMBOLIC_LINK;
    } else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_DEVICE
                || handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_OFFLINE
                || handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY) {
        file_stat->type = CSYNC_VIO_FILE_TYPE_UNKNOWN;
    } else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
        file_stat->type = CSYNC_VIO_FILE_TYPE_DIRECTORY;
    } else if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
        // FILE_ATTRIBUTE_REPARSE_POINT that are SIS and DEDUP reparse end up here and should still be synced
        file_stat->type = CSYNC_VIO_FILE_TYPE_REGULAR;
    } else {
        file_stat->type = CSYNC_VIO_FILE_TYPE_REGULAR;
    }

(if i understand the issue correctly..)

So the other values https://msdn.microsoft.com/en-us/library/dd541667.aspx in are all good? So we blacklist IO_REPARSE_TAG_SYMLINK and IO_REPARSE_TAG_MOUNT_POINT?

@guruz guruz added the sev2-high label Jul 6, 2016
@ckamm

ckamm commented Jul 7, 2016

Copy link
Copy Markdown
Contributor Author

@guruz I don't know about the other reparse points. If we wanted, we could mark them as UNKNOWN. I'll update the if to be clearer.

Fixes an accidental behavior change introduced in
055c2ef

Affects owncloud#4056 and owncloud/enterprise#1225.
@ckamm
ckamm force-pushed the win_reparse_point branch from 16f0425 to 20e2f22 Compare July 7, 2016 05:45
@guruz
guruz merged commit 11b4435 into owncloud:2.2 Jul 7, 2016
@guruz
guruz deleted the win_reparse_point branch July 7, 2016 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants