Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-17144

Strange code in getScopePermissions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4.0
    • Component/s: LDAP
    • Labels:
      None

      Description

      Noticed this while looking for something else:

      static SecAccessFlags getScopePermissions(const char *scopename,IUserDescriptor *user,unsigned auditflags)
      {  // scope must be normalized already
          static bool permissionsavail=true;
          if (auditflags==(unsigned)-1)
              return permissionsavail ? SecAccess_Access : SecAccess_None;
          SecAccessFlags perms = SecAccess_Full;
          if (permissionsavail&&scopename&&*scopename&&((*scopename!='.')||scopename[1])) {
              if (!user)
              {
      #ifdef NULL_DALIUSER_STACKTRACE
                  DBGLOG("UNEXPECTED USER (NULL) in dadfs.cpp getScopePermissions() line %d",__LINE__);
                  //following debug code to be removed
                  PrintStackReport();
      #endif
                  user = queryDistributedFileDirectory().queryDefaultUser();
              }
              perms = querySessionManager().getPermissionsLDAP(queryDfsXmlBranchName(DXB_Scope),scopename,user,auditflags);
              if (perms<0) {
                  if (perms == SecAccess_Unavailable) {
                      permissionsavail=false;
                      perms = SecAccess_Full;
                  }
                  else
                      perms = SecAccess_None;
              }
          }
          return perms;
      }
      

      A query which results in a return value of SecAccess_Unavailable will return SecAccess_Full the first time this function is called but SecAccess_None (if auditflags is set) on subsequent calls.

        Attachments

          Activity

            People

            • Assignee:
              russwhitehead Russ Whitehead
              Reporter:
              richardkchapman Richard Chapman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: