version 1.22, 2002/09/20 19:40:11
|
version 1.25.2.1, 2003/02/06 20:47:03
|
|
|
{ | { |
Uint32 n = x.size(); | Uint32 n = x.size(); |
| |
|
// |
|
// If the key is a reference, the keys in the reference must also be |
|
// sorted |
|
// |
|
for (Uint32 k = 0; k < n ; k++) |
|
if (x[k].getType () == CIMKeyBinding::REFERENCE) |
|
{ |
|
CIMObjectPath tmp (x[k].getValue ()); |
|
Array <CIMKeyBinding> keyBindings = tmp.getKeyBindings (); |
|
_BubbleSort (keyBindings); |
|
tmp.setKeyBindings (keyBindings); |
|
x[k].setValue (tmp.toString ()); |
|
} |
|
|
if (n < 2) | if (n < 2) |
return; | return; |
| |
|
|
| |
p += 2; | p += 2; |
| |
|
char* q = p; |
|
|
|
|
|
// ATTN: this has been disabled because the host name format depends |
|
// on the commuication protocol, which is not specified by the CIM |
|
// standard. It is, therefore, impractical to attempt to validate it. |
|
// The host name should flow through the CIMOM unmodified and |
|
// Clients/Providers can validate as needed. |
|
|
//---------------------------------------------------------------------- | //---------------------------------------------------------------------- |
// Validate the hostname. Hostnames must match the following |
// Validate the hostname. A domain is allowed after the hostname. |
// regular expression: "[A-Za-z][A-Za-z0-9-]*" |
// Eg. xyz.company.com |
|
// Hostnames must match the following regular expression: |
|
// ^([A-Za-z][A-Za-z0-9-]*)(\.[A-Za-z][A-Za-z0-9-]*)*$ |
//---------------------------------------------------------------------- | //---------------------------------------------------------------------- |
| |
char* q = p; |
|
| |
if (!isalpha(*q)) |
|
throw MalformedObjectNameException(objectName); |
|
| |
q++; |
// some host names may need to start with a number |
| |
while (isalnum(*q) || *q == '-') |
// if (!isalpha(*q)) |
|
// throw IllformedObjectName(objectName); |
|
|
|
|
|
|
|
do |
|
{ |
|
q++; |
|
while (isalnum(*q) || *q == '-' || *q == '_') |
q++; | q++; |
|
} while (*q == '.'); |
|
|
| |
// We now expect a port (or default the port). | // We now expect a port (or default the port). |
| |
|
|
return false; | return false; |
} | } |
| |
|
// A ':' as part of a keybinding value should not be interpreted as |
|
// a namespace delimiter. Since keybinding pairs follow the first '.' |
|
// in the object path string, the ':' delimiter only counts if it |
|
// appears before the '.'. |
|
|
|
char* dot = strchr(p, '.'); |
|
if (dot && (dot < colon)) |
|
{ |
|
return false; |
|
} |
|
|
//---------------------------------------------------------------------- | //---------------------------------------------------------------------- |
// Validate the namespace path. Namespaces must match the following | // Validate the namespace path. Namespaces must match the following |
// regular expression: "[A-Za-z_]+(/[A-Za-z_]+)*" | // regular expression: "[A-Za-z_]+(/[A-Za-z_]+)*" |