[ANNOUNCE] vdr-pin-0.0.15

Message ID 200605011427.27815.vdr-ml@jwendel.de
State New
Headers

Commit Message

Jörg Wendel May 1, 2006, 12:27 p.m. UTC
  Hi,

On Montag 01 Mai 2006 13:35, Michael Nausch wrote:
> Griasdebou!
>
> O.K. I'm back from hospital an will play and search, what happens ...
>
> Am Montag, 1. Mai 2006 07:53 schrieb Jörg Wendel:
> > please can you check if the file
> > "/video/Clips/Tito_&_Tarantula_-_After_Dark/2005-02-04.22.50.99.99.rec/pr
> >ot ection.fsk" was created by the script.
>
> No, there's no protection.fsk in the subdirectory.
>
> > Does you have changed the script "/usr/bin/fskprotect.sh" to the new one?
>
> Jepp, I've made some symlinks to use the right new scripts:
> tecvdr:/usr/bin # ls -al fs*
> lrwxrwxrwx    1 root     root           43 Apr 30 22:54 fskcheck
> -> /usr/local/src/VDR/PLUGINS/src/pin/fskcheck
> lrwxrwxrwx    1 root     root           59 Apr 30 22:53 fskcheck-demo.sh
> -> /usr/local/src/VDR/PLUGINS/src/pin/scripts/fskcheck-demo.sh
> lrwxrwxrwx    1 root     root           56 Apr 30 22:53 fskprotect.sh
> -> /usr/local/src/VDR/PLUGINS/src/pin/scripts/fskprotect.sh
>
> fsprotect.sh contains:
> tecvdr:/usr/bin # cat fskprotect.sh

the links and the script looks good, i think the script exits cause it can't 
check the protection state of the pin plugin. And the reason for this should  
be the 'permision denied' problem.

> ecvdr:/usr/bin # ipcs -q
>
> ------ Message Queues --------
> key        msqid      owner      perms      used-bytes   messages
> 0xd8000000 0          vdr        0          0            0

Ok, thats it, the perms are 0. Sorry it's my bug, i'am using linvdr where vdr 
is always running as root. For the root user the perms don't matter.

Pleas apply the attached patch to the plugin. BEFORE starting vdr again make 
sure no system message queue with the wrong permissions is left. 
Attention only message queues which key starts with 0xd80000?? are from the 
pin plugin. Don't delete others of your system ;)

Example:

- first list it:
  linvdr:/etc/vdr# ipcs -q | grep 0xd80000
  0xd8000000 393216     root       666        0            0           

- now delete it using the listed key(s) (second column)
  linvdr:/etc/vdr# ipcrm msg 393216


Greetings 
Jörg
  

Comments

Michael Nausch May 1, 2006, 1:32 p.m. UTC | #1
Griasdebou!

Am Montag, 1. Mai 2006 14:27 schrieb Jörg Wendel:

> Ok, thats it, the perms are 0. Sorry it's my bug, i'am using linvdr where
> vdr is always running as root. For the root user the perms don't matter.

Aha! But you know, every little baby is given with the mother's milk:
Don't run a program under the rights of root, if there's no secial necessity! 
<lol>

> Pleas apply the attached patch to the plugin.

I've done this, and now it works a little better, but only a little, cause 
there's a further problem:

If I try to play a protected recording the following happens:
May  1 15:07:45 tecvdr vdr: [768] info: Kinderschutz aktiviert
May  1 15:07:55 tecvdr vdr: [768] checking protection of recording '(null)'
May  1 15:07:55 tecvdr vdr: [768] checking rights, protection file is 
'/video/Willi_wills_wissen/2006-04-04.14.50.99.99.rec/protection.fsk'
May  1 15:07:55 tecvdr vdr: [768] pin: no translation found for 'Recording 
protected, enter pin code first' in language 1 (Deutsch)
May  1 15:07:55 tecvdr vdr: [768] ERROR: Recording protected, enter pin code 
first

So far so good! I can play this recording after "opening" the protection with 
"Gorge Orwells special year-code".

