Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#41 closed defect (fixed)

libc: incorrect __libc_back_fsUnixAttribsGet() usage caused st_dev and st_ino to be 0 in some stat()s and chmod & fchmod to set MODE EA without type

Reported by: bird Owned by: bird
Priority: normal Milestone: libc-0.6.1
Component: libc-backend Version: 0.6
Severity: normal Keywords: unixeas stat
Cc:

Description (last modified by bird)

we're not checking if we actually read any UnixEAs in __libc_back_fsUnixAttribsGet().

Change History (3)

comment:1 Changed 14 years ago by bird

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from new to closed

That's not quite right. the fstat backend is delaying the dev/ino calc until after getting unix attribs and won't do it unless the unix attrib call fails. I've added code to generate ino/dev when they are not present on a successful return from the attribute getter. I've also changed the two set file mode backend functions to use a different API for querying the file-mode mask, both for speed and so we don't add the MODE attribute unless it's already there (i.e. LIBC created the file). That'll cause less worries for now (it'll be changed in 0.7, probably).

comment:2 Changed 14 years ago by anonymous

Added extra validations to the file mode mask to reject invalid ones.

comment:3 Changed 14 years ago by bird

  • Summary changed from libc: st_dev and st_ino isn't set if the file has some EAs but not UnixEAs. to libc: incorrect __libc_back_fsUnixAttribsGet() usage caused st_dev and st_ino to be 0 in some stat()s and chmod & fchmod to set MODE EA without type

Just updated the title to reflect the problems actually solved.

As a side note, there was actually a fchmod() smoke test which was set to 'expected failure' because of the MODE EA screwup.

Note: See TracTickets for help on using tickets.