Changeset 2526


Ignore:
Timestamp:
Feb 5, 2006, 4:40:18 AM (20 years ago)
Author:
bird
Message:

#41: And added special file mode mask getter and extra validations to check that the mode mask we read has a valid type. This also shuts up some bad [f]chmod paths.

Location:
branches/libc-0.6/src/emx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/ChangeLog.LIBC

    r2525 r2526  
    1212        o #25: Ensure correct address length returns from recvmsg and recvfrom.
    1313    - libc:
    14         o #41: Calc st_ino and st_dev at the end of the unix attrib getter if they
    15           are not present. And added special file mode mask getter.
     14        o #41: And added special file mode mask getter and extra validations to check that
     15          the mode mask we read has a valid type. This also shuts up some bad [f]chmod paths.
     16        o #41: Calc st_ino and st_dev at the end of the unix attrib getter if they are not present.
    1617        o #40: Fixed double slash preventing root directories from being opened.
    1718        o #23: Fixed two incorrect EA size fields, now creating symlinks really works.
  • branches/libc-0.6/src/emx/src/lib/sys/fs.c

    r2525 r2526  
    14511451                            pStat->st_gid  = u32;
    14521452                        else if (COMPARE_EANAME(__libc_gszModeEA))
    1453                             pStat->st_mode = u32;
     1453                        {
     1454                            if (    S_ISDIR(u32)  || S_ISCHR(u32) || S_ISBLK(u32)  || S_ISREG(u32)
     1455                                ||  S_ISFIFO(u32) || S_ISLNK(u32) || S_ISSOCK(u32) || S_ISWHT(u32))
     1456                                pStat->st_mode = u32;
     1457                            else
     1458                                LIBC_ASSERTM_FAILED("Invalid file mode EA: u32=0%o (st_mode=0%o)\n", u32, pStat->st_mode);
     1459                        }
    14541460                        else if (COMPARE_EANAME(__libc_gszRDevEA))
    14551461                            pStat->st_rdev = u32;
     
    15851591         {
    15861592             uint32_t u32 = *(uint32_t *)(pusType + 2);
    1587              *pMode = u32;
    1588              rc = 0;
     1593             if (    S_ISDIR(u32)  || S_ISCHR(u32) || S_ISBLK(u32)  || S_ISREG(u32)
     1594                 ||  S_ISFIFO(u32) || S_ISLNK(u32) || S_ISSOCK(u32) || S_ISWHT(u32))
     1595             {
     1596                 *pMode = u32;
     1597                 rc = 0;
     1598             }
     1599             else
     1600                 LIBC_ASSERTM_FAILED("Invalid file mode EA: u32=0%o (st_mode=0%o)\n", u32, pStat->st_mode);
    15891601         }
    15901602         else
Note: See TracChangeset for help on using the changeset viewer.