Skip to content

[filebrowser] fix: normalize paths in copy/move same-path guard#4341

Open
HalimKim wants to merge 1 commit into
cloudera:masterfrom
HalimKim:fix/filebrowser-copy-move-same-path
Open

[filebrowser] fix: normalize paths in copy/move same-path guard#4341
HalimKim wants to merge 1 commit into
cloudera:masterfrom
HalimKim:fix/filebrowser-copy-move-same-path

Conversation

@HalimKim

@HalimKim HalimKim commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Copying or moving a directory to the same path with only a trailing-slash difference (e.g. /user/systest/tmp -> /user/systest/tmp/) bypassed the raw string equality guard. webhdfs then normalized the slash away, appended the source basename to the existing destination dir, and recursed into the freshly created subdirectory, producing an infinitely nested copy.

Compare request.fs.normpath() of both paths so semantically identical paths are detected as the same. Add tests covering the trailing-slash rejection and the genuinely-different-destination happy path for both copy and move.

What changes were proposed in this pull request?

  • instead of simply comparing strinv values of src and dest, use normpath() method

How was this patch tested?

  • manual test has been done

Please review Hue Contributing Guide before opening a pull request.

Copying or moving a directory to the same path with only a trailing-slash
difference (e.g. /user/systest/tmp -> /user/systest/tmp/) bypassed the raw
string equality guard. webhdfs then normalized the slash away, appended the
source basename to the existing destination dir, and recursed into the freshly
created subdirectory, producing an infinitely nested copy.

Compare request.fs.normpath() of both paths so semantically identical paths
are detected as the same. Add tests covering the trailing-slash rejection and
the genuinely-different-destination happy path for both copy and move.
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.

1 participant