Subject: pkg/20496: libdvdcss: fix for broken key caching
To: None <gnats-bugs@gnats.netbsd.org>
From: Christopher Richards <richards+netbsd@CS.Princeton.EDU>
List: netbsd-bugs
Date: 02/26/2003 03:38:25
>Number:         20496
>Category:       pkg
>Synopsis:       libdvdcss: fix for broken key caching
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 26 00:39:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Christopher Richards
>Release:        NetBSD 1.6.1_RC2
>Organization:
 
>Environment:
	
	
System: NetBSD zembla.Princeton.EDU 1.6.1_RC2 NetBSD 1.6.1_RC2 (ZEMBLA) #2: Wed Feb 19 14:44:25 EST 2003 richards@zembla.Princeton.EDU:/usr/src/sys/arch/i386/compile/ZEMBLA i386
Architecture: i386
Machine: i386
>Description:
	
	libdvdcss calls mkdir(2) with a trailing "/" to create the
	per-disk CSS cache subdirectory.  This fails on NetBSD.

>How-To-Repeat:
	
	Run ogle with libdvdcss-1.2.5; run again on the same disc; notice
	that the CSS keys are recomputed each time.

>Fix:
	
	Patch follows.

--- /dev/null	Wed Feb 12 22:56:01 2003
+++ misc/libdvdcss/patches/patch-aa	Wed Feb 26 03:22:24 2003
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/libdvdcss.c.orig	Sat Feb  1 16:24:49 2003
++++ src/libdvdcss.c
+@@ -398,7 +398,7 @@ extern dvdcss_t dvdcss_open ( char *psz_
+             goto nocache;
+         }
+ 
+-        i += sprintf( dvdcss->psz_cachefile + i, "/%s/", psz_data );
++        i += sprintf( dvdcss->psz_cachefile + i, "/%s", psz_data );
+ #if !defined( WIN32 ) || defined( SYS_CYGWIN )
+         i_ret = mkdir( dvdcss->psz_cachefile, 0755 );
+ #else
+@@ -410,6 +410,7 @@ extern dvdcss_t dvdcss_open ( char *psz_
+             dvdcss->psz_cachefile[0] = '\0';
+             goto nocache;
+         }
++        i += sprintf( dvdcss->psz_cachefile + i, "/");
+ 
+         /* Pointer to the filename we will use. */
+         dvdcss->psz_block = dvdcss->psz_cachefile + i;
Index: misc/libdvdcss/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/misc/libdvdcss/distinfo,v
retrieving revision 1.3
diff -u -b -r1.3 distinfo
--- misc/libdvdcss/distinfo	2003/02/23 18:34:09	1.3
+++ misc/libdvdcss/distinfo	2003/02/26 08:34:57
@@ -2,3 +2,4 @@
 
 SHA1 (libdvdcss-1.2.5.tar.bz2) = b459b722e4f6dadd6366d8a6413c582bd92f393e
 Size (libdvdcss-1.2.5.tar.bz2) = 209219 bytes
+SHA1 (patch-aa) = bc21ed202809819e964a30d77f3906719a124335
>Release-Note:
>Audit-Trail:
>Unformatted: