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

Diff for /pegasus/src/Pegasus/Common/CIMObjectPath.cpp between version 1.48 and 1.53.10.2

version 1.48, 2005/03/26 15:52:03 version 1.53.10.2, 2006/02/10 16:09:34
Line 1 
Line 1 
 //%2005////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
Line 8 
Line 8 
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 // EMC Corporation; VERITAS Software Corporation; The Open Group. // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 33 
Line 35 
 //              Carol Ann Krug Graves, Hewlett-Packard Company //              Carol Ann Krug Graves, Hewlett-Packard Company
 //                (carolann_graves@hp.com) //                (carolann_graves@hp.com)
 //              Dave Sudlik, IBM (dsudlik@us.ibm.com) //              Dave Sudlik, IBM (dsudlik@us.ibm.com)
   //              Vijay Eli, IBM (vijayeli@in.ibm.com), bug#2556.
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 43 
Line 46 
 #include "CIMObjectPath.h" #include "CIMObjectPath.h"
 #include "Indentor.h" #include "Indentor.h"
 #include "CIMName.h" #include "CIMName.h"
 #include "Destroyer.h"  
 #include "XmlWriter.h" #include "XmlWriter.h"
 #include "XmlReader.h" #include "XmlReader.h"
 #include "ArrayInternal.h" #include "ArrayInternal.h"
Line 222 
Line 224 
 //  case CIMTYPE_REAL32: //  case CIMTYPE_REAL32:
 //  case CIMTYPE_REAL64: //  case CIMTYPE_REAL64:
     case CIMTYPE_OBJECT:     case CIMTYPE_OBJECT:
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
       case CIMTYPE_INSTANCE:
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
         // From PEP 194: EmbeddedObjects cannot be keys.         // From PEP 194: EmbeddedObjects cannot be keys.
         throw TypeMismatchException();         throw TypeMismatchException();
         break;         break;
Line 311 
Line 316 
 //      case CIMTYPE_REAL32: //      case CIMTYPE_REAL32:
 //      case CIMTYPE_REAL64: //      case CIMTYPE_REAL64:
         case CIMTYPE_OBJECT:         case CIMTYPE_OBJECT:
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
           case CIMTYPE_INSTANCE:
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
             // From PEP 194: EmbeddedObjects cannot be keys.             // From PEP 194: EmbeddedObjects cannot be keys.
             return false;             return false;
             break;             break;
Line 468 
Line 476 
  
         Boolean isValid = false;         Boolean isValid = false;
  
         if (hostname[0].isDigit())          if (isascii(hostname[0]) && isdigit(hostname[0]))
         {         {
             //--------------------------------------------------------------             //--------------------------------------------------------------
             // Attempt to validate an IP address, but keep in mind that it             // Attempt to validate an IP address, but keep in mind that it
Line 485 
Line 493 
                 // If a non-digit is encountered in the input parameter,                 // If a non-digit is encountered in the input parameter,
                 // then break from here and attempt to validate as host name.                 // then break from here and attempt to validate as host name.
                 //----------------------------------------------------------                 //----------------------------------------------------------
                 if (!hostname[i].isDigit())                  if (!(isascii(hostname[i]) && isdigit(hostname[i])))
                 {                 {
                     isValid = false;                     isValid = false;
                     break;                     break;
                 }                 }
  
                 while (hostname[i].isDigit())  // skip over digits                  // skip over digits
                   while (isascii(hostname[i]) && isdigit(hostname[i]))
                 {                 {
                     octetValue = octetValue*10 + (hostname[i] - '0');                     octetValue = octetValue*10 + (hostname[i] - '0');
                     i++;                     i++;
Line 534 
Line 543 
                 expectHostSegment = false;                 expectHostSegment = false;
                 hostSegmentIsNumeric = true; // assume all-numeric host segment                 hostSegmentIsNumeric = true; // assume all-numeric host segment
  
                 if (!hostname[i].isAlnum())                  if (!(isascii(hostname[i]) &&
                         (isalnum(hostname[i]) || (hostname[i] == '_'))))
                 {                 {
                     return false;                     return false;
                 }                 }
  
                 while (hostname[i].isAlnum() || (hostname[i] == '-'))                  while (isascii(hostname[i]) &&
                          (isalnum(hostname[i]) || (hostname[i] == '-') ||
                           (hostname[i] == '_')))
                 {                 {
                     // If a non-digit is encountered, set "all-numeric"                     // If a non-digit is encountered, set "all-numeric"
                     // flag to false                     // flag to false
                     if (hostname[i].isAlpha() || (hostname[i] == '-')) {                      if (isalpha(hostname[i]) || (hostname[i] == '-') ||
                                                   (hostname[i] == '_')) {
                         hostSegmentIsNumeric = false;                         hostSegmentIsNumeric = false;
                     }                     }
                     i++;                     i++;
Line 571 
Line 584 
  
         if (hostname[i] == ':')         if (hostname[i] == ':')
         {         {
             if (!hostname[++i].isDigit())              i++;
               if (!(isascii(hostname[i]) && isdigit(hostname[i])))
             {             {
                 return false;                 return false;
             }             }
               i++;
  
             while (hostname[++i].isDigit());              while (isascii(hostname[i]) && isdigit(hostname[i]))
               {
                   i++;
               }
         }         }
  
         return (hostname[i] == char(0));         return (hostname[i] == char(0));


Legend:
Removed from v.1.48  
changed lines
  Added in v.1.53.10.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2