Selaa lähdekoodia

HPCC-8095 Remove many refs to UNKNOWN_USER

Remove as many of the UNKNOWN_USER that are commented as "MORE:Pass IUserDescriptor"
Also removed an unused function (dfsVerifyFiles)from daliadmin.cpp

Signed-off-by: William Whitehead <william.whitehead@lexisnexis.com>
William Whitehead 12 vuotta sitten
vanhempi
commit
ada3e619ff

+ 1 - 1
common/roxiemanager/referencedfilelist.cpp

@@ -510,7 +510,7 @@ void ReferencedFileList::cloneRelationships()
             if (refAssoc && !(refAssoc->getFlags() & RefFileCopyInfoFailed))
             {
                 dir.addFileRelationship(file.getLogicalName(), assoc, r.queryPrimaryFields(), r.querySecondaryFields(),
-                    r.queryKind(), r.queryCardinality(), r.isPayload(), r.queryDescription());
+                    r.queryKind(), r.queryCardinality(), r.isPayload(), user, r.queryDescription());
             }
         }
     }

+ 6 - 5
common/roxiemanager/roxiewuprocessor.cpp

@@ -839,7 +839,7 @@ public:
 
                 StringBuffer msg;
                 StringBuffer rel_xpath("MetaFileInfo/Relationships/Relationship");
-                addRoxieFileRelationshipsToDali(xml, processingInfo.queryDfsDaliIp(), rel_xpath, true, msg);
+                addRoxieFileRelationshipsToDali(xml, processingInfo.queryDfsDaliIp(), rel_xpath, true, msg, wu->queryUserDescriptor());
 
                 if (me->ordinality())
                     throw me.getClear();
@@ -1035,7 +1035,7 @@ public:
 
 
 //////////////////////////////////////////////////////////////////////////////////////
-    bool addRoxieFileRelationshipsToDali(IPropertyTree *xml, const char *lookupDaliIp, const char *xpath, bool storeResults, StringBuffer &msg)
+    bool addRoxieFileRelationshipsToDali(IPropertyTree *xml, const char *lookupDaliIp, const char *xpath, bool storeResults, StringBuffer &msg, IUserDescriptor *user)
     {
         if (!xml)
             return false;
@@ -1073,7 +1073,8 @@ public:
                     dfuHelper->cloneFileRelationships(lookupDaliIp,// where src relationships are retrieved from (can be NULL for local)
                                                       srcfiles,     // file names on source
                                                       dstfiles,     // corresponding filenames on dest (must exist otherwise ignored)
-                                                      tree  // MORE - add a tree ptr here and process....
+                                                      tree,  // MORE - add a tree ptr here and process....
+                                                      user
                                                      );
 
                     if (tree)
@@ -1337,7 +1338,7 @@ public:
         lookupRelationships(relationshipTree, src_filename, NULL, remoteRoxieClusterName, lookupDaliIp);
         lookupRelationships(relationshipTree, NULL, src_filename, remoteRoxieClusterName, lookupDaliIp);
 
-        return addRoxieFileRelationshipsToDali(tree, lookupDaliIp, "Relationships/Relationship", false, msg);
+        return addRoxieFileRelationshipsToDali(tree, lookupDaliIp, "Relationships/Relationship", false, msg, userdesc);
     }
     
 
@@ -1705,7 +1706,7 @@ public:
 
         StringBuffer msg;
         StringBuffer rel_xpath("MetaFileInfo/Relationships/Relationship");
-        addRoxieFileRelationshipsToDali(remoteQuery, lookupDaliIp, rel_xpath, true, msg);
+        addRoxieFileRelationshipsToDali(remoteQuery, lookupDaliIp, rel_xpath, true, msg, userdesc);
 
         ForEachItemIn(idx, filesToDelete)
         {

+ 10 - 9
dali/base/dadfs.cpp

@@ -942,14 +942,14 @@ public:
         );
     void doRemoveFileRelationship( IRemoteConnection *conn, const char *primary,const char *secondary,const char *primflds,const char *secflds, const char *kind);
     void removeFileRelationships(const char *primary,const char *secondary, const char *primflds, const char *secflds, const char *kind);
