Package: libmagic-mgc
Version: 1:5.39-3
Severity: normal
Tags: upstream fixed-upstream patch

The messages for Git objects have an incorrect id: only the first
sequence of decimal digits is retrieved instead of the full sequence
of hexadecimal digits. This is due to a bad regexp in
"magic/Magdir/git".

$ echo "commit d617e0c0ca8fac42361b00c8861eb2a59ab7a7d8" | file -
/dev/stdin: Git commit 617

This was fixed upstream several months ago:

  https://bugs.astron.com/view.php?id=176

I've attached my patch.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.9.0-2-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Description: Fix messages for Git objects.
Bug: https://bugs.astron.com/view.php?id=176
Author: Vincent Lefevre <vinc...@vinc17.net>
Last-Update: 2020-08-05

--- file-5.38-a/magic/Magdir/git        2019-10-04 18:46:29.000000000 +0000
+++ file-5.38-b/magic/Magdir/git        2020-08-05 11:56:09.704167516 +0000
@@ -4,10 +4,10 @@
 # git:  file(1) magic for Git objects
 
 0      string  blob\040
->5     regex   [0-9]+          Git blob %s
+>5     regex   [0-9a-f]+               Git blob %s
 
 0      string  tree\040
->5     regex   [0-9]+          Git tree %s
+>5     regex   [0-9a-f]+               Git tree %s
 
 0      string  commit\040
->7     regex   [0-9]+          Git commit %s
+>7     regex   [0-9a-f]+               Git commit %s

Reply via email to