From nobody@FreeBSD.org  Sun Oct 24 07:59:36 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 62AE61065674
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 24 Oct 2010 07:59:36 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 36C718FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 24 Oct 2010 07:59:36 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o9O7xZ8I046945
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 24 Oct 2010 07:59:35 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o9O7xZqI046944;
	Sun, 24 Oct 2010 07:59:35 GMT
	(envelope-from nobody)
Message-Id: <201010240759.o9O7xZqI046944@www.freebsd.org>
Date: Sun, 24 Oct 2010 07:59:35 GMT
From: Nicole Reid <root@cooltrainer.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [audio/cuetools] Fix filename handling for extras/cuetag.sh
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         151677
>Category:       ports
>Synopsis:       audio/cuetools: Fix filename handling for extras/cuetag.sh
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    stas
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 24 08:00:16 UTC 2010
>Closed-Date:    Mon Oct 25 01:55:32 UTC 2010
>Last-Modified:  Mon Oct 25 02:00:23 UTC 2010
>Originator:     Nicole Reid
>Release:        
>Organization:
>Environment:
>Description:
The extras/cuetag.sh script in this port doesn't escape filenames properly.

There's an open bug for this on the project tracker (http://developer.berlios.de/bugs/?func=detailbug&bug_id=10401&group_id=2130) untouched for nearly four years, so a patch here in Ports is probably the only way we'll see a fix, as evidenced by the existing patch chasing a FLAC command syntax change.

Also touch up a typo while we're here :)
>How-To-Repeat:
Try to run /usr/local/share/examples/cuetools/cuetag.sh on any cue sheet with a spaced file name.
>Fix:
--- cuetools.orig/files/patch-extras_cuetag.sh	2010-10-24 03:16:03.895004790 -0400
+++ cuetools/files/patch-extras_cuetag.sh	2010-10-24 03:20:58.637410871 -0400
@@ -1,5 +1,5 @@
---- extras/cuetag.sh.orig	2008-11-28 00:41:26.000000000 +0300
-+++ extras/cuetag.sh	2008-11-28 00:41:32.000000000 +0300
+--- extras/cuetag.sh.orig	2006-02-14 19:10:02.000000000 -0500
++++ extras/cuetag.sh	2010-10-24 03:20:01.349578391 -0400
 @@ -18,7 +18,7 @@
  {
  	# FLAC tagging
@@ -9,3 +9,47 @@
  
  	# Ogg Vorbis tagging
  	# -w overwrites existing comments
+@@ -63,7 +63,7 @@
+ 	(for field in $fields; do
+ 		value=""
+ 		for conv in `eval echo \\$$field`; do
+-			value=`$CUEPRINT -n $1 -t "$conv\n" $cue_file`
++			value=`$CUEPRINT -n $1 -t "$conv\n" "$cue_file"`
+ 
+ 			if [ -n "$value" ]; then
+ 				echo "$field=$value"
+@@ -96,7 +96,7 @@
+ 	for field in $fields; do
+ 		value=""
+ 		for conv in `eval echo \\$$field`; do
+-			value=`$CUEPRINT -n $1 -t "$conv\n" $cue_file`
++			value=`$CUEPRINT -n $1 -t "$conv\n" "$cue_file"`
+ 
+ 			if [ -n "$value" ]; then
+ 				break
+@@ -141,14 +141,14 @@
+ 	cue_file=$1
+ 	shift
+ 
+-	ntrack=`cueprint -d '%N' $cue_file`
++	ntrack=`cueprint -d '%N' "$cue_file"`
+ 	trackno=1
+ 
+ 	if [ $# -ne $ntrack ]; then
+ 		echo "warning: number of files does not match number of tracks"
+ 	fi
+ 
+-	for file in $@; do
++	for file in "$@"; do
+ 		case $file in
+ 		*.[Ff][Ll][Aa][Cc])
+ 			vorbis $trackno "$file"
+@@ -160,7 +160,7 @@
+ 			id3 $trackno "$file"
+ 			;;
+ 		*)
+-			echo "$file: uknown file type"
++			echo "$file: unknown file type"
+ 			;;
+ 		esac
+ 		trackno=$(($trackno + 1))


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->stas 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Oct 24 08:00:25 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151677 

From: Stanislav Sedov <stas@FreeBSD.org>
To: Nicole Reid <root@cooltrainer.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/151677: [audio/cuetools] Fix filename handling for
 extras/cuetag.sh
Date: Sun, 24 Oct 2010 15:01:34 -0700

 Hi, Nicole!
 
 Can you, please, resend me this patch again, because
 the bugtracking system has mangled it, so it doesn't
 apply?
 
 Thanks a lot!
 
 -- 
 Stanislav Sedov
 ST4096-RIPE

From: Nicole Reid <root@cooltrainer.org>
To: Stanislav Sedov <stas@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/151677: [audio/cuetools] Fix filename handling for extras/cuetag.sh
Date: Sun, 24 Oct 2010 18:18:19 -0400

 This is a multi-part message in MIME format.
 --------------070100080502050807030301
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 On 10/24/2010 18:01, Stanislav Sedov wrote:
 > Hi, Nicole!
 > 
 > Can you, please, resend me this patch again, because
 > the bugtracking system has mangled it, so it doesn't
 > apply?
 > 
 > Thanks a lot!
 > 
 
 Whoops, sorry about that! Here it is again (attached), and I
 double-checked that it applies:
 
 [root@Emi#audio]patch < cuetools.diff
 Hmm...  Looks like a unified diff to me...
 The text leading up to this was:
 - --------------------------
 |diff -ruN cuetools.orig/files/patch-extras_cuetag.sh
 cuetools/files/patch-extras_cuetag.sh
 |--- cuetools.orig/files/patch-extras_cuetag.sh	2010-10-24
 03:16:03.895004790 -0400
 |+++ cuetools/files/patch-extras_cuetag.sh	2010-10-24 03:20:58.637410871
 - -0400
 - --------------------------
 Patching file cuetools/files/patch-extras_cuetag.sh using Plan A...
 Hunk #1 succeeded at 1.
 Hunk #2 succeeded at 9.
 done
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.16 (FreeBSD)
 
 iQIcBAEBAgAGBQJMxLCrAAoJEFN9BImDbF1yYXIQAKNjrHk4xoUxzeSDbqFbDgZQ
 +xaXFLCzOETDjKak01asmxwjfteAoq2srBzB6tDMUoN0M/NclMIlUK910iP1Twtk
 BFSSOnWXqQVEZ0R+4ixZF6GCMmfZtCIzDgzKlr2nq4emcHBCDKVjgWtMvTZwRAS6
 MM4reqj2tC9efbWm14zmsrpVjs5ZCeXdMq+dn+4vtnvQeZ0zsN24DCL/cgOpRL4m
 O3kl9G2kfRVTBL/L0vdYEk7Pki5pt84vrDVIS0zoyU7wx1KmCtRyNZeRCeGLEPYF
 fO1Vd6ZxrzFOFGXGDqRKiA8umvQvmY3j+hiOZm889aWf284SWQcfsJuiz4qaVmWe
 p5cAaMcylEJKVteGTZtJgVUBBpHwei3UWZzBV9j9vw+xP1VPB7lnfNmmHB2wx/eJ
 9WA6ZRtWaflFcZJrDTVQPssjs7nsN5KwFrKKa3ow25Z/Pl38TTFZx8AShh2th2y5
 iz2w5N63aGjl0xMaG/qfWjiKR4iEbUCZtYx8lOJYeb7lMz3A+bV9ZSarbwxHUv7/
 6dI4bpw1/gZtnzcUtxgQErt5VXRjDrGzOb7omp5A1ahq5by5rXSfWYLIyZAubLyE
 n8VG8h5CQNCOviXtZ/3ZKBPd0vjtSqOu4ch/qyvzO4IXe+3/yBT994C1P8mH9eDs
 xJmYd26/7uqprGli1SwX
 =uJOb
 -----END PGP SIGNATURE-----
 
 --------------070100080502050807030301
 Content-Type: text/plain;
  name="cuetools.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="cuetools.diff"
 
 diff -ruN cuetools.orig/files/patch-extras_cuetag.sh cuetools/files/patch-extras_cuetag.sh
 --- cuetools.orig/files/patch-extras_cuetag.sh	2010-10-24 03:16:03.895004790 -0400
 +++ cuetools/files/patch-extras_cuetag.sh	2010-10-24 03:20:58.637410871 -0400
 @@ -1,5 +1,5 @@
 ---- extras/cuetag.sh.orig	2008-11-28 00:41:26.000000000 +0300
 -+++ extras/cuetag.sh	2008-11-28 00:41:32.000000000 +0300
 +--- extras/cuetag.sh.orig	2006-02-14 19:10:02.000000000 -0500
 ++++ extras/cuetag.sh	2010-10-24 03:20:01.349578391 -0400
  @@ -18,7 +18,7 @@
   {
   	# FLAC tagging
 @@ -9,3 +9,47 @@
   
   	# Ogg Vorbis tagging
   	# -w overwrites existing comments
 +@@ -63,7 +63,7 @@
 + 	(for field in $fields; do
 + 		value=""
 + 		for conv in `eval echo \\$$field`; do
 +-			value=`$CUEPRINT -n $1 -t "$conv\n" $cue_file`
 ++			value=`$CUEPRINT -n $1 -t "$conv\n" "$cue_file"`
 + 
 + 			if [ -n "$value" ]; then
 + 				echo "$field=$value"
 +@@ -96,7 +96,7 @@
 + 	for field in $fields; do
 + 		value=""
 + 		for conv in `eval echo \\$$field`; do
 +-			value=`$CUEPRINT -n $1 -t "$conv\n" $cue_file`
 ++			value=`$CUEPRINT -n $1 -t "$conv\n" "$cue_file"`
 + 
 + 			if [ -n "$value" ]; then
 + 				break
 +@@ -141,14 +141,14 @@
 + 	cue_file=$1
 + 	shift
 + 
 +-	ntrack=`cueprint -d '%N' $cue_file`
 ++	ntrack=`cueprint -d '%N' "$cue_file"`
 + 	trackno=1
 + 
 + 	if [ $# -ne $ntrack ]; then
 + 		echo "warning: number of files does not match number of tracks"
 + 	fi
 + 
 +-	for file in $@; do
 ++	for file in "$@"; do
 + 		case $file in
 + 		*.[Ff][Ll][Aa][Cc])
 + 			vorbis $trackno "$file"
 +@@ -160,7 +160,7 @@
 + 			id3 $trackno "$file"
 + 			;;
 + 		*)
 +-			echo "$file: uknown file type"
 ++			echo "$file: unknown file type"
 + 			;;
 + 		esac
 + 		trackno=$(($trackno + 1))
 
 --------------070100080502050807030301--
State-Changed-From-To: open->closed 
State-Changed-By: stas 
State-Changed-When: Mon Oct 25 01:55:31 UTC 2010 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151677 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/151677: commit references a PR
Date: Mon, 25 Oct 2010 01:55:25 +0000 (UTC)

 stas        2010-10-25 01:55:19 UTC
 
   FreeBSD ports repository
 
   Modified files:
     audio/cuetools       Makefile 
     audio/cuetools/files patch-extras_cuetag.sh 
   Log:
   - Properly escape filenames in cuetag.sh
   
   PR:             ports/151677
   Submitted by:   Nicole Reid <root@cooltrainer.org>
   
   Revision  Changes    Path
   1.16      +1 -1      ports/audio/cuetools/Makefile
   1.2       +46 -2     ports/audio/cuetools/files/patch-extras_cuetag.sh
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