-    void addFileRelationship(const char *kind,const char *primary,const char *secondary,const char *primflds, const char *secflds,const char *cardinality,bool payload,const char *description);
+    void addFileRelationship(const char *kind,const char *primary,const char *secondary,const char *primflds, const char *secflds,const char *cardinality,bool payload,IUserDescriptor *user,const char *description);
     IFileRelationshipIterator *lookupFileRelationships(const char *primary,const char *secondary,const char *primflds,const char *secflds,
                                                        const char *kind,const char *cardinality,const bool *payload,
                                                        const char *foreigndali,unsigned foreigndalitimeout);
     void removeAllFileRelationships(const char *filename);
     IFileRelationshipIterator *lookupAllFileRelationships(const char *filenames);
 
-    void renameFileRelationships(const char *oldname,const char *newname,IFileRelationshipIterator *reliter);
+    void renameFileRelationships(const char *oldname,const char *newname,IFileRelationshipIterator *reliter, IUserDescriptor *user);
 
     bool publishMetaFileXML(const CDfsLogicalFileName &logicalname,IUserDescriptor *user);
     IFileDescriptor *createDescriptorFromMetaFile(const CDfsLogicalFileName &logicalname,IUserDescriptor *user);
@@ -3166,7 +3166,7 @@ public:
         }
         if (reliter.get()) {
             // add back any relationships with new name
-            parent->renameFileRelationships(prevname.str(),_logicalname,reliter);
+            parent->renameFileRelationships(prevname.str(),_logicalname,reliter,user);
         }
     }
 
@@ -4595,7 +4595,7 @@ public:
         attach(_logicalname,user);
         if (reliter.get()) {
             // add back any relationships with new name
-            parent->renameFileRelationships(prevname.str(),_logicalname,reliter);
+            parent->renameFileRelationships(prevname.str(),_logicalname,reliter,user);
         }
     }
 
@@ -8056,7 +8056,7 @@ public:
             PROGLOG("TIMING(filescan): %s: took %dms",trc.str(), tookMs);
         sdsLock.unlock(); // unlock to perform authentification
 
-        bool auth = querySessionManager().checkScopeScansLDAP()&&getScopePermissions(NULL,NULL,(unsigned)-1);
+        bool auth = querySessionManager().checkScopeScansLDAP()&&getScopePermissions(NULL,udesc,(unsigned)-1);
         StringArray authScopes;
         CIArrayOf<CFileMatch> matchingFiles;
         start = msTick();
