Ticket #13 (closed defect: fixed)

Opened 2 years ago

Last modified 23 months ago

Incorrect string comparisons in pvfs2-xattr

Reported by: nlmills Owned by: nlmills
Priority: trivial Milestone:
Component: Admin apps Version: 2.8.2
Keywords: pvfs2-xattr Cc:

Description

The string comparisons in pvfs-xattr use the wrong value for the comparison size. For example:

strncmp(user_opts->key[0].buffer,"user.pvfs2.meta_hint",20) == 0

should be

strncmp(user_opts->key[0].buffer,"user.pvfs2.meta_hint",user_opts->key[0].buffer_sz) == 0

The first example will only compare the first 20 characters of the key. So e.g. if the key contains "user.pvfs2.meta_hint_2" the first comparison will evaluate to TRUE while the second comparison will evaluate to FALSE (the desired result).

Attachments

pvfs2-xattr.patch Download (11.3 KB) - added by nlmills 2 years ago.
Patch implementing correct behavior

Change History

Changed 2 years ago by nlmills

  • status changed from new to accepted

Changed 2 years ago by nlmills

Patch implementing correct behavior

Changed 2 years ago by nlmills

  • status changed from accepted to closed
  • resolution set to fixed

Attached patch attachment:pvfs2-xattr.patch Download also includes some other bugfixes I spotted. Code compiles but is not tested.

Changed 23 months ago by xrumer

In need of  Xrumer files? check out the Xrchat forums!

Note: See TracTickets for help on using tickets.