Debian Bug report logs - #22854
file: "\n"-style escapes don't work

version graph

Package: file; Maintainer for file is Christoph Biedl <debian.axhn@manchmal.in-ulm.de>; Source for file is src:file (PTS, buildd, popcon).

Reported by: Charles Briscoe-Smith <cpbs@debian.org>

Date: Mon, 25 May 1998 19:48:10 UTC

Severity: normal

Found in version 3.24-4

Done: unknown

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Nicol�s Lichtmaier <nick@feedback.net.ar>:
Bug#22854; Package file. (full text, mbox, link).


Acknowledgement sent to Charles Briscoe-Smith <cpbs@debian.org>:
New bug report received and forwarded. Copy sent to Nicol�s Lichtmaier <nick@feedback.net.ar>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Charles Briscoe-Smith <cpbs@debian.org>
To: submit@bugs.debian.org
Cc: Charles Briscoe-Smith <cpbs@debian.org>
Subject: file: "\n"-style escapes don't work
Date: Mon, 25 May 1998 20:34:32 +0100
Package: file
Version: 3.24-4
Severity: important

file doesn't recognize Debian binary packages; it labels them "current ar
archive".  This seems to be because it doesn't recognise backslash-escapes
in string tests.

$ cat /etc/magic
0	string		!<arch>		ar archive
>8	string		debian-binary	Debian package
$ file dists/slink/main/binary-i386/devel/lintian_0.4.4.deb
dists/slink/main/binary-i386/devel/lintian_0.4.4.deb: ar archive Debian package

$ cat /etc/magic
0	string		!<arch>\ndebian-binary		Debian package
$ file dists/slink/main/binary-i386/devel/lintian_0.4.4.deb
dists/slink/main/binary-i386/devel/lintian_0.4.4.deb: current ar archive

I.e., when I use the \n escape, my definition doesn't match.

I'm making this "important" because I don't think it would look good
if we shipped a distribution whose 'file' command didn't recognise its
own packages...

-- 
Charles Briscoe-Smith
White pages entry, with PGP key: <URL:http://alethea.ukc.ac.uk/wp?95cpb4>
PGP public keyprint: 74 68 AB 2E 1C 60 22 94  B8 21 2D 01 DE 66 13 E2


Severity set to `normal'. Request was from Brian White <bcwhite@verisim.com> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Nicol�s Lichtmaier <nick@feedback.net.ar>:
Bug#22854; Package file. (full text, mbox, link).


Acknowledgement sent to Paul Slootman <paul@wau.mis.ah.nl>:
Extra info received and forwarded to list. Copy sent to Nicol�s Lichtmaier <nick@feedback.net.ar>. (full text, mbox, link).


Message #12 received at 22854@bugs.debian.org (full text, mbox, reply):

From: Paul Slootman <paul@wau.mis.ah.nl>
To: 22854@bugs.debian.org
Cc: Charles Briscoe-Smith <cpbs@debian.org>
Subject: Re: file: "\n"-style escapes don't work
Date: Fri, 12 Jun 1998 11:38:33 +0200
> I.e., when I use the \n escape, my definition doesn't match.

There is a bug in the sources which simply causes the first \n in the
string "to match" text to get eaten.  The patch below fixes it. If
there is no official upload within about a week, I'll do a non-maintainer
upload (we need these important bugs squashed!)

I've changed the code with ifdef, so that it's clear what's changed.

Paul Slootman
home: paul@wurtel.demon.nl | work: paul@murphy.nl
http://www.wurtel.demon.nl | Murphy Software, Enschede, the Netherlands


diff -ru file-3.24/softmagic.c file-3.24.nmu/softmagic.c
--- file-3.24/softmagic.c	Fri Jun 12 11:34:32 1998
+++ file-3.24.nmu/softmagic.c	Fri Jun 12 11:34:08 1998
@@ -232,7 +232,11 @@
 			t = m->offset + strlen(m->value.s);
 		}
 		else {
+#ifdef DEBUG_BUG_22854
 			if (*m->value.s == '\0') {
+#else
+			if (*m->value.s == '\n') {
+#endif
 				char *cp = strchr(p->s,'\n');
 				if (cp)
 					*cp = '\0';
@@ -280,8 +284,10 @@
 
 			/* Null terminate and eat the return */
 			p->s[sizeof(p->s) - 1] = '\0';
+#if DEBIAN_BUG_22854
 			if ((ptr = strchr(p->s, '\n')) != NULL)
 				*ptr = '\0';
+#endif
 			return 1;
 		}
 	case BESHORT:


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat May 11 02:36:10 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.