Skip to content

Commit 3386b63

Browse files
committed
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.
1 parent cea99e5 commit 3386b63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wolfsftp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2612,10 +2612,10 @@ static int SFTP_CreateLongName(WS_SFTPNAME* name)
26122612
word32 tmp = atr->per;
26132613

26142614
i = 0;
2615-
if (tmp & FILEATRB_PER_DIR) {
2615+
if ((tmp & FILEATRB_PER_MASK_TYPE) == FILEATRB_PER_DIR) {
26162616
perm[i++] = 'd';
26172617
}
2618-
else if (tmp & FILEATRB_PER_LINK) {
2618+
else if ((tmp & FILEATRB_PER_MASK_TYPE) == FILEATRB_PER_LINK) {
26192619
perm[i++] = 'l';
26202620
}
26212621
else {

0 commit comments

Comments
 (0)