]> Dogcows Code - chaz/tar/commitdiff
(write_long_name): Do not allow more than
authorSergey Poznyakoff <gray@gnu.org.ua>
Fri, 26 Mar 2004 19:39:40 +0000 (19:39 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Fri, 26 Mar 2004 19:39:40 +0000 (19:39 +0000)
NAME_FIELD_SIZE-1 characters in a file name for V7 format
archives.

src/create.c

index 4c954c46012c38d7f4953518caabdbfffb03f6e6..a46b1162cc571109bab0c051d1cb033e09b38f9e 100644 (file)
@@ -519,7 +519,16 @@ write_long_name (struct tar_stat_info *st)
       xheader_store ("path", st, NULL);
       break;
 
       xheader_store ("path", st, NULL);
       break;
 
-    case V7_FORMAT:                  
+    case V7_FORMAT:
+      if (strlen (st->file_name) > NAME_FIELD_SIZE-1)
+       {
+         WARN ((0, 0, _("%s: file name is too long (max %d); not dumped"),
+                quotearg_colon (st->file_name),
+                NAME_FIELD_SIZE - 1));
+         return NULL;
+       }
+      break;
+      
     case USTAR_FORMAT:
     case STAR_FORMAT:
       return write_ustar_long_name (st->file_name);
     case USTAR_FORMAT:
     case STAR_FORMAT:
       return write_ustar_long_name (st->file_name);
This page took 0.026505 seconds and 4 git commands to generate.