Quellcode durchsuchen

Cherry-pick "Revert previous and always set offset"

This addresses a regression when detecting via libmagic, most notably
for PDF files.
Christoph Biedl vor 1 Tag
Ursprung
Commit
79e7e07ecc

+ 17 - 0
debian/patches/1776032114.FILE5_47-18-gc5460571.pr-725-inliniac-revert-previous-and-always-set-offset.patch

@@ -0,0 +1,17 @@
+Subject: PR/725: inliniac: Revert previous and always set offset.
+Origin: upstream, commit FILE5_47-18-gc5460571 <https://github.com/file/file/commit/FILE5_47-18-gc5460571>
+Author: Christos Zoulas <christos@zoulas.com>
+Date: Sun Apr 12 22:15:14 2026 +0000
+
+--- a/src/softmagic.c
++++ b/src/softmagic.c
+@@ -1580,8 +1580,7 @@
+ 			ms->offset = offset;
+ 			ms->eoffset = 0;
+ 		} else {
+-			if (b->fd != -1)
+-				ms->offset = ms->eoffset + offset;
++			ms->offset = ms->eoffset + offset;
+ 		}
+ 	}
+ 	if ((ms->flags & MAGIC_DEBUG) != 0) {

+ 2 - 2
debian/patches/1776628609.FILE5_47-57-g797a2755.add-le-be-guid.patch

@@ -417,7 +417,7 @@ Date: Sun Apr 19 19:56:49 2026 +0000
  		return 1;
  	default:
  		file_magerror(ms, "invalid type %d in mconvert()", m->type);
-@@ -1892,6 +1902,8 @@
+@@ -1891,6 +1901,8 @@
  			return 0;
  		break;
  
@@ -426,7 +426,7 @@ Date: Sun Apr 19 19:56:49 2026 +0000
  	case FILE_GUID:
  		if (OFFSET_OOB(nbytes, offset, 16))
  			return 0;
-@@ -2405,6 +2417,8 @@
+@@ -2404,6 +2416,8 @@
  			return 0;
  		}
  		return matched;

+ 1 - 0
debian/patches/series

@@ -1,6 +1,7 @@
 # reverted upstream commits
 
 # cherry-picked commits. Keep in upstream's chronological order
+1776032114.FILE5_47-18-gc5460571.pr-725-inliniac-revert-previous-and-always-set-offset.patch
 1776628609.FILE5_47-57-g797a2755.add-le-be-guid.patch
 1776629960.FILE5_47-62-g2866af2e.fix-typo.patch
 1779037825.FILE5_47-93-g7a2b2a4b.handle-parsing-guids-in-big-endian-machines.patch