Blob Blame History Raw
diff --git a/src/dome/DomeCoreXeq.cpp b/src/dome/DomeCoreXeq.cpp
index f9cc9e86..b4e33a45 100644
--- a/src/dome/DomeCoreXeq.cpp
+++ b/src/dome/DomeCoreXeq.cpp
@@ -1964,6 +1964,7 @@ int DomeCore::dome_chksum(DomeReq &req) {
     std::string pfn = req.bodyfields.get<std::string>("pfn", "");
     std::string lfn = req.bodyfields.get<std::string>("lfn", "");
     bool forcerecalc = DomeUtils::str_to_bool(req.bodyfields.get<std::string>("force-recalc", "false"));
+    bool norecalc = DomeUtils::str_to_bool(req.bodyfields.get<std::string>("no-recalc", "false"));
     bool updateLfnChecksum = (pfn == "");
 
     if(chksumtype == "") {
@@ -1974,6 +1975,10 @@ int DomeCore::dome_chksum(DomeReq &req) {
       return req.DomeReq::SendSimpleResp(422, SSTR("unknown checksum type " << chksumtype));
     }
 
+    if (forcerecalc && norecalc) {
+      return req.DomeReq::SendSimpleResp(422, "incompatible checkum recaclulation options (can't enable force-recalc and no-recalc at same time).");
+    }
+
     if(forcerecalc) {
       Replica replica = pickReplica(lfn, pfn, sql);
       return calculateChecksum(req, lfn, replica, chksumtype, updateLfnChecksum, true);
@@ -2034,6 +2039,12 @@ int DomeCore::dome_chksum(DomeReq &req) {
       return req.DomeReq::SendSimpleResp(200, jresp);
     }
 
+    if (norecalc) {
+      boost::property_tree::ptree jresp;
+      jresp.put("status", "notfound");
+      return req.DomeReq::SendSimpleResp(200, jresp);
+    }
+
     // something is missing, need to calculate
     if(pfn == "") {
       replica = pickReplica(lfn, pfn, sql);
diff --git a/src/plugins/apache-httpd/src/mod_lcgdm_ns/mymacaroons.c b/src/plugins/apache-httpd/src/mod_lcgdm_ns/mymacaroons.c
index 9427c2b7..92087c2b 100644
--- a/src/plugins/apache-httpd/src/mod_lcgdm_ns/mymacaroons.c
+++ b/src/plugins/apache-httpd/src/mod_lcgdm_ns/mymacaroons.c
@@ -594,7 +594,7 @@ static int verify_caveat(void *data, const unsigned char *pred, size_t pred_sz)
                 }
                 break;
             case M_MOVE:
-                allowed = activities & (ACTIVITY_DOWNLOAD | ACTIVITY_UPLOAD) == ACTIVITY_DOWNLOAD | ACTIVITY_UPLOAD;
+                allowed = (activities & (ACTIVITY_DOWNLOAD | ACTIVITY_UPLOAD)) == (ACTIVITY_DOWNLOAD | ACTIVITY_UPLOAD);
                 break;
             case M_PROPFIND:
                 allowed = activities & ACTIVITY_LIST;
diff --git a/src/plugins/domeadapter/DomeAdapterDiskCatalog.cpp b/src/plugins/domeadapter/DomeAdapterDiskCatalog.cpp
index 5dad85d2..1340f2b5 100644
--- a/src/plugins/domeadapter/DomeAdapterDiskCatalog.cpp
+++ b/src/plugins/domeadapter/DomeAdapterDiskCatalog.cpp
@@ -59,6 +59,7 @@ void DomeAdapterDiskCatalog::getChecksum(const std::string& path,
     params.put("checksum-type", csumtype);
     params.put("lfn", path);
     params.put("force-recalc", DomeUtils::bool_to_str(recalc));
+    if (waitsecs < 0) params.put("no-recalc", "true");
     recalc = false; // no force-recalc in subsequent requests
 
     if(!talker.execute(params)) {
@@ -78,6 +79,8 @@ void DomeAdapterDiskCatalog::getChecksum(const std::string& path,
     }
 
     try {
+      if (waitsecs < 0 && talker.jresp().get<std::string>("status") == "notfound")
+        return;
       csumvalue = talker.jresp().get<std::string>("checksum");
       return;
     }
diff --git a/src/plugins/domeadapter/DomeAdapterHeadCatalog.cpp b/src/plugins/domeadapter/DomeAdapterHeadCatalog.cpp
index ce2947b5..a7fff8b0 100644
--- a/src/plugins/domeadapter/DomeAdapterHeadCatalog.cpp
+++ b/src/plugins/domeadapter/DomeAdapterHeadCatalog.cpp
@@ -112,6 +112,7 @@ void DomeAdapterHeadCatalog::getChecksum(const std::string& path,
     params.put("checksum-type", csumtype);
     params.put("lfn", absPath(path));
     params.put("force-recalc", DomeUtils::bool_to_str(recalc));
+    if (waitsecs < 0) params.put("no-recalc", "true");
     recalc = false; // no force-recalc in subsequent requests
 
     if(!talker__->execute(params)) {
@@ -135,6 +136,8 @@ void DomeAdapterHeadCatalog::getChecksum(const std::string& path,
     }
 
     try {
+      if (waitsecs < 0 && talker__->jresp().get<std::string>("status") == "notfound")
+        return;
       csumvalue = talker__->jresp().get<std::string>("checksum");
       return;
     }