@@ -9854,6 +9854,7 @@ void CDistributedFileDirectory::addFileRelationship(
   const char *kind,
   const char *cardinality,
   bool payload,
+  IUserDescriptor *user,
   const char *description=NULL
   )
 {
@@ -9868,7 +9869,7 @@ void CDistributedFileDirectory::addFileRelationship(
     if (pfn.isExternal()||pfn.isForeign()||pfn.isQuery())
         throw MakeStringException(-1,"addFileRelationship primary %s not allowed",pfn.get());
     primary = pfn.get();
-    if (!exists(primary,UNKNOWN_USER))//MORE:Pass IUserDescriptor
+    if (!exists(primary,user))
         throw MakeStringException(-1,"addFileRelationship primary %s does not exist",primary);
     CDfsLogicalFileName sfn;
     if (!sfn.setValidate(secondary))  
@@ -9876,7 +9877,7 @@ void CDistributedFileDirectory::addFileRelationship(
     if (sfn.isExternal()||sfn.isForeign()||sfn.isQuery())
         throw MakeStringException(-1,"addFileRelationship secondary %s not allowed",sfn.get());
     secondary = sfn.get();
-    if (!exists(secondary,UNKNOWN_USER))//MORE:Pass IUserDescriptor
+    if (!exists(secondary,user))
         throw MakeStringException(-1,"addFileRelationship secondary %s does not exist",secondary);
     if (cardinality&&*cardinality&&!strchr(cardinality,':'))
         throw MakeStringException(-1,"addFileRelationship cardinality %s invalid",cardinality);
@@ -9977,7 +9978,7 @@ IFileRelationshipIterator *CDistributedFileDirectory::lookupAllFileRelationships
     return ret.getClear();
 }
 
-void CDistributedFileDirectory::renameFileRelationships(const char *oldname,const char *newname,IFileRelationshipIterator *reliter)
+void CDistributedFileDirectory::renameFileRelationships(const char *oldname,const char *newname,IFileRelationshipIterator *reliter,IUserDescriptor*user)
 {
     CDfsLogicalFileName oldlfn;
     normLFN(oldname,oldlfn,"renameFileRelationships(old name)");
@@ -10002,7 +10003,7 @@ void CDistributedFileDirectory::renameFileRelationships(const char *oldname,cons
                 sf = newlfn.get();
             }
             if (adj)
-                addFileRelationship(pf,sf,r.queryPrimaryFields(),r.querySecondaryFields(),r.queryKind(),r.queryCardinality(),r.isPayload(),r.queryDescription());
+                addFileRelationship(pf,sf,r.queryPrimaryFields(),r.querySecondaryFields(),r.queryKind(),r.queryCardinality(),r.isPayload(),user,r.queryDescription());
         }
         catch (IException *e)
         {

+ 1 - 0
dali/base/dadfs.hpp

@@ -507,6 +507,7 @@ interface IDistributedFileDirectory: extends IInterface
         const char *kind,
         const char *cardinality,
         bool payload,
+        IUserDescriptor *user,
         const char *description=NULL
     )=0;
 

+ 2 - 2
dali/base/dautils.cpp

@@ -2175,11 +2175,11 @@ IClusterFileScanIterator *getClusterFileScanIterator(
 
 typedef MapStringTo<bool> IsSuperFileMap;
 
-void getLogicalFileSuperSubList(MemoryBuffer &mb)
+void getLogicalFileSuperSubList(MemoryBuffer &mb, IUserDescriptor *user)
 {
     // for fileservices
     IsSuperFileMap supermap;
-    IDFAttributesIterator *iter = queryDistributedFileDirectory().getDFAttributesIterator("*",UNKNOWN_USER,true,true);//MORE:Pass IUserDescriptor
+    IDFAttributesIterator *iter = queryDistributedFileDirectory().getDFAttributesIterator("*",user,true,true);
     if (iter) {
         ForEach(*iter) {
             IPropertyTree &attr=iter->query();

+ 1 - 1
dali/base/dautils.hpp

@@ -354,7 +354,7 @@ public:
     }
 };
 
-extern da_decl void getLogicalFileSuperSubList(MemoryBuffer &mb);
+extern da_decl void getLogicalFileSuperSubList(MemoryBuffer &mb, IUserDescriptor *user);
 
 
 interface IDaliMutexNotifyWaiting

+ 30 - 50
dali/daliadmin/daliadmin.cpp

@@ -618,9 +618,9 @@ static void dfsgroup(const char *name)
 
 //=============================================================================
 
-static void dfsmap(const char *lname)
+static void dfsmap(const char *lname, IUserDescriptor *user)
 {
-    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(lname,UNKNOWN_USER);
+    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(lname,user);
     if (!file) {
         ERRLOG("File %s not found",lname);
         return;
@@ -651,9 +651,9 @@ static int dfsexists(const char *lname,IUserDescriptor *user)
 }
 //=============================================================================
 
-static void dfsparents(const char *lname)
+static void dfsparents(const char *lname, IUserDescriptor *user)
 {
-    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(lname,UNKNOWN_USER);
+    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(lname,user);
     if (file) {
         Owned<IDistributedSuperFileIterator> iter = file->getOwningSuperFiles();
         ForEach(*iter) 
@@ -663,10 +663,10 @@ static void dfsparents(const char *lname)
 
 //=============================================================================
 
-static void dfsunlink(const char *lname)
+static void dfsunlink(const char *lname, IUserDescriptor *user)
 {
     loop {
-        Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(lname,UNKNOWN_USER);
+        Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(lname,user);
         if (file) {
             Owned<IDistributedSuperFileIterator> iter = file->getOwningSuperFiles();
             if (!iter->first())
@@ -787,10 +787,10 @@ public:
 };
 
 
-static int dfsverify(const char *name,CDateTime *cutoff)
+static int dfsverify(const char *name,CDateTime *cutoff, IUserDescriptor *user)
 {
     static CIpTable dafilesrvips;
-    Owned<IDistributedFile> file=queryDistributedFileDirectory().lookup(name,UNKNOWN_USER);
+    Owned<IDistributedFile> file=queryDistributedFileDirectory().lookup(name,user);
     if (!file) {
         ERRLOG("VERIFY: cannot find %s",name);
         return 1;
@@ -905,39 +905,19 @@ static int dfsverify(const char *name,CDateTime *cutoff)
     return 3;
 }
 
-
-static void dfsVerifyFiles(const char *grp,unsigned days)
-{
-    CDateTime cutoff;
-    if (days) {
-        cutoff.setNow();
-        cutoff.adjustTime(-60*24*days);
-    }
-
-    IDFAttributesIterator *iter = queryDistributedFileDirectory().getDFAttributesIterator("*",UNKNOWN_USER,true,false);//MORE:Pass IUserDescriptor
-    ForEach(*iter) {
-        StringBuffer lpath;
-        IPropertyTree &attr=iter->query();
-        const char *name=attr.queryProp("@name");
-        const char *g=attr.queryProp("@group");
-        if ((strcmp("*",grp)==0)||(g&&(strcmp(g,grp)==0)))  // TBD - Handling for multiple clusters?
-            dfsverify(name,days?&cutoff:NULL);
-    }
-}
-
 //=============================================================================
 
-static void setprotect(const char *filename, const char *callerid)
+static void setprotect(const char *filename, const char *callerid, IUserDescriptor *user)
 {
-    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(filename,UNKNOWN_USER);
+    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(filename,user);
     file->setProtect(callerid,true);
 }
 
 //=============================================================================
 
-static void unprotect(const char *filename, const char *callerid)
+static void unprotect(const char *filename, const char *callerid, IUserDescriptor *user)
 {
-    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(filename,UNKNOWN_USER);
+    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(filename,user);
     file->setProtect((strcmp(callerid,"*")==0)?NULL:callerid,false);
 }
 //=============================================================================
@@ -1271,9 +1251,9 @@ static void checksubfile(const char *lfn)
 
 //=============================================================================
 
-static void listexpires(const char * lfnmask)
+static void listexpires(const char * lfnmask, IUserDescriptor *user)
 {
-    IDFAttributesIterator *iter = queryDistributedFileDirectory().getDFAttributesIterator(lfnmask,UNKNOWN_USER,true,false);//MORE:Pass IUserDescriptor
+    IDFAttributesIterator *iter = queryDistributedFileDirectory().getDFAttributesIterator(lfnmask,user,true,false);
     ForEach(*iter) {
         IPropertyTree &attr=iter->query();
         const char * expires = attr.queryProp("@expires");
@@ -1372,9 +1352,9 @@ static offset_t getCompressedSize(IDistributedFile *file)
     return ret;
 }
 
-static void dfscompratio (const char *lname)
+static void dfscompratio (const char *lname, IUserDescriptor *user)
 {
-    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(lname,UNKNOWN_USER);
+    Owned<IDistributedFile> file = queryDistributedFileDirectory().lookup(lname,user);
     StringBuffer out;
     out.appendf("File %s ",lname);
     if (file) {
@@ -1452,10 +1432,10 @@ static bool countScopeChildren(IPropertyTree *t,unsigned &files, unsigned &sfile
     return (other!=0)||(files!=0)||(sfiles!=0)||(scopes!=0)||(!onlyNamePtree(t));
 }
 
-static void dfsscopes(const char *name)
+static void dfsscopes(const char *name, IUserDescriptor *user)
 {
     bool wild = isWild(name);
-    Owned<IDFScopeIterator> iter = queryDistributedFileDirectory().getScopeIterator(UNKNOWN_USER,wild?NULL:name,true,true);//MORE:Pass IUserDescriptor
+    Owned<IDFScopeIterator> iter = queryDistributedFileDirectory().getScopeIterator(user,wild?NULL:name,true,true);
     StringBuffer ln;
     ForEach(*iter) {
         CDfsLogicalFileName dlfn;
@@ -1506,9 +1486,9 @@ static bool recursiveCheckEmptyScope(IPropertyTree &ct)
 }
 
 
-static void cleanscopes()
+static void cleanscopes(IUserDescriptor *user)
 {
-    Owned<IDFScopeIterator> iter = queryDistributedFileDirectory().getScopeIterator(UNKNOWN_USER, NULL,true,true);//MORE:Pass IUserDescriptor
+    Owned<IDFScopeIterator> iter = queryDistributedFileDirectory().getScopeIterator(user, NULL,true,true);
     CDfsLogicalFileName dlfn;
     StringBuffer s;
     StringArray toremove;
@@ -2237,7 +2217,7 @@ int main(int argc, char* argv[])
             }
             else if (stricmp(cmd,"dfsmap")==0) {
                 CHECKPARAMS(1,1);
-                dfsmap(params.item(1));
+                dfsmap(params.item(1), userDesc);
             }
             else if (stricmp(cmd,"dfsexist")==0) {
                 CHECKPARAMS(1,1);
@@ -2245,23 +2225,23 @@ int main(int argc, char* argv[])
             }
             else if (stricmp(cmd,"dfsparents")==0) {
                 CHECKPARAMS(1,1);
-                dfsparents(params.item(1));
+                dfsparents(params.item(1),userDesc);
             }
             else if (stricmp(cmd,"dfsunlink")==0) {
                 CHECKPARAMS(1,1);
-                dfsunlink(params.item(1));
+                dfsunlink(params.item(1),userDesc);
             }
             else if (stricmp(cmd,"dfsverify")==0) {
                 CHECKPARAMS(1,1);
-                ret = dfsverify(params.item(1),NULL);
+                ret = dfsverify(params.item(1),NULL,userDesc);
             }
             else if (stricmp(cmd,"setprotect")==0) {
                 CHECKPARAMS(2,2);
-                setprotect(params.item(1),params.item(2));
+                setprotect(params.item(1),params.item(2),userDesc);
             }
             else if (stricmp(cmd,"unprotect")==0) {
                 CHECKPARAMS(2,2);
-                unprotect(params.item(1),params.item(2));
+                unprotect(params.item(1),params.item(2),userDesc);
             }
             else if (stricmp(cmd,"listprotect")==0) {
                 CHECKPARAMS(0,2);
@@ -2279,7 +2259,7 @@ int main(int argc, char* argv[])
             }
             else if (stricmp(cmd,"listexpires")==0) {
                 CHECKPARAMS(0,1);
-                listexpires((np>1)?params.item(1):"*");
+                listexpires((np>1)?params.item(1):"*",userDesc);
             }
             else if (stricmp(cmd,"listrelationships")==0) {
                 CHECKPARAMS(2,2);
@@ -2293,15 +2273,15 @@ int main(int argc, char* argv[])
             }
             else if (stricmp(cmd,"dfscompratio")==0) {
                 CHECKPARAMS(1,1);
-                dfscompratio(params.item(1));
+                dfscompratio(params.item(1),userDesc);
             }
             else if (stricmp(cmd,"dfsscopes")==0) {
                 CHECKPARAMS(0,1);
-                dfsscopes((np>1)?params.item(1):"*");
+                dfsscopes((np>1)?params.item(1):"*",userDesc);
             }
             else if (stricmp(cmd,"cleanscopes")==0) {
                 CHECKPARAMS(0,0);
-                cleanscopes();
+                cleanscopes(userDesc);
             }
             else if (stricmp(cmd,"listworkunits")==0) {
                 CHECKPARAMS(0,3);

+ 13 - 4
dali/dfu/dfurun.cpp

@@ -531,7 +531,16 @@ public:
                 }
                 else 
                     monitor->setHandlerEp(me->endpoint());
-                if (performMonitor(wu,monitor,wu->querySource(),false,&eventstriggered,&eventsfile)) {
+
+                Owned<IUserDescriptor> userdesc = createUserDescriptor();
+                {
+                    StringBuffer username;
+                    StringBuffer password;
+                    wu->getUser(username);
+                    wu->getPassword(password);
+                    userdesc->set(username.str(),password.str());
+                }
+                if (performMonitor(wu,monitor,wu->querySource(),false,&eventstriggered,&eventsfile,userdesc)) {
                     wu->queryUpdateProgress()->setState(DFUstate_finished);
                 }
                 wu->commit();
@@ -560,7 +569,7 @@ public:
         }
     }
 
-    bool performMonitor(IDFUWorkUnit *wu,IDFUmonitor *monitor,IConstDFUfileSpec *source, bool raiseexception, StringAttrArray *eventstriggered, StringAttrArray *eventsfile)
+    bool performMonitor(IDFUWorkUnit *wu,IDFUmonitor *monitor,IConstDFUfileSpec *source, bool raiseexception, StringAttrArray *eventstriggered, StringAttrArray *eventsfile, IUserDescriptor *user)
     {
         
         
@@ -572,7 +581,7 @@ public:
         monitor->getTriggeredList(prev);
         monitor->setCycleCount(monitor->getCycleCount()+1);
         if (lfn.length()) {                                                 // no wild cards so only 0 or 1 prev
-            if (queryDistributedFileDirectory().exists(lfn.str(),UNKNOWN_USER)) {//MORE:Pass IUserDescriptor
+            if (queryDistributedFileDirectory().exists(lfn.str(),user)) {
                 done.append(*new StringAttrItem(lfn.str()));
                 bool isdone = ((prev.ordinality()!=0)&&
                                 (stricmp(prev.item(0).text.get(),lfn.str())==0));
@@ -1545,7 +1554,7 @@ public:
                     monitor->setHandlerEp(me->endpoint());
                     StringAttrArray eventstriggered;
                     StringAttrArray eventsfile;
-                    if (performMonitor(wu,monitor,source,true,&eventstriggered,&eventsfile)) 
+                    if (performMonitor(wu,monitor,source,true,&eventstriggered,&eventsfile,userdesc))
                         finalstate = DFUstate_finished;
                     else
                         finalstate = DFUstate_monitoring;

+ 4 - 3
dali/dfu/dfuutil.cpp

@@ -976,7 +976,8 @@ public:
         const char *foreigndali,     // where src relationships are retrieved from (can be NULL for local)
         StringArray &srcfns,             // file names on source
         StringArray &dstfns,             // corresponding filenames on dest (must exist)
-        IPropertyTree *relationships    // if not NULL, tree will have all relationships filled in
+        IPropertyTree *relationships,    // if not NULL, tree will have all relationships filled in
+        IUserDescriptor *user
     )
     {
         // not a quick routine! (n^2)
@@ -988,7 +989,7 @@ public:
         bool *ex = (bool *)ma.allocate(dstfns.ordinality()*sizeof(bool));
         unsigned i;
         for (i=0;i<n;i++)
-            ex[i] = queryDistributedFileDirectory().exists(dstfns.item(i),UNKNOWN_USER);//MORE:Pass IUserDescriptor
+            ex[i] = queryDistributedFileDirectory().exists(dstfns.item(i),user);
         for (i=0;i<n;i++) {
             if (!ex[i])
                 continue;
@@ -999,7 +1000,7 @@ public:
                 ForEach(*iter) {
                     try {
                         IFileRelationship &r = iter->query();
-                        queryDistributedFileDirectory().addFileRelationship(dstfns.item(i),dstfns.item(j),r.queryPrimaryFields(),r.querySecondaryFields(),r.queryKind(),r.queryCardinality(),r.isPayload(),r.queryDescription());
+                        queryDistributedFileDirectory().addFileRelationship(dstfns.item(i),dstfns.item(j),r.queryPrimaryFields(),r.querySecondaryFields(),r.queryKind(),r.queryCardinality(),r.isPayload(),user,r.queryDescription());
                         if (relationships)
                         {
                             IPropertyTree *tree = iter->query().queryTree(); // relies on this being modifiable

+ 2 - 1
dali/dfu/dfuutil.hpp

@@ -72,7 +72,8 @@ interface IDFUhelper: extends IInterface
         const char *foreigndali,        // where src relationships are retrieved from (can be NULL for local)
         StringArray &srcfns,            // file names on source
         StringArray &dstfns,            // corresponding filenames on dest (must exist otherwise ignored)
-        IPropertyTree *relationships    // if not NULL, tree will have all relationships filled in
+        IPropertyTree *relationships,   // if not NULL, tree will have all relationships filled in
+        IUserDescriptor *user
     ) = 0;
 
 };

+ 10 - 1
esp/services/ws_dfu/ws_dfuService.cpp

@@ -3101,7 +3101,16 @@ bool CWsDfuEx::onSuperfileAction(IEspContext &context, IEspSuperfileActionReques
         resp.setRetcode(0);
         if (superfile && *superfile && action && strieq(action, "remove"))
         {
-            Owned<IDistributedSuperFile> fp = queryDistributedFileDirectory().lookupSuperFile(superfile,UNKNOWN_USER);
+            Owned<IUserDescriptor> udesc;
+            udesc.setown(createUserDescriptor());
+            {
+                StringBuffer userID;
+                StringBuffer pw;
+                context.getUserID(userID);
+                context.getPassword(pw);
+                udesc->set(userID.str(), pw.str());
+            }
+            Owned<IDistributedSuperFile> fp = queryDistributedFileDirectory().lookupSuperFile(superfile,udesc);
             if (!fp)
                 resp.setRetcode(-1); //Superfile has been removed.
         }

+ 2 - 2
plugins/fileservices/fileservices.cpp

@@ -1767,7 +1767,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsfRemotePull(ICodeContext *ctx,
 FILESERVICES_API void FILESERVICES_CALL fsLogicalFileSuperSubList(ICodeContext *ctx, size32_t & __lenResult,void * & __result)
 {
     MemoryBuffer mb;
-    getLogicalFileSuperSubList(mb);
+    getLogicalFileSuperSubList(mb, ctx->queryUserDescriptor());
     __lenResult = mb.length();
     __result = mb.detach();
 }
@@ -1831,7 +1831,7 @@ FILESERVICES_API void FILESERVICES_CALL fsAddFileRelationship(ICodeContext * ctx
     constructLogicalName(ctx, primary, pfn);
     StringBuffer sfn;
     constructLogicalName(ctx, secondary, sfn);
-    queryDistributedFileDirectory().addFileRelationship(pfn.str(),sfn.str(),primflds,secflds,kind,cardinality,payload,description);
+    queryDistributedFileDirectory().addFileRelationship(pfn.str(),sfn.str(),primflds,secflds,kind,cardinality,payload,ctx->queryUserDescriptor(), description);
     StringBuffer s("AddFileRelationship('");
     s.append(pfn.str()).append("','").append(sfn.str()).append("','").append(primflds?primflds:"").append("','").append(secflds?secflds:"").append("','").append(kind?kind:"").append("') done");
     WUmessage(ctx,ExceptionSeverityInformation,NULL,s.str());