Merge branch 'main' into 18842-arv-mount-disk-config
[arvados.git] / sdk / ruby / lib / arvados / keep.rb
index 782b274b0a81e41e0305964d153c65d6a95ba1ad..e391b7a6ca027aacad81a38d85ef7ddd05133c43 100644 (file)
@@ -101,11 +101,11 @@ module Keep
   end
 
   class Manifest
-    STREAM_TOKEN_REGEXP = /^[^\000-\040]+$/
+    STREAM_TOKEN_REGEXP = /^([^\000-\040\\]|\\[0-3][0-7][0-7])+$/
     STREAM_NAME_REGEXP = /^(\.)(\/[^\/]+)*$/
 
     EMPTY_DIR_TOKEN_REGEXP = /^0:0:\.$/ # The exception when a file can have '.' as a name
-    FILE_TOKEN_REGEXP = /^[[:digit:]]+:[[:digit:]]+:[^\000-\040]+$/
+    FILE_TOKEN_REGEXP = /^[[:digit:]]+:[[:digit:]]+:([^\000-\040\\]|\\[0-3][0-7][0-7])+$/
     FILE_NAME_REGEXP = /^[[:digit:]]+:[[:digit:]]+:([^\/]+(\/[^\/]+)*)$/
 
     NON_8BIT_ENCODED_CHAR = /[^\\]\\[4-7][0-7][0-7]/
@@ -248,7 +248,7 @@ module Keep
     end
 
     # Verify that a given manifest is valid according to
-    # https://arvados.org/projects/arvados/wiki/Keep_manifest_format
+    # https://dev.arvados.org/projects/arvados/wiki/Keep_manifest_format
     def self.validate! manifest
       raise ArgumentError.new "No manifest found" if !manifest