Skip to content

Fix SftpFileAttributes file type detection #1688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Rob-Hague
Copy link
Collaborator

To get the file type, S_IFMT should be used as the mask. Instead it was using each file type as the mask. It meant that e.g. a symbolic link would also show as a regular file and a character device.

Also allow setting and retrieving the setuid/setgid/sticky bits

closes #1000
closes #159

To get the file type, S_IFMT should be used as the mask. Instead it was using each file
type as the mask. It meant that e.g. a symbolic link would also show as a regular file
and a character device.

Also allow setting and retrieving the setuid/setgid/sticky bits
@@ -506,7 +708,7 @@ public byte[] GetBytes()
{
uint flag = 0;

if (IsSizeChanged && IsRegularFile)
Copy link
Collaborator Author

@Rob-Hague Rob-Hague Aug 12, 2025

Choose a reason for hiding this comment

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

I have removed the IsRegularFile condition because I don't think it needs to exist. And given the bug, this condition would still have passed for a symbolic link, so this is more like keeping the behaviour the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant