Details

    • 3
    • 11923

    Description

      There are a few places where strncmp() is used but strcmp() was meant. For example in lod_xattr_set()

              if (S_ISDIR(attr)) {
                      if (strncmp(name, XATTR_NAME_LOV, strlen(XATTR_NAME_LOV)) == 0)
                              rc = lod_xattr_set_lov_on_dir(env, dt, buf, name,
                                                            fl, th, capa);
                      else
                              rc = dt_xattr_set(env, next, buf, name, fl, th, capa);
      

      Clearly we do not meant to do this for all xattrs whose names start with trusted.lov, but only for those whose name is trusted.lov. There are several more such uses out of the 200-odd calls to strncmp(). mgs_setparam() uses the interesting but wrong condition

      strncmp(param, PARAM_LLITE, sizeof(PARAM_LLITE)) == 0
      

      Note: I don't know if these bugs can cause anything bad to happen. But they are bugs and I have seen a few patches in gerrit which would add more.

      Attachments

        Activity

          People

            jhammond John Hammond
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: