[med-svn] [Git][med-team/ncbi-vdb][upstream] New upstream version 2.9.2-1+dfsg

Andreas Tille gitlab at salsa.debian.org
Tue Aug 28 20:30:43 BST 2018


Andreas Tille pushed to branch upstream at Debian Med / ncbi-vdb


Commits:
bb5b4b8a by Andreas Tille at 2018-08-28T05:45:23Z
New upstream version 2.9.2-1+dfsg
- - - - -


11 changed files:

- CHANGES.md
- build/Makefile.vers
- libs/blast/blast-mgr.c
- libs/kdb/libkdb.vers.h
- libs/kfg/keystore.c
- libs/klib/release-vers.h
- libs/ncbi-vdb/libncbi-vdb.vers
- libs/vdb/cursor-cmn.c
- libs/vdb/libvdb.vers.h
- libs/vfs/manager.c
- test/vdb/test-vdb.cpp


Changes:

=====================================
CHANGES.md
=====================================
@@ -1,5 +1,16 @@
 # NCBI External Developer Release:
 
+
+## NCBI VDB 2.9.2-1
+**July 31, 2018**
+  **vdb**: restored lost exported attribute on several entries in the private API
+
+
+## NCBI VDB 2.9.2
+**July 23, 2018**
+  **kfg, vfs**: Introduced enhanced handling of download-only NGC files that lack read/decrypt permissions
+
+
 ## NCBI VDB 2.9.1-1
 **June 25, 2018**
 


=====================================
build/Makefile.vers
=====================================
@@ -23,4 +23,4 @@
 # ===========================================================================
 
 # NCBI-VDB and library version
-VERSION = 2.9.1
+VERSION = 2.9.2


=====================================
libs/blast/blast-mgr.c
=====================================
@@ -50,7 +50,7 @@
 #include <stdio.h> /* fprintf */
 #include <string.h> /* memset */
 
-#define TOOLKIT "sratoolkit2_9_1"
+#define TOOLKIT "sratoolkit2_9_2"
 
 /******************************************************************************/
 


=====================================
libs/kdb/libkdb.vers.h
=====================================
@@ -24,4 +24,4 @@
 *
 */
 
-#define LIBKDB_VERS 0x0207001A
+#define LIBKDB_VERS 0x0207001B


=====================================
libs/kfg/keystore.c
=====================================
@@ -174,6 +174,11 @@ rc_t ReadEncKey(const KFile* file, char* buf, size_t bufsize)
 
     if (rc == 0)
     {
+        char * pc;
+
+        /* ensure buffer is NUL terminated */
+        buf [ readNum ] = 0;
+        
         /* -----
          * trim back the contents of the file to
          * a single ASCII/UTF-8 text line
@@ -181,17 +186,20 @@ rc_t ReadEncKey(const KFile* file, char* buf, size_t bufsize)
          * end of line characters so it could have other
          * control characters...
          */
-        char* pc = string_chr (buf, readNum, '\r');
-        if (pc == NULL)
-            pc = string_chr (buf, readNum, '\n');
-
+        pc = memchr ( buf, '\r', readNum );
+        if ( pc == NULL )
+            pc = memchr ( buf, '\n', readNum );
         if (pc != NULL)
             *pc = 0;
-        else
-            buf[readNum]=0;
-            
-        if (string_measure(buf, NULL) == 0)
+
+        /* disallow a length of 0 */
+        if ( buf [ 0 ] == 0 )
             rc = RC (rcKFG, rcEncryptionKey, rcRetrieving, rcSize, rcTooShort);
+        else if ( memcmp ( buf, "n/a", 4 ) == 0 )
+        {
+            /* download-only NGC file */
+            rc = RC ( rcKFG, rcEncryptionKey, rcRetrieving, rcEncryptionKey, rcNoPerm );
+        }
     }
     return rc;
 }


=====================================
libs/klib/release-vers.h
=====================================
@@ -28,7 +28,7 @@
 
 
 /* Version of current SRA Toolkit Release */
-#define RELEASE_VERS 0x02090001
+#define RELEASE_VERS 0x02090002
 
 
 /* Type of Version of current SRA Toolkit Release is one of:


=====================================
libs/ncbi-vdb/libncbi-vdb.vers
=====================================
@@ -1 +1 @@
-2.9.1
+2.9.2


=====================================
libs/vdb/cursor-cmn.c
=====================================
@@ -167,7 +167,7 @@ bool VCursorIsReadOnly ( const struct VCursor * self )
 {
     DISPATCH_VALUE ( isReadOnly ( self ), true );
 }
-struct VSchema const * VCursorGetSchema ( struct VCursor const *self )
+LIB_EXPORT struct VSchema const * VCursorGetSchema(struct VCursor const *self)
 {
     DISPATCH_VALUE ( getSchema ( self ), NULL );
 }
@@ -183,27 +183,27 @@ const struct KSymbol * VCursorFindOverride ( const VCursor *self, const struct V
 {
     DISPATCH_VALUE ( findOverride ( self, cid ), NULL );
 }
-rc_t CC VCursorPermitPostOpenAdd ( struct VCursor const *self )
+LIB_EXPORT rc_t CC VCursorPermitPostOpenAdd(struct VCursor const *self)
 {
     DISPATCH ( permitPostOpenAdd ( self ) );
 }
-rc_t CC VCursorSuspendTriggers ( struct VCursor const *self )
+LIB_EXPORT rc_t CC VCursorSuspendTriggers(struct VCursor const *self)
 {
     DISPATCH ( suspendTriggers ( self ) );
 }
-rc_t CC VCursorLinkedCursorGet( const struct VCursor * self,const char * tbl, struct VCursor const ** curs)
+LIB_EXPORT rc_t CC VCursorLinkedCursorGet(const struct VCursor * self, const char * tbl, struct VCursor const ** curs)
 {
     DISPATCH ( linkedCursorGet ( self, tbl, curs ) );
 }
-rc_t CC VCursorLinkedCursorSet( const struct VCursor * self,const char * tbl, struct VCursor const * curs)
+LIB_EXPORT rc_t CC VCursorLinkedCursorSet(const struct VCursor * self, const char * tbl, struct VCursor const * curs)
 {
     DISPATCH ( linkedCursorSet ( self, tbl, curs ) );
 }
-uint64_t CC VCursorSetCacheCapacity ( struct VCursor * self,uint64_t capacity )
+LIB_EXPORT uint64_t CC VCursorSetCacheCapacity(struct VCursor * self, uint64_t capacity)
 {
     DISPATCH_VALUE ( setCacheCapacity ( self, capacity ), 0 );
 }
-uint64_t CC VCursorGetCacheCapacity ( const struct VCursor * self )
+LIB_EXPORT uint64_t CC VCursorGetCacheCapacity(const struct VCursor * self)
 {
     DISPATCH_VALUE ( getCacheCapacity ( self ), 0 );
 }


=====================================
libs/vdb/libvdb.vers.h
=====================================
@@ -24,4 +24,4 @@
 *
 */
 
-#define LIBVDB_VERS 0x0207001A
+#define LIBVDB_VERS 0x0207001B


=====================================
libs/vfs/manager.c
=====================================
@@ -640,7 +640,7 @@ rc_t GetEncryptionKey(const VFSManager * self, const VPath * vpath, char* obuff,
                 rc = rc2;
         }
     }
-    
+
     if (rc == 0)
     {
         KEncryptionKey* enc_key = NULL;
@@ -677,6 +677,14 @@ rc_t GetEncryptionKey(const VFSManager * self, const VPath * vpath, char* obuff,
         }
     }
     
+    if ( GetRCState ( rc ) == rcNoPerm && GetRCObject ( rc ) == ( enum RCObject ) rcEncryptionKey )
+    {
+        LOGMSG ( klogErr, "You do not have read permissions to decrypt data from this project." );
+        LOGMSG ( klogErr, "Please contact your PI to request an NGC token with decrypt permissions." );
+        LOGMSG ( klogErr, "Import the new NGC file before decrypting again." );
+        LOGMSG ( klogErr, "If you continue to have problems, contact sra at ncbi.nlm.nih.gov for assistance." );
+    }
+    
     rc2 = KKeyStoreSetTemporaryKeyFromFile(self->keystore, NULL); /* forget the temp key if set */
     if (rc == 0)
         rc = rc2;


=====================================
test/vdb/test-vdb.cpp
=====================================
@@ -211,7 +211,7 @@ public:
             throw logic_error ( "~VdbFixture: VCursorRelease failed" );
     }
 
