Fixed an issue with sget throwing excessive error messages when testing
for the presence of a Hdb node
This commit is contained in:
@@ -1521,7 +1521,10 @@ pHdb AddSICSHdbMemPar(pHdb parent, char *name, int priv,
|
||||
return child;
|
||||
}
|
||||
|
||||
/*==================== access support functions ==============================*/
|
||||
/*==================== access support functions ==============================
|
||||
This has become an eierlegendewollmilchsau function. I do not know how and when
|
||||
that happened
|
||||
==============================================================================*/
|
||||
pHdb FindHdbParent(char *rootpath, char *relpath, char **namePtr,
|
||||
SConnection * pCon)
|
||||
{
|
||||
@@ -1597,7 +1600,7 @@ pHdb FindHdbParent(char *rootpath, char *relpath, char **namePtr,
|
||||
SCPrintf(pCon, eError, "ERROR: parent of %s not found",
|
||||
buffer);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
/* the name must be taken from the end of relpath, as element is no longer valid */
|
||||
*namePtr = relpath + (element - buffer);
|
||||
return parent; /* parent found, and node does not yet exist */
|
||||
@@ -1630,7 +1633,37 @@ pHdb FindHdbNode(char *rootpath, char *relpath, SConnection * pCon)
|
||||
{
|
||||
return FindHdbParent(rootpath, relpath, NULL, pCon);
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
pHdb FindHdbIntern(char *path)
|
||||
{
|
||||
char *element, *slash;
|
||||
pHdb parent = NULL;
|
||||
pObjectDescriptor pDes = NULL;
|
||||
|
||||
element = path;
|
||||
if(strncmp(element,"/sics/",6) == 0){
|
||||
slash = strchr(element+6,'/');
|
||||
if(slash != NULL){
|
||||
*slash = '\0';
|
||||
}
|
||||
pDes = FindCommandDescriptor(pServ->pSics,element+6);
|
||||
if(pDes == NULL){
|
||||
return NULL;
|
||||
}
|
||||
parent = pDes->parNode;
|
||||
if(parent == NULL){
|
||||
return NULL;
|
||||
}
|
||||
if(slash == NULL){
|
||||
return parent;
|
||||
}
|
||||
*slash = '/';
|
||||
element = slash + 1;
|
||||
} else {
|
||||
parent = GetHipadabaRoot();
|
||||
}
|
||||
return GetHipadabaNode(parent,element);
|
||||
}
|
||||
/*--------------------------------------------------------------------------
|
||||
* This does not use strlcpy, strlcat on purpose: it caused a bug
|
||||
* There are so many length checks in the code anyway so that is
|
||||
|
||||
Reference in New Issue
Block a user