Fossil SCM
Clear the linkname field in the tar file header after adding a symlink. See [forum:24c2cf9eba|forumpost 24c2cf9eba].
Commit
5f2a69933a5ba5efdc0ad922e56aa4c7418fe65353b788d124faa53669da66a4
Parent
4e4ae18fc5d87f2…
1 file changed
+6
+6
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -443,10 +443,16 @@ | ||
| 443 | 443 | n = 0; |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | tar_add_header(zName, nName, ( mPerm==PERM_EXE ) ? 0755 : 0644, |
| 447 | 447 | mTime, n, cType); |
| 448 | + /* Clear the linkname field, lest it leak to subsequent non-symlink entries. | |
| 449 | + ** See https://fossil-scm.org/forum/forumpost/24c2cf9eba */ | |
| 450 | + if( cType=='2' ){ | |
| 451 | + memset(&tball.aHdr[157], 0, 100); | |
| 452 | + } | |
| 453 | + | |
| 448 | 454 | if( n ){ |
| 449 | 455 | gzip_step(blob_buffer(pContent), n); |
| 450 | 456 | lastPage = n % 512; |
| 451 | 457 | if( lastPage!=0 ){ |
| 452 | 458 | gzip_step(tball.zSpaces, 512 - lastPage); |
| 453 | 459 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -443,10 +443,16 @@ | |
| 443 | n = 0; |
| 444 | } |
| 445 | |
| 446 | tar_add_header(zName, nName, ( mPerm==PERM_EXE ) ? 0755 : 0644, |
| 447 | mTime, n, cType); |
| 448 | if( n ){ |
| 449 | gzip_step(blob_buffer(pContent), n); |
| 450 | lastPage = n % 512; |
| 451 | if( lastPage!=0 ){ |
| 452 | gzip_step(tball.zSpaces, 512 - lastPage); |
| 453 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -443,10 +443,16 @@ | |
| 443 | n = 0; |
| 444 | } |
| 445 | |
| 446 | tar_add_header(zName, nName, ( mPerm==PERM_EXE ) ? 0755 : 0644, |
| 447 | mTime, n, cType); |
| 448 | /* Clear the linkname field, lest it leak to subsequent non-symlink entries. |
| 449 | ** See https://fossil-scm.org/forum/forumpost/24c2cf9eba */ |
| 450 | if( cType=='2' ){ |
| 451 | memset(&tball.aHdr[157], 0, 100); |
| 452 | } |
| 453 | |
| 454 | if( n ){ |
| 455 | gzip_step(blob_buffer(pContent), n); |
| 456 | lastPage = n % 512; |
| 457 | if( lastPage!=0 ){ |
| 458 | gzip_step(tball.zSpaces, 512 - lastPage); |
| 459 |