Use of USB drives in a family environment
#1
Hi All,

Having used an original XBox running XBMC for some time I've moved to an Asroc 330HT using the live distribution and thought now might be a good time to start contributing...

When using locally attached USB drives you'll find that XBMC will list the drive under Videos with no means to lock it from prying junior eyes. I would rather exclude this from unrestricted browsing, instead only allowing access to sources I have added, pin protecting age restricted content.

In xbmc/FileSystem/VirtualDirectory.cpp there's a routine called GetRemovableDrives() which gets called if a flag, m_allowNonLocalSources, is true. This is always set true (at line 48), and there's no way to set it false without rebuilding unfortunately. If set false then removable drives (USB FLASH and hard drives) will not be listed under source lists. Pity this isn't settable from an XML configuration option. Of course there's no reason why there shouldn't be...

So a bit of rebuilding and I'm now running the latest version from SVN tweaked as desired. The following addition to ~/.xbmc/userdata/advancedsettings.xml disables external (USB) media display in the source menus.

<nonlocalsources>false</nonlocalsources>

So, two questions really:

1. Do you guys agree that the above mod is worthwhile to make XBMC more secure in a family environment?
2. If (1) is a "yes", how should I go about contributing my changes?

Thanks,

Steve
Reply
#2
From a security perspective that sounds like a great idea. You should allow users the minimum allowable security permissions. Locking USB drives optionally would be a great addition. I don't speak for Team XBMC on this, but it is something which should be added. It's a step in the right direction for V-Chip type security.

This would allow the typical guy using XBMC to lock the kids out of USB stick porn collections. Also, it can stop people from plugging in your camera SD card and inadvertently displaying pictures of you and your girlfriend to the whole family on the big screen.
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply
#3
OK, so for anybody who's interested...

This could be done using GUI settings under Appearance->File Lists, but if this is at least a proof of concept to consider.

$ svn diff . | more
Index: xbmc/AdvancedSettings.cpp
===================================================================
--- xbmc/AdvancedSettings.cpp (revision 35649)
+++ xbmc/AdvancedSettings.cpp (working copy)
@@ -249,6 +249,7 @@
m_RestrictCapsMask = 0;
m_sleepBeforeFlip = 0;
m_bVirtualShares = true;
+ m_allowNonLocalSources = true;

//caused lots of jerks
//#ifdef _WIN32
@@ -640,6 +641,7 @@
XMLUtils::GetUInt(pRootElement,"restrictcapsmask", m_RestrictCapsMask);
XMLUtils::GetFloat(pRootElement,"sleepbeforeflip", m_sleepBeforeFlip, 0.0f, 1.0f);
XMLUtils::GetBoolean(pRootElement,"virtualshares", m_bVirtualShares);
+ XMLUtils::GetBoolean(pRootElement,"nonlocalsources", m_allowNonLocalSources);

//Tuxbox
pElement = pRootElement->FirstChildElement("tuxbox");
Index: xbmc/FileSystem/VirtualDirectory.cpp
===================================================================
--- xbmc/FileSystem/VirtualDirectory.cpp (revision 35649)
+++ xbmc/FileSystem/VirtualDirectory.cpp (working copy)
@@ -21,6 +21,7 @@


#include "system.h"
+#include "AdvancedSettings.h"
#include "VirtualDirectory.h"
#include "FactoryDirectory.h"
#include "Settings.h"
@@ -45,7 +46,7 @@
{
m_allowPrompting = true; // by default, prompting is allowed.
m_cacheDirectory = DIR_CACHE_ONCE; // by default, caching is done.
- m_allowNonLocalSources = true;
+ m_allowNonLocalSources = g_advancedSettings.m_allowNonLocalSources;
m_allowThreads = true;
}

Index: xbmc/AdvancedSettings.h
===================================================================
--- xbmc/AdvancedSettings.h (revision 35649)
+++ xbmc/AdvancedSettings.h (working copy)
@@ -260,6 +260,7 @@
unsigned int m_RestrictCapsMask;
float m_sleepBeforeFlip; ///< if greather than zero, XBMC waits for raster to be this amount through the frame prior to calling the flip
bool m_bVirtualShares;
+ bool m_allowNonLocalSources;

float m_karaokeSyncDelayCDG; // seems like different delay is needed for CDG and MP3s
float m_karaokeSyncDelayLRC;



Steve
Reply
#4
I think it's wise to file an issue in the http://trac.xbmc.org/ and attach your patch there as well. It's more in the front of the eyes of the developers.
Reply
#5
Disregard the above patch as it's a crude proof of concept.

See http://trac.xbmc.org/ticket/10923

This fix now provides a configuration option of "Show removable media in file lists" option to the Appearance->File lists settings.

Steve
Reply

Logout Mark Read Team Forum Stats Members Help
Use of USB drives in a family environment0