forked from len0rd/rockbox
Agptek Rocker: Restrict root directory to SD only
Actual / of underlying linux OS should not be available to user. I am still not sure if implementation is correct. It doesn't perform any relative path sandboxing for example. Change-Id: Ic577a10f3947f6e950e2c4d03173f9f207395eb7
This commit is contained in:
parent
09fde79ec8
commit
0538ba3d59
4 changed files with 14 additions and 4 deletions
|
|
@ -37,6 +37,10 @@
|
|||
#include "logf.h"
|
||||
|
||||
|
||||
#if defined(AGPTEK_ROCKER) && !defined(BOOTLOADER)
|
||||
#define PIVOT_ROOT "/mnt/sd_0"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
|
||||
static const char rbhome[] = "/sdcard";
|
||||
#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO|PLATFORM_PANDORA)) \
|
||||
|
|
@ -205,6 +209,10 @@ const char * handle_special_dirs(const char *dir, unsigned flags,
|
|||
#endif
|
||||
#ifdef HAVE_MULTIDRIVE
|
||||
dir = handle_special_links(dir, flags, buf, bufsize);
|
||||
#endif
|
||||
#ifdef PIVOT_ROOT
|
||||
snprintf(buf, bufsize, "%s/%s", PIVOT_ROOT, dir);
|
||||
dir = buf;
|
||||
#endif
|
||||
return dir;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue