(file) Return to SystemWindows.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/SystemWindows.cpp between version 1.68 and 1.70

version 1.68, 2006/10/31 19:47:32 version 1.70, 2006/11/10 18:14:58
Line 348 
Line 348 
             userId.append(Char16(userName[i]));             userId.append(Char16(userName[i]));
         }         }
  
         } else      }
       else
         {         {
                 //userId.append(userName);                 //userId.append(userName);
         Uint32 n = wcslen(userName);         Uint32 n = wcslen(userName);
Line 382 
Line 383 
         userId.append(Char16(pUserName[i]));         userId.append(Char16(pUserName[i]));
     }     }
  
   
     return userId;     return userId;
 #endif #endif
 } }
Line 437 
Line 437 
     LPUSER_INFO_1 pUserInfo = NULL;     LPUSER_INFO_1 pUserInfo = NULL;
     NET_API_STATUS nStatus = NULL;     NET_API_STATUS nStatus = NULL;
  
     // Make a copy of the specified username, it cannot be used directly because it's      // Make a copy of the specified username, it cannot be used directly
     // declared as const and strchr() may modify the string.      // because it's declared as const and strchr() may modify the string.
     strncpy(tUserName, userName, sizeof(tUserName) - 1);     strncpy(tUserName, userName, sizeof(tUserName) - 1);
     tUserName[sizeof(tUserName)- 1] = '\0';     tUserName[sizeof(tUserName)- 1] = '\0';
  
Line 450 
Line 450 
         strcpy(mUserName, pbs+1);         strcpy(mUserName, pbs+1);
         usingDomain = true;         usingDomain = true;
  
     } else if ((NULL != (pbs = (strchr(tUserName, '@')))) ||      }
       else if ((NULL != (pbs = (strchr(tUserName, '@')))) ||
                (NULL != (pbs = (strchr(tUserName, '.')))))                (NULL != (pbs = (strchr(tUserName, '.')))))
     {     {
         *pbs = '\0';         *pbs = '\0';
Line 458 
Line 459 
         strcpy(mUserName, tUserName);         strcpy(mUserName, tUserName);
         usingDomain = true;         usingDomain = true;
  
     } else      }
       else
     {     {
         strcpy(mDomainName, ".");         strcpy(mDomainName, ".");
         strcpy(mUserName, tUserName);         strcpy(mUserName, tUserName);
     }     }
  
     //convert domain name to unicode     //convert domain name to unicode
     if (!MultiByteToWideChar(CP_ACP, 0, mDomainName, -1, wDomainName, strlen(mDomainName)+1))      if (!MultiByteToWideChar(
               CP_ACP, 0, mDomainName, -1, wDomainName, strlen(mDomainName) + 1))
     {     {
         return false;         return false;
     }     }
  
     //convert username to unicode     //convert username to unicode
     if (!MultiByteToWideChar(CP_ACP, 0, mUserName, -1, wUserName, strlen(mUserName)+1))      if (!MultiByteToWideChar(
               CP_ACP, 0, mUserName, -1, wUserName, strlen(mUserName) + 1))
     {     {
         return false;         return false;
     }     }