-    rc_t Setup( const char * acc, const char* column[] )
+    rc_t Setup( const char * acc, const char* column[], bool open = true )
     {
         const VDatabase *db = NULL;
         rc_t rc = VDBManagerOpenDBRead ( mgr, &db, NULL, acc );
@@ -255,7 +255,7 @@ public:
                     assert(i < N);
                     rc = VCursorAddColumn ( curs, col_idx + i, column[i] );
                 }
-                if ( rc == 0 )
+                if ( rc == 0 && open )
                 {
                     rc = VCursorOpen(curs);
                 }
@@ -368,7 +368,6 @@ FIXTURE_TEST_CASE(VCursor_GetBlob_SRA, VdbFixture)
 {   // multiple fragments per row (some are technical), multiple rows per blob
     static char const *columns[] = { "READ", 0 };
     REQUIRE_RC ( Setup ( "SRR000123", columns ) );
-    REQUIRE_RC ( VCursorOpen (curs ) );
 
     {
         REQUIRE_RC ( VCursorSetRowId (curs, 1 ) );
@@ -439,7 +438,6 @@ FIXTURE_TEST_CASE(VCursor_GetBlob_WGS, VdbFixture)
 {   // single fragment per row, multiple rows per blob
     static char const *columns[] = { "READ", 0 };
     REQUIRE_RC ( Setup ( "ALWZ01", columns ) );
-    REQUIRE_RC ( VCursorOpen (curs ) );
 
     {
         REQUIRE_RC ( VCursorSetRowId (curs, 1 ) );
@@ -510,7 +508,6 @@ FIXTURE_TEST_CASE(VCursor_GetBlob_SequentialAccess, VdbFixture)
 {   // VDB-2858: sequential access to blobs broken
     static char const *columns[] = { "READ", 0 };
     REQUIRE_RC ( Setup ( "ALAI01", columns ) );
-    REQUIRE_RC ( VCursorOpen (curs ) );
 
     int64_t first;
     uint64_t count;
@@ -543,7 +540,6 @@ FIXTURE_TEST_CASE(VCursor_GetBlob_RandomAccess, VdbFixture)
 {
     static char const *columns[] = { "READ", 0 };
     REQUIRE_RC ( Setup ( "SRR000001", columns ) );
-    REQUIRE_RC ( VCursorOpen (curs ) );
 
     // when accessing randomly, blob sizes stay very small
     REQUIRE ( CheckBlobRange ( 1, 1, 4 ) );
@@ -561,7 +557,6 @@ FIXTURE_TEST_CASE(PageMapIterator_WGS, VdbFixture)
 {   // single fragment per row, multiple rows per blob
     static char const *columns[] = { "READ", 0 };
     REQUIRE_RC ( Setup ( "ALWZ01", columns ) );
-    REQUIRE_RC ( VCursorOpen (curs ) );
 
     {
         REQUIRE_RC ( VCursorSetRowId (curs, 1 ) );
@@ -602,7 +597,6 @@ FIXTURE_TEST_CASE ( VCursor_FindNextRowIdDirect, VdbFixture )
 {
     static char const *columns[] = { "SPOT_ID", "READ", 0 };
     REQUIRE_RC ( Setup ( "SRR000001", columns ) );
-    REQUIRE_RC ( VCursorOpen (curs ) );
     int64_t next;
     REQUIRE_RC ( VCursorFindNextRowIdDirect ( curs, 0, 1, & next ) );
     REQUIRE_EQ ( (int64_t)1, next ) ;
@@ -610,6 +604,13 @@ FIXTURE_TEST_CASE ( VCursor_FindNextRowIdDirect, VdbFixture )
     REQUIRE_EQ ( (int64_t)2, next ) ; // VDB-3075: next == 1
 }
 
+FIXTURE_TEST_CASE(VCursor_PermitPostOpenAdd, VdbFixture)
+{
+    static char const *columns[] = { "SPOT_ID", 0 };
+    REQUIRE_RC(Setup("SRR000001", columns, false));
+    REQUIRE_RC(VCursorPermitPostOpenAdd(curs));
+}
+
 //////////////////////////////////////////// Main
 extern "C"
 {



View it on GitLab: https://salsa.debian.org/med-team/ncbi-vdb/commit/bb5b4b8a306a37952be1b4c58c7686aa983a1c05

-- 
View it on GitLab: https://salsa.debian.org/med-team/ncbi-vdb/commit/bb5b4b8a306a37952be1b4c58c7686aa983a1c05
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180828/6c16c2f3/attachment-0001.html>


More information about the debian-med-commit mailing list