Enabling parental control prevents access to .xxx directories

Issue #534 resolved
prl created an issue

If parental control "protect services" is enabled, it's not possible to enter directories whose names start with ".", other that directories whose names start with ".Trash".

The code looks like it's intended to make ".xxx" directories accessible only via PIN entry, unless you're trying to enter the Trash (".Trash") directory.

I don't know why the exception is dirname.startswith(".Trash") rather than dirname == ".Trash".

If you create a directory whose name starts with ".aaa" and enable "protect services", the media browser won't let you enter it. It asks for a pin, and if you give it the correct PIN, it simply returns to asking for the PIN again. The function MovieSelection.gotFilename.servicePinEntered() doesn't set any state that tells the re-called MovieSelection.gotFilename() that the pin has been verified, even when the PIN verified correctly, and there's no code in MovieSelection.gotFilename() to check whether the PIN was entered correctly.

NB: the lockout can be partly circumvented by navigating the file system in FileCommander, but even though it allows you to list what's in the locked directory, you still can't play media in it without a PIN.

Replication steps In MENU>Setup>TV>Parental control, enable "Protect services". There's no need to change the PIN from the "0000" default.

In the media player (MEDIA from live TV), create two new directories, one simply starting with '.', say ".aaa", and the other starting with ".Trash", say ".Trashy".

If you navigate to ".aaa" and press OK, you are asked to enter the PIN. If you enter a correct PIN, you get the same screen asking you to enter the PIN. This continues until you either press EXIT or enter an incorrect PIN three times in a row.

If you navigate to ".Trashy" and press OK it allows you to enter the directory.

Comments (6)

  1. IanSav

    I think you will find that some plugins use ".Trashcan" rather than ".Trash". The code you noted may be designed to allow for variations in the trash directory name.

  2. prl reporter

    Good point, but do you know of any examples? I couldn't find any in either the enigma2-plugins or the oe-alliance-plugins repositories.

    I did find ".trash" used in enigma2-plugins/advancedmovieselection, but the current code won't accept that as being an exception to the PIN requirement.

  3. IanSav

    I don't remember the exact plugin name but it was an OpenATV file management plugin I was testing. I thought I saw the trashcan term used elsewhere (in a media player, I think, but I can't remember).

  4. IanSav

    Perhaps the "Trash" directory name should become a config variable that all (plugin) developers should be encouraged to adopt.

  5. prl reporter

    The trash folder name should probably be in a common variable (not sure why a config variable, though), but it doesn't help much with the immediate problem.

    Is there any chance of some more specific information about where ".Trashcan" might have been used as a trash folder name?

    I haven't been able to find an OpenATV file manager plugin anywhere. I can't find ".Trashcan" used as a filename in the Plugins section of the OpenATV enigma2 source, and the OpenATV account on GitHub doesn't seem to have a general plugins repository at all, and no likely-looking specific file manager plugin repository.

    "Trashcan" is used in the firmware as a module name in the enigma2 firmware (Tools.Trashcan) and in (at least) enigma2-plugins/advancedmovieselection as a moudle and class name, Source.Trashcan.Trashcan.

  6. Peter Urbanec

    Fix bug #534: Enabling parental control prevents access to .xxx directories

    [MovieSelection] Add a default parameter to gotFilename() to indicate that a correct access PIN has been entered to avoid being stuck in a loop where the PIN is repeatedly requested even after it has been entered correctly.

    Narrow the test on allowing non-PIN-controlled access to Trash directories from

    baseName.startswith(".Trash")

    to

    baseName not in (".Trash", ".trash", ".Trashcan")

    to cover cases discussed in the issue comments.

    → <<cset 66bb84ffffe8>>

  7. Log in to comment