r334 - in vdr/vdradmin/trunk/debian: . patches

Tobias Grimm pkg-vdr-dvb-changes@lists.alioth.debian.org
Sun, 27 Mar 2005 19:03:25 +0000


Author: tiber-guest
Date: 2005-03-27 19:03:24 +0000 (Sun, 27 Mar 2005)
New Revision: 334

Modified:
   vdr/vdradmin/trunk/debian/changelog
   vdr/vdradmin/trunk/debian/patches/02_sectmpfiles.dpatch
   vdr/vdradmin/trunk/debian/postinst
Log:
vdradmin: make vdradmind.at writeable by group vdr, delete grabbed images

Modified: vdr/vdradmin/trunk/debian/changelog
===================================================================
--- vdr/vdradmin/trunk/debian/changelog	2005-03-27 11:57:34 UTC (rev 333)
+++ vdr/vdradmin/trunk/debian/changelog	2005-03-27 19:03:24 UTC (rev 334)
@@ -5,6 +5,10 @@
   * Thomas Schmidt <tschmidt@debian.org>
     - Removed Andreas Müller from uploaders - he does not intend 
       to do uploads anymore
+  * Tobias Grimm <tg@e-tobi.net>
+    - Delete temporary grabbed images after use
+    - Make vdradmind.at and /var/lib/vdradmin owned by group vdr 
+      to allow vdr plugins like Autotimeredit to make modifications
 
  -- Debian VDR Team <pkg-vdr-dvb-devel@lists.alioth.debian.org>  Wed, 23 Feb 2005 23:54:46 +0100
 

Modified: vdr/vdradmin/trunk/debian/patches/02_sectmpfiles.dpatch
===================================================================
--- vdr/vdradmin/trunk/debian/patches/02_sectmpfiles.dpatch	2005-03-27 11:57:34 UTC (rev 333)
+++ vdr/vdradmin/trunk/debian/patches/02_sectmpfiles.dpatch	2005-03-27 19:03:24 UTC (rev 334)
@@ -5,9 +5,9 @@
 ## DP: Use File::Temp to create temporary files in a secure way
 
 @DPATCH@
-diff -urNad vdradmin-0.96/vdradmind.pl /tmp/dpep.WXXL4r/vdradmin-0.96/vdradmind.pl
---- vdradmin-0.96/vdradmind.pl	2005-01-24 00:28:03.000000000 +0100
-+++ /tmp/dpep.WXXL4r/vdradmin-0.96/vdradmind.pl	2005-01-24 00:28:19.000000000 +0100
+diff -urNad vdradmin/vdradmind.pl /tmp/dpep.tZ4BvR/vdradmin/vdradmind.pl
+--- vdradmin/vdradmind.pl	2005-03-27 16:06:53.000000000 +0200
++++ /tmp/dpep.tZ4BvR/vdradmin/vdradmind.pl	2005-03-27 16:08:50.000000000 +0200
 @@ -32,12 +32,15 @@
  	unshift(@INC, $BASENAME . "lib/");
  }
@@ -33,7 +33,7 @@
    open(PIPE, "| gzip -9 - > $filename") || die "cant open pipe to gzip ($!)";
    print PIPE $$content;
    close(PIPE);
-@@ -3038,7 +3041,16 @@
+@@ -3038,7 +3041,15 @@
  #############################################################################
  sub grab_picture {
  	my $size = $q->param("size");
@@ -42,8 +42,7 @@
 +	my $file;
 +
 +	if (! $ENV{TEMPDIR} == "") {
-+	   my $time = my_strftime("%s");
-+	   $file = "$ENV{TEMPDIR}/$time.jpg";
++	   $file = "$ENV{TEMPDIR}/vdradmin.$$.jpg";
 +	} else {
 +	   $file = new File::Temp(UNLINK => 1, SUFFIX => '.jpg');
 +	}
@@ -51,3 +50,14 @@
  	my $maxwidth = 768;
  	my $maxheight = 576;
  	my($width, $height);
+@@ -3055,7 +3066,9 @@
+ 	SendCMD("grab $file jpeg 40 $width $height");
+ 	#SendCMD("grab $file jpeg");
+ 	if(-e $file && -r $file) {
+-		return(header("200", "image/jpeg", ReadFile($file)));
++	        my $image = header("200", "image/jpeg", ReadFile($file));
++		unlink($file);
++		return($image);
+ 	} else {
+ 		print "Expected $file does not exist.\n";
+     print "Obviously VDR Admin could not find the screenshot file. Ensure that:\n";

Modified: vdr/vdradmin/trunk/debian/postinst
===================================================================
--- vdr/vdradmin/trunk/debian/postinst	2005-03-27 11:57:34 UTC (rev 333)
+++ vdr/vdradmin/trunk/debian/postinst	2005-03-27 19:03:24 UTC (rev 334)
@@ -44,6 +44,10 @@
         echo "...done"
 fi
 
+# ensure vdradmind.at (auto timers) exists
+ATFILE=/var/lib/vdradmin/vdradmind.at
+[ -e $ATFILE ] || touch $ATFILE
+
 # ensure that vdradmin's config files have the correct owner
 [ ! -d /var/lib/vdradmin ] || chown -R $USER:$GROUP /var/lib/vdradmin/
 
@@ -52,5 +56,12 @@
 
 # change the owner and group of the logfile to vdradmin
 [ ! -e /var/log/vdradmind.log ] || chown $USER:$GROUP /var/log/vdradmind.log
+
+# make auto timer file and config dir owned and writeable by group vdr, 
+# so that vdr plugins (Autotimeredit plugin) can make modifications
+if getent group | grep -q "^vdr:" ; then
+   chgrp vdr $ATFILE /var/lib/vdradmin
+   chmod g+rw $ATFILE /var/lib/vdradmin
+fi
 	
 ##DEBHELPER##