Line 482 
Line 486 
         DWORD rc = NetGetDCName(NULL, wDomainName, &pComputerName);         DWORD rc = NetGetDCName(NULL, wDomainName, &pComputerName);
         if (rc == NERR_Success)         if (rc == NERR_Success)
         {         {
             wcscpy(wDomainName, (LPWSTR) pComputerName); //this is automatically prefixed with "\\"              // this is automatically prefixed with "\\"
               wcscpy(wDomainName, (LPWSTR) pComputerName);
         }         }
         /*         /*
         else         else
         {         {
             // failover             // failover
             // ATTN: This is commented out until there is resolution on Bugzilla 2236. -hns 2/2005              // ATTN: This is commented out until there is resolution on
               // Bugzilla 2236. -hns 2/2005
             // This needs to be more thoroughly tested when we uncomment it out.             // This needs to be more thoroughly tested when we uncomment it out.
  
             PDOMAIN_CONTROLLER_INFO DomainControllerInfo = NULL;             PDOMAIN_CONTROLLER_INFO DomainControllerInfo = NULL;
Line 498 
Line 504 
                              mDomainName,                              mDomainName,
                              NULL,                              NULL,
                              NULL,                              NULL,
                              DS_DIRECTORY_SERVICE_REQUIRED,  //not sure what flags we want here                               //not sure what flags we want here
                                DS_DIRECTORY_SERVICE_REQUIRED,
                              &DomainControllerInfo);                              &DomainControllerInfo);
  
             if (rc == ERROR_SUCCESS && DomainControllerInfo)             if (rc == ERROR_SUCCESS && DomainControllerInfo)
Line 506 
Line 513 
                 strcpy(mDomainName, DomainControllerInfo->DomainName);                 strcpy(mDomainName, DomainControllerInfo->DomainName);
                 NetApiBufferFree(DomainControllerInfo);                 NetApiBufferFree(DomainControllerInfo);
  
                 if (!MultiByteToWideChar(CP_ACP, 0, mDomainName, -1, wDomainName, strlen(mDomainName)+1))                  if (!MultiByteToWideChar(
                           CP_ACP, 0, mDomainName, -1, wDomainName,
                           strlen(mDomainName) + 1))
                 {                 {
                     return false;                     return false;
                 }                 }
Line 568 
Line 577 
         strcpy(mUserName, pbs+1);         strcpy(mUserName, pbs+1);
         usingDomain = true;         usingDomain = true;
  
     } else if ((NULL != (pbs = (strchr(userStr, '@')))) ||      }
       else if ((NULL != (pbs = (strchr(userStr, '@')))) ||
                (NULL != (pbs = (strchr(userStr, '.')))))                (NULL != (pbs = (strchr(userStr, '.')))))
     {     {
         *pbs = '\0';         *pbs = '\0';
Line 576 
Line 586 
         strcpy(mUserName, userStr);         strcpy(mUserName, userStr);
         usingDomain = true;         usingDomain = true;
  
     } else      }
       else
     {     {
         strcpy(mDomainName, ".");         strcpy(mDomainName, ".");
         strcpy(mUserName, userStr);         strcpy(mUserName, userStr);
     }     }
  
     //convert domain name to unicode     //convert domain name to unicode
     if (!MultiByteToWideChar(CP_ACP, 0, mDomainName, -1, wDomainName, strlen(mDomainName)+1))      if (!MultiByteToWideChar(
               CP_ACP, 0, mDomainName, -1, wDomainName, strlen(mDomainName) + 1))
     {     {
         return false;         return false;
     }     }
  
     //convert username to unicode     //convert username to unicode
     if (!MultiByteToWideChar(CP_ACP, 0, mUserName, -1, wUserName, strlen(mUserName)+1))      if (!MultiByteToWideChar(
               CP_ACP, 0, mUserName, -1, wUserName, strlen(mUserName) + 1))
     {     {
         return false;         return false;
     }     }
Line 600 
Line 613 
         DWORD rc = NetGetDCName(NULL, wDomainName, &pComputerName);         DWORD rc = NetGetDCName(NULL, wDomainName, &pComputerName);
         if (rc == NERR_Success)         if (rc == NERR_Success)
         {         {
             wcscpy(wDomainName, (LPWSTR) pComputerName); //this is automatically prefixed with "\\"              // this is automatically prefixed with "\\"
               wcscpy(wDomainName, (LPWSTR) pComputerName);
         }         }
         /*         /*
         else         else
         {         {
             // failover             // failover
             // ATTN: This is commented out until there is resolution on Bugzilla 2236. -hns 2/2005              // ATTN: This is commented out until there is resolution on
               // Bugzilla 2236. -hns 2/2005
             // This needs to be more thoroughly tested when we uncomment it out.             // This needs to be more thoroughly tested when we uncomment it out.
  
             PDOMAIN_CONTROLLER_INFO DomainControllerInfo = NULL;             PDOMAIN_CONTROLLER_INFO DomainControllerInfo = NULL;
Line 616 
Line 631 
                              mDomainName,                              mDomainName,
                              NULL,                              NULL,
                              NULL,                              NULL,
                              DS_DIRECTORY_SERVICE_REQUIRED,  //not sure what flags we want here                               // not sure what flags we want here
                                DS_DIRECTORY_SERVICE_REQUIRED,
                              &DomainControllerInfo);                              &DomainControllerInfo);
  
             if (rc == ERROR_SUCCESS && DomainControllerInfo)             if (rc == ERROR_SUCCESS && DomainControllerInfo)
Line 624 
Line 640 
                 strcpy(mDomainName, DomainControllerInfo->DomainName);                 strcpy(mDomainName, DomainControllerInfo->DomainName);
                 NetApiBufferFree(DomainControllerInfo);                 NetApiBufferFree(DomainControllerInfo);
  
                 if (!MultiByteToWideChar(CP_ACP, 0, mDomainName, -1, wDomainName, strlen(mDomainName)+1))                  if (!MultiByteToWideChar(
                           CP_ACP, 0, mDomainName, -1, wDomainName,
                           strlen(mDomainName) + 1))
                 {                 {
                     return false;                     return false;
                 }                 }
Line 664 
Line 682 
     // ATTN-NB-03-20000304: Implement better way to get the privileged     // ATTN-NB-03-20000304: Implement better way to get the privileged
     // user on the system.     // user on the system.
  
     return (String("Administrator"));      return String("Administrator");
 } }
  
 Boolean System::isGroupMember(const char* userName, const char* groupName) Boolean System::isGroupMember(const char* userName, const char* groupName)
Line 858 
Line 876 
       if (*p == '/')       if (*p == '/')
           *p = '\\';           *p = '\\';
  
     return (strcasecmp(_fullpath( full, path_slash, _MAX_PATH ), path_slash) == 0) ? true : false;      return (strcasecmp(
           _fullpath(full, path_slash, _MAX_PATH), path_slash) == 0);
 } }
  
 // Changes file permissions on the given file. // Changes file permissions on the given file.
Line 880 
Line 899 
     // Not implemented     // Not implemented
 } }
  
   void System::openlog(const char *ident, int logopt, int facility)
   {
       // Not implemented
   }
   
   void System::closelog()
   {
       // Not implemented
   }
   
   
   
 // System ID constants for Logger::put and Logger::trace // System ID constants for Logger::put and Logger::trace
 const String System::CIMSERVER = "cimserver";  // Server system ID const String System::CIMSERVER = "cimserver";  // Server system ID
  
Line 926 
Line 957 
                 {                 {
                     free(output_buf);                     free(output_buf);
                     closesocket(sock);                     closesocket(sock);
                     return(true);                      return true;
                   }
                 }                 }
             }             }
         } else {          else
           {
             free(output_buf);             free(output_buf);
             return false;             return false;
         }         }


Legend:
Removed from v.1.68  
changed lines
  Added in v.1.70

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2