@@ -374,43 +374,41 @@ std::string CResource::CalculateACLRequestFingerprint()
374
374
{
375
375
std::string strPath;
376
376
if (!GetFilePath (" meta.xml" , strPath))
377
- return " " ;
377
+ return {} ;
378
378
379
- CXMLFile* pMetaFile = g_pServerInterface->GetXML ()->CreateXML (strPath.c_str ());
380
- if (!pMetaFile || !pMetaFile ->Parse ())
379
+ std::unique_ptr< CXMLFile> metaFile ( g_pServerInterface->GetXML ()->CreateXML (strPath.c_str () ));
380
+ if (!metaFile || !metaFile ->Parse ())
381
381
{
382
- delete pMetaFile;
383
382
return " " ;
384
383
}
385
384
386
- CXMLNode* pRoot = pMetaFile ->GetRootNode ();
387
- if (!pRoot )
385
+ CXMLNode* root = metaFile ->GetRootNode ();
386
+ if (!root )
388
387
{
389
- delete pMetaFile;
390
388
return " " ;
391
389
}
392
390
391
+ std::ostringstream oss;
393
392
std::string strFingerprint;
394
- CXMLNode* pNodeAclRequest = pRoot ->FindSubNode (" aclrequest" , 0 );
393
+ CXMLNode* nodeAclRequest = root ->FindSubNode (" aclrequest" , 0 );
395
394
396
- if (pNodeAclRequest )
395
+ if (nodeAclRequest )
397
396
{
398
- for (uint uiIndex = 0 ; true ; uiIndex++)
397
+ for (std:: uint8_t uiIndex = 0 ; true ; uiIndex++)
399
398
{
400
- CXMLNode* pNodeRight = pNodeAclRequest ->FindSubNode (" right" , uiIndex);
401
- if (!pNodeRight )
399
+ CXMLNode* nodeRight = nodeAclRequest ->FindSubNode (" right" , uiIndex);
400
+ if (!nodeRight )
402
401
break ;
403
402
404
- std::string strName = pNodeRight ->GetAttributeValue (" name" );
405
- std::string strAccess = pNodeRight ->GetAttributeValue (" access" );
406
-
407
- if (!strFingerprint.empty ())
403
+ std::string strName = nodeRight ->GetAttributeValue (" name" );
404
+ std::string strAccess = nodeRight ->GetAttributeValue (" access" );
405
+
406
+ if (uiIndex > 0 && !strFingerprint.empty ())
408
407
strFingerprint += " ;" ;
409
408
strFingerprint += strName + " :" + strAccess;
410
409
}
411
410
}
412
411
413
- delete pMetaFile;
414
412
return strFingerprint;
415
413
}
416
414
0 commit comments