Fix SFTP Symlinks

1. When making a longname, mask the permission file type bits and check
   it being a link.
2. Mask the permission bits the same way for checking the item being a
   directory.
pull/791/head
John Safranek 2025-03-20 09:02:39 -07:00
parent cea99e5e83
commit 3386b636cf
1 changed files with 2 additions and 2 deletions

View File

@ -2612,10 +2612,10 @@ static int SFTP_CreateLongName(WS_SFTPNAME* name)
word32 tmp = atr->per;
i = 0;
if (tmp & FILEATRB_PER_DIR) {
if ((tmp & FILEATRB_PER_MASK_TYPE) == FILEATRB_PER_DIR) {
perm[i++] = 'd';
}
else if (tmp & FILEATRB_PER_LINK) {
else if ((tmp & FILEATRB_PER_MASK_TYPE) == FILEATRB_PER_LINK) {
perm[i++] = 'l';
}
else {