Fossil SCM

Clear the linkname field in the tar file header after adding a symlink. See [forum:24c2cf9eba|forumpost 24c2cf9eba].

danield 2026-11-03 15:19 UTC trunk
Commit 5f2a69933a5ba5efdc0ad922e56aa4c7418fe65353b788d124faa53669da66a4
1 file changed +6
+6
--- src/tar.c
+++ src/tar.c
@@ -443,10 +443,16 @@
443443
n = 0;
444444
}
445445
446446
tar_add_header(zName, nName, ( mPerm==PERM_EXE ) ? 0755 : 0644,
447447
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
+
448454
if( n ){
449455
gzip_step(blob_buffer(pContent), n);
450456
lastPage = n % 512;
451457
if( lastPage!=0 ){
452458
gzip_step(tball.zSpaces, 512 - lastPage);
453459
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button