BUT, if I try to protect a recording I've the new old problem:
May  1 15:08:45 tecvdr vdr: [768] checking protection of recording 'Clips'
May  1 15:08:45 tecvdr vdr: [768] checking rights, protection file is 
'/video/Clips/protection.fsk'
May  1 15:08:51 tecvdr vdr: [768] executing command '/usr/bin/fskprotect.sh 
protect 
"/video/Clips/Metallica_-_Hero_of_the_Day/2005-02-02.20.20.99.99.rec"'
May  1 15:08:51 tecvdr vdr: [866] Message (0) from (229377) received [-]
May  1 15:08:51 tecvdr vdr: [866] Sending message to (229377) failed, errno 
(13), 'Permission denied'
May  1 15:08:51 tecvdr vdr: [866] Message (1) from (262145) received [Please 
enable pin protection first]
May  1 15:08:51 tecvdr vdr: [866] Got 'Please enable pin protection first'
May  1 15:08:51 tecvdr vdr: [768] info: Please enable pin protection first

The pin-plugin is active!

tecvdr:~ # ipcs -q

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages
0xd8000000 0          vdr        666        0            0

Further I will mak a little wish a improvement-suggestion, if the 
pin-plugin-menue is displayed on OSD, I'll see:
1 Kanalliste bearbeiten
2 Gesperrte Sendungen bearbeiten
3 Aktuellen Kanal in die Sperrliste aufnehmen
4 Aktuelle Sendung in die Sperrliste aufnehmen
5 Kinderschutz aktivieren

If I try to select menupoint 5 "Kinderschutz aktivieren" an press button 5 
nothing happens. I must scroll down and press then the ok-button. Were it 
possible, to (re)act like VDR in all the other menues? 

Have a nice day!

BC
  
Jörg Wendel May 1, 2006, 5:42 p.m. UTC | #2
On Montag 01 Mai 2006 15:32, Michael Nausch wrote:

> Aha! But you know, every little baby is given with the mother's milk:
> Don't run a program under the rights of root, if there's no secial
> necessity! <lol>

You're right, but for my vdr i'am using linvdr with less changes as possible 
:(

> > Pleas apply the attached patch to the plugin.
>
> I've done this, and now it works a little better, but only a little, cause
> there's a further problem:
>
> If I try to play a protected recording the following happens:
> May  1 15:07:45 tecvdr vdr: [768] info: Kinderschutz aktiviert
> May  1 15:07:55 tecvdr vdr: [768] checking protection of recording '(null)'
> May  1 15:07:55 tecvdr vdr: [768] checking rights, protection file is
> '/video/Willi_wills_wissen/2006-04-04.14.50.99.99.rec/protection.fsk'
> May  1 15:07:55 tecvdr vdr: [768] pin: no translation found for 'Recording
> protected, enter pin code first' in language 1 (Deutsch)
> May  1 15:07:55 tecvdr vdr: [768] ERROR: Recording protected, enter pin
> code first

Ok, i have now added the missing german translation for 'Recording protected, 
enter pin code first'.

> So far so good! I can play this recording after "opening" the protection
> with "Gorge Orwells special year-code".

Ok

> BUT, if I try to protect a recording I've the new old problem:
> May  1 15:08:45 tecvdr vdr: [768] checking protection of recording 'Clips'
> May  1 15:08:45 tecvdr vdr: [768] checking rights, protection file is
> '/video/Clips/protection.fsk'
> May  1 15:08:51 tecvdr vdr: [768] executing command '/usr/bin/fskprotect.sh
> protect
> "/video/Clips/Metallica_-_Hero_of_the_Day/2005-02-02.20.20.99.99.rec"'
> May  1 15:08:51 tecvdr vdr: [866] Message (0) from (229377) received [-]
> May  1 15:08:51 tecvdr vdr: [866] Sending message to (229377) failed, errno
> (13), 'Permission denied'
> May  1 15:08:51 tecvdr vdr: [866] Message (1) from (262145) received
> [Please enable pin protection first]
> May  1 15:08:51 tecvdr vdr: [866] Got 'Please enable pin protection first'
> May  1 15:08:51 tecvdr vdr: [768] info: Please enable pin protection first

Hm, this i can't reproduce even if i'am not root. Are the fskcheck tool 
recompiled after the patch was applied? Was the fskcheck.c changed by the 
patch?  Wat says:
#> fskcheck check; echo $?
it shoud return 2 when the protection is active and 1 if vdr is currently not 
protected.

> The pin-plugin is active!
>
> tecvdr:~ # ipcs -q
>
> ------ Message Queues --------
> key        msqid      owner      perms      used-bytes   messages
> 0xd8000000 0          vdr        666        0            0

looks good!

> If I try to select menupoint 5 "Kinderschutz aktivieren" an press button 5
> nothing happens. I must scroll down and press then the ok-button. Were it
> possible, to (re)act like VDR in all the other menues?

Done.

I release the 2 changes when we have solved the pending problem.

Many thanks for beta testing ;)
Greets Jörg
  
Michael Nausch May 1, 2006, 6:49 p.m. UTC | #3
HI Jörg!

Am Montag, 1. Mai 2006 19:42 schrieb Jörg Wendel:

> > > Pleas apply the attached patch to the plugin.
> >
> > I've done this, ...

But I did'nt it not right, so I think! I've patch the two files fskcheck.c and 
msgreceiver.c by hand, and what happens. IT WORKS!!!

> Hm, this i can't reproduce even if i'am not root.

Forget it! Something went wrong while I've patched the pin-plugin via
"cat pin-0.0.15-perm-bug.diff | patch".

> I release the 2 changes when we have solved the pending problem.

O.K, I've no more problem! ;) So there isn't a rock on your way to solve my 
little wishes. ;)

> Many thanks for beta testing ;)

No problem, I think this is one of VDRs VIP (Very Importandt Plugins), one new 
feature for next development-release! <bg>

So, now, I can work with the next plugins ...

Have a nice day!
                Django
  
Jörg Wendel May 1, 2006, 7:06 p.m. UTC | #4
Hi,

> O.K, I've no more problem! ;) So there isn't a rock on your way to solve my
> little wishes. ;)

Version 0.0.16 including the bugfix and the little changes from above is 
available at www.jwendel.de


A new version with a feature to protect plugins is in work now. For example 
the dvd plugin can protected so the children can't look dvd's.

>  Django
Hatte ich doch richtig geraten, aber wer sollte es bei "Griasdebou" sonst 
sein :))

Grüße Horchi
  

Patch

--- ../newpin//fskcheck.c	Mon May  1 14:13:31 2006
+++ fskcheck.c	Mon May  1 14:10:25 2006
@@ -17,6 +17,7 @@ 
 #include <errno.h>
 #include <sys/time.h>
 #include <signal.h>
+#include <sys/stat.h>
 #include <sys/msg.h>
 
 #include "def.h"
@@ -132,7 +133,7 @@ 
 
    // create my own message queue
 
-   if ((msgID = msgget(0xd8000001, IPC_CREAT) < 0)
+   if ((msgID = msgget(0xd8000001, IPC_CREAT|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) < 0)
    {
       if (!silent) printf("Creation of message queue failed\n");
       return fail;
--- ../newpin//msgreceiver.c	Mon May  1 14:13:17 2006
+++ msgreceiver.c	Mon May  1 14:10:51 2006
@@ -10,6 +10,7 @@ 
 // Includes
 //***************************************************************************
 
+#include <sys/stat.h>
 #include <sys/msg.h>
 #include <signal.h>
 
@@ -51,7 +52,7 @@ 
 {
    if (!active)
    {
-      if ((msgID = msgget(0xd8000000, IPC_CREAT)) < 0)
+      if ((msgID = msgget(0xd8000000, IPC_CREAT|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) < 0)
       {
          dsyslog("creation of message queue failed");
          return fail;