Skip to content

Conversation

@fit2bot
Copy link
Contributor

@fit2bot fit2bot commented Jan 4, 2026

perf: fix websftp root account folder locked

@fit2bot fit2bot requested a review from a team January 4, 2026 09:49
}
if ad.isRoot && ad.info.IsDir() {
return ad.info.Mode() | os.ModePerm
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were no found differences or irregularities between the two versions of the provided code snippet. Both versions seem to be consistent with the context provided, and there is nothing that could potentially cause bugs or problems.

However, since I do not see any issues right away, it might be worth considering if you're dealing with real production code where every function may have its own unique set of requirements and constraints which need careful examination especially when compared over time.

Also consider that these files are from the last year but they should still follow the standard coding practices applicable today such as using Go's built-in os.ModeType which would align better than trying to manually define permissions this way even though the first version did not return os.FileMode. In addition, using os.ModeMask in conjunction with o.Syscall() rather than doing an explicit mode cast can yield cleaner looking errors like err != nil, instead of being limited to just "no error" conditions without knowing what went wrong precisely.

For instance,

return ret.Call("open", "/path/to/folder/path")

Would more clearly explain why open syscall failed because opening directories in Linux has different semantics than Windows due to the concept of a 'root' user.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 4, 2026

@LeeEirc LeeEirc merged commit f1dd522 into dev Jan 4, 2026
10 of 11 checks passed
@LeeEirc LeeEirc deleted the pr@dev@fix_root_websftp branch January 4, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants