r1727 - in vdr/vdr-plugin-xine/trunk/debian: . patches
Tobias Grimm
tiber-guest at costa.debian.org
Sun Jan 15 14:12:37 UTC 2006
Author: tiber-guest
Date: 2006-01-15 14:12:36 +0000 (Sun, 15 Jan 2006)
New Revision: 1727
Added:
vdr/vdr-plugin-xine/trunk/debian/patches/02_grab.dpatch
vdr/vdr-plugin-xine/trunk/debian/patches/03_format_strings.dpatch
Removed:
vdr/vdr-plugin-xine/trunk/debian/patches/02_symlink_security.dpatch
Modified:
vdr/vdr-plugin-xine/trunk/debian/changelog
vdr/vdr-plugin-xine/trunk/debian/patches/00list
Log:
Synced with Darren Salt's package 0.7.6-6.ds
Modified: vdr/vdr-plugin-xine/trunk/debian/changelog
===================================================================
--- vdr/vdr-plugin-xine/trunk/debian/changelog 2006-01-14 21:51:19 UTC (rev 1726)
+++ vdr/vdr-plugin-xine/trunk/debian/changelog 2006-01-15 14:12:36 UTC (rev 1727)
@@ -4,6 +4,12 @@
* Thomas Schmidt <tschmidt at debian.org>
- Build-Depend on vdr (>=1.3.38-1)
+ * Tobias Grimm <tg at e-tobi.net>
+ - Synced with Darren Salt's package 0.7.6-6.ds
+ + Removed 02_symlink_security
+ + Fix the GRAB command back-end for VDR 1.3.38.
+ + Fix some printf() and esyslog() calls (missing format string).
+ Malicious DVB transmissions, anybody? :-)
-- Debian VDR Team <pkg-vdr-dvb-devel at lists.alioth.debian.org> Mon, 9 Jan 2006 20:06:47 +0100
Modified: vdr/vdr-plugin-xine/trunk/debian/patches/00list
===================================================================
--- vdr/vdr-plugin-xine/trunk/debian/patches/00list 2006-01-14 21:51:19 UTC (rev 1726)
+++ vdr/vdr-plugin-xine/trunk/debian/patches/00list 2006-01-15 14:12:36 UTC (rev 1727)
@@ -1,3 +1,4 @@
01_debian
01_Makefile-fPIC-fix
-02_symlink_security
+02_grab
+03_format_strings
Added: vdr/vdr-plugin-xine/trunk/debian/patches/02_grab.dpatch
===================================================================
--- vdr/vdr-plugin-xine/trunk/debian/patches/02_grab.dpatch 2006-01-14 21:51:19 UTC (rev 1726)
+++ vdr/vdr-plugin-xine/trunk/debian/patches/02_grab.dpatch 2006-01-15 14:12:36 UTC (rev 1727)
@@ -0,0 +1,192 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_grab.dpatch by <ds at flibble.youmustbejoking.demon.co.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad vdr-plugin-xine-0.7.6~/xineDevice.c vdr-plugin-xine-0.7.6/xineDevice.c
+--- vdr-plugin-xine-0.7.6~/xineDevice.c 2006-01-12 00:43:12.000000000 +0000
++++ vdr-plugin-xine-0.7.6/xineDevice.c 2006-01-12 00:43:12.715161206 +0000
+@@ -2487,18 +2487,13 @@
+ return Length;
+ }
+
+- bool cXineDevice::GrabImage(const char *FileName, bool Jpeg /* = true */, int Quality /* = -1 */, int SizeX /* = -1 */, int SizeY /* = -1 */)
++ uchar *cXineDevice::GrabImage(int &Size, bool Jpeg /* = true */, int Quality /* = -1 */, int SizeX /* = -1 */, int SizeY /* = -1 */)
+ {
+ xfprintf(stderr, "GrabImage ...\n\n");
+-
+- if (m_xineLib.execFuncGrabImage(FileName, Jpeg, Quality, SizeX, SizeY))
+- {
+- xfprintf(stderr, "\nGrabImage succeeded.\n");
+- return true;
+- }
+
+- xfprintf(stderr, "\nGrabImage failed.\n");
+- return false;
++ uchar *result = m_xineLib.execFuncGrabImage(Size, Jpeg, Quality, SizeX, SizeY);
++ xfprintf(stderr, result ? "\nGrabImage succeeded.\n" : "\nGrabImage failed.\n");
++ return result;
+ }
+
+ int64_t cXineDevice::GetSTC(void)
+diff -urNad vdr-plugin-xine-0.7.6~/xineDevice.h vdr-plugin-xine-0.7.6/xineDevice.h
+--- vdr-plugin-xine-0.7.6~/xineDevice.h 2006-01-12 00:43:12.000000000 +0000
++++ vdr-plugin-xine-0.7.6/xineDevice.h 2006-01-12 00:43:12.715161206 +0000
+@@ -66,7 +66,7 @@
+ int PlayCommon2(const uchar *Data, int Length);
+ int PlayCommon3(const uchar *Data, int Length);
+
+- virtual bool GrabImage(const char *FileName, bool Jpeg = true, int Quality = -1, int SizeX = -1, int SizeY = -1);
++ virtual uchar *GrabImage(int &Size, bool Jpeg = true, int Quality = -1, int SizeX = -1, int SizeY = -1);
+ virtual void SetVideoFormat(bool VideoFormat16_9);
+ virtual void SetVolumeDevice(int Volume);
+
+diff -urNad vdr-plugin-xine-0.7.6~/xineLib.c vdr-plugin-xine-0.7.6/xineLib.c
+--- vdr-plugin-xine-0.7.6~/xineLib.c 2006-01-12 00:43:12.000000000 +0000
++++ vdr-plugin-xine-0.7.6/xineLib.c 2006-01-12 00:45:33.377856050 +0000
+@@ -3444,7 +3444,7 @@
+ #define PNMTOJPEG "pnmtojpeg"
+ #endif
+
+- bool cXineLib::execFuncGrabImage(const char *FileName, bool Jpeg, int Quality, int SizeX, int SizeY)
++ uchar *cXineLib::execFuncGrabImage(int &Size, bool Jpeg, int Quality, int SizeX, int SizeY)
+ {
+ if (!isConnected())
+ return false;
+@@ -3453,7 +3453,7 @@
+ cMutexLock ioLock(&m_ioMutex);
+
+ if (!isConnected())
+- return false;
++ return NULL;
+
+ data_grab_image_t data;
+ data.header.func = func_grab_image;
+@@ -3465,32 +3465,32 @@
+
+ off_t n = xread(fd_result, (char *)&resultUnion, sizeof (resultUnion.header));
+ if (n != sizeof (resultUnion.header))
+- return false;
++ return NULL;
+
+ if (data.header.func != resultUnion.header.func)
+- return false;
++ return NULL;
+
+ result_grab_image_t *result = &resultUnion.grab_image;
+
+ n = xread(fd_result, (char *)result + sizeof (result->header), sizeof (*result) - sizeof (result->header));
+ if (n != sizeof (*result) - sizeof (result->header))
+- return false;
++ return NULL;
+
+ const size_t frameSize = result->header.len - sizeof (*result);
+
+ // ::fprintf(stderr, "frameSize: %d\n", frameSize);
+
+ if (frameSize <= 0)
+- return false;
++ return NULL;
+
+ uint8_t *img = (uint8_t *)::malloc(frameSize);
+ if (!img)
+- return false;
++ return NULL;
+
+ if (frameSize != (size_t)xread(fd_result, img, frameSize))
+ {
+ ::free(img);
+- return false;
++ return NULL;
+ }
+
+ if (XINE_IMGFMT_YUY2 == result->format)
+@@ -3499,7 +3499,7 @@
+ if (!img2)
+ {
+ ::free(img);
+- return false;
++ return NULL;
+ }
+
+ ::memset(img2, 0x80, frameSize);
+@@ -3531,11 +3531,10 @@
+ int videoH = -1;
+ execFuncVideoSize(videoX, videoY, videoW, videoH);
+
+- bool success = false;
+-
+- int outfd = ::open(FileName, O_CREAT /* | O_EXCL */ | O_TRUNC | O_RDWR, 0644);
+- if (-1 != outfd)
++ FILE *fd = ::tmpfile();
++ if (fd)
+ {
++ int outfd = fileno(fd);
+ int sizeX = SizeX;
+ int sizeY = SizeY;
+
+@@ -3595,22 +3594,41 @@
+ , result->width, result->height
+ , 25, 1
+ , ratioX, ratioY);
+-
+- success = (frameSize == ::fwrite(img, 1, frameSize, f));
+-
+- ::pclose(f);
++
++ if (frameSize == ::fwrite(img, 1, frameSize, f))
++ {
++ ::pclose(f); // close the pipe here, grab the image in one go
++ ::free(img);
++ img = NULL;
++
++ Size = (int) lseek (outfd, 0, SEEK_END);
++ lseek (outfd, 0, SEEK_SET);
++
++ if (Size != -1)
++ {
++ img = (uint8_t *)::malloc(Size);
++ if (img && Size != ::read(outfd, img, Size))
++ {
++ ::free(img);
++ img = NULL;
++ }
++ }
++ }
++ else
++ ::pclose(f);
+ }
+
+ ::free(cmd);
+- ::close(outfd);
++
++ ::fclose(fd);
++
++ return (uchar *)img;
+ }
+-
+- ::free(img);
+
+- return success;
++ ::free(img);
+ }
+
+- return false;
++ return NULL;
+ }
+
+ bool cXineLib::execFuncGetPTS(int64_t &pts)
+diff -urNad vdr-plugin-xine-0.7.6~/xineLib.h vdr-plugin-xine-0.7.6/xineLib.h
+--- vdr-plugin-xine-0.7.6~/xineLib.h 2006-01-12 00:43:12.000000000 +0000
++++ vdr-plugin-xine-0.7.6/xineLib.h 2006-01-12 00:43:12.715161206 +0000
+@@ -254,7 +254,7 @@
+ bool execFuncMetronom(int64_t pts, uint32_t flags = 0);
+ bool execFuncNop();
+ bool execFuncSetPrebuffer(int frames);
+- bool execFuncGrabImage(const char *FileName, bool Jpeg, int Quality, int SizeX, int SizeY);
++ uchar *execFuncGrabImage(int &Size, bool Jpeg, int Quality, int SizeX, int SizeY);
+ bool execFuncGetPTS(int64_t &pts);
+ bool execFuncVideoSize(int &videoLeft, int &videoTop, int &videoWidth, int &videoHeight);
+
Deleted: vdr/vdr-plugin-xine/trunk/debian/patches/02_symlink_security.dpatch
===================================================================
--- vdr/vdr-plugin-xine/trunk/debian/patches/02_symlink_security.dpatch 2006-01-14 21:51:19 UTC (rev 1726)
+++ vdr/vdr-plugin-xine/trunk/debian/patches/02_symlink_security.dpatch 2006-01-15 14:12:36 UTC (rev 1727)
@@ -1,19 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 02_symlink_security.dpatch by <ds at flibble.youmustbejoking.demon.co.uk>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fully plug security hole.
-
- at DPATCH@
-diff -urNad vdr-plugin-xine-0.7.0/xineLib.c /tmp/dpep.Cd3lwX/vdr-plugin-xine-0.7.0/xineLib.c
---- vdr-plugin-xine-0.7.0/xineLib.c 2005-01-29 22:28:31.000000000 +0000
-+++ /tmp/dpep.Cd3lwX/vdr-plugin-xine-0.7.0/xineLib.c 2005-01-30 00:25:56.000000000 +0000
-@@ -3254,7 +3254,7 @@
-
- bool success = false;
-
-- int outfd = ::open(FileName, O_CREAT /* | O_EXCL */ | O_TRUNC | O_RDWR, 0644);
-+ int outfd = ::open(FileName, O_CREAT | O_NOFOLLOW | O_TRUNC | O_RDWR, 0644);
- if (-1 != outfd)
- {
- int sizeX = SizeX;
Added: vdr/vdr-plugin-xine/trunk/debian/patches/03_format_strings.dpatch
===================================================================
--- vdr/vdr-plugin-xine/trunk/debian/patches/03_format_strings.dpatch 2006-01-14 21:51:19 UTC (rev 1726)
+++ vdr/vdr-plugin-xine/trunk/debian/patches/03_format_strings.dpatch 2006-01-15 14:12:36 UTC (rev 1727)
@@ -0,0 +1,111 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+
+## 03_format_strings.dpatch by Darren Salt
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix some missing-format-string bugs.
+
+ at DPATCH@
+diff -urNad vdr-plugin-xine-0.7.6~/xineLib.c vdr-plugin-xine-0.7.6/xineLib.c
+--- vdr-plugin-xine-0.7.6~/xineLib.c 2006-01-12 01:21:23.599614013 +0000
++++ vdr-plugin-xine-0.7.6/xineLib.c 2006-01-12 01:21:47.774014821 +0000
+@@ -1912,8 +1912,8 @@
+ }
+ else
+ {
+- ::fprintf(stderr, ("vdr-xine: error: couldn't open '" + noSignalFileName + "'!\n").c_str());
+- esyslog(("vdr-xine: error: couldn't open '" + noSignalFileName + "'!\n").c_str());
++ ::fprintf(stderr, "vdr-xine: error: couldn't open '%s'!\n", noSignalFileName.c_str());
++ esyslog("vdr-xine: error: couldn't open '%s'!\n", noSignalFileName.c_str());
+ }
+
+ assert(remote);
+@@ -1953,69 +1953,32 @@
+
+ const mode_t origUmask = ::umask(0);
+
+- if (::mkdir(m_fifoDir.c_str(), 0755) < 0)
+- {
+- perror(("vdr-xine: error: couldn't create directory '" + m_fifoDir + "'").c_str());
+- esyslog(("vdr-xine: error: couldn't create directory '" + m_fifoDir + "'").c_str());
+-
+- ::umask(origUmask);
+- return false;
+- }
+-
+- if (::mknod(m_fifoNameExtControl.c_str(), 0666 | S_IFIFO, 0) < 0)
+- {
+- perror(("vdr-xine: error: couldn't create fifo '" + m_fifoNameExtControl + "'").c_str());
+- esyslog(("vdr-xine: error: couldn't create fifo '" + m_fifoNameExtControl + "'").c_str());
+-
+- ::umask(origUmask);
+- return false;
+- }
+-
+- if (::mknod(m_fifoNameExtResult.c_str(), 0644 | S_IFIFO, 0) < 0)
+- {
+- perror(("vdr-xine: error: couldn't create fifo '" + m_fifoNameExtResult + "'").c_str());
+- esyslog(("vdr-xine: error: couldn't create fifo '" + m_fifoNameExtResult + "'").c_str());
+-
+- ::umask(origUmask);
+- return false;
+- }
+-
+- if (::mknod(m_fifoNameControl.c_str(), 0644 | S_IFIFO, 0) < 0)
+- {
+- perror(("vdr-xine: error: couldn't create fifo '" + m_fifoNameControl + "'").c_str());
+- esyslog(("vdr-xine: error: couldn't create fifo '" + m_fifoNameControl + "'").c_str());
+-
+- ::umask(origUmask);
+- return false;
+- }
+-
+- if (::mknod(m_fifoNameResult.c_str(), 0666 | S_IFIFO, 0) < 0)
+- {
+- perror(("vdr-xine: error: couldn't create fifo '" + m_fifoNameResult + "'").c_str());
+- esyslog(("vdr-xine: error: couldn't create fifo '" + m_fifoNameResult + "'").c_str());
+-
+- ::umask(origUmask);
+- return false;
+- }
++#define MkFifo(String, Mask) \
++ do { if (::mknod((String).c_str(), (Mask) | S_IFIFO, 0) < 0) \
++ { \
++ string msg = "vdr-xine: error: couldn't create fifo '" + (String) + "'"; \
++ perror(msg.c_str()); \
++ esyslog("%s", msg.c_str()); \
++ ::umask(origUmask); \
++ return false; \
++ } } while (0)
+
+- if (::mknod(m_fifoNameRemote.c_str(), 0666 | S_IFIFO, 0) < 0)
++ if (::mkdir(m_fifoDir.c_str(), 0755) < 0)
+ {
+- perror(("vdr-xine: error: couldn't create fifo '" + m_fifoNameRemote + "'").c_str());
+- esyslog(("vdr-xine: error: couldn't create fifo '" + m_fifoNameRemote + "'").c_str());
+-
++ string msg = "vdr-xine: error: couldn't create directory '" + m_fifoDir + "'";
++ perror(msg.c_str());
++ esyslog("%s", msg.c_str());
+ ::umask(origUmask);
+ return false;
+ }
+
+- if (::mknod(m_fifoNameStream.c_str(), 0644 | S_IFIFO, 0) < 0)
+- {
+- perror(("vdr-xine: error: couldn't create fifo '" + m_fifoNameStream + "'").c_str());
+- esyslog(("vdr-xine: error: couldn't create fifo '" + m_fifoNameStream + "'").c_str());
++ MkFifo(m_fifoNameExtControl, 0666);
++ MkFifo(m_fifoNameExtResult, 0644);
++ MkFifo(m_fifoNameControl, 0644);
++ MkFifo(m_fifoNameResult, 0666);
++ MkFifo(m_fifoNameRemote, 0666);
++ MkFifo(m_fifoNameStream, 0644);
+
+- ::umask(origUmask);
+- return false;
+- }
+-
+ ::umask(origUmask);
+
+ if (!Start())
More information about the pkg-vdr-dvb-changes
mailing list