Further segregated ProfileImagePath user folders

Please post your problem description here

Moderator: Barb@Invincea

Post Reply
BUCKAROO
Posts: 206
Joined: Sun Oct 24, 2010 3:13 am

Further segregated ProfileImagePath user folders

Post by BUCKAROO » Sat Feb 09, 2013 2:01 pm

Sandboxie version 3.76 (64-bit) registered and activated. Also testing Beta Version 4.01 (on another license and computer).
Microsoft Windows 8 Pro with Media Center [Version 6.2.9200] (64-bit)


For example, Windows' lackluster Users' individual personal folders relocation via Properties -> Location tab, are not being respected by Sandboxie's "user" files partitioning.

Similarly, files and folders via Junctions or Symlinks within %USERPROFILE% internally pointing outside %USERPROFILE% go not in %SANDBOX%\user\ but %SANDBOX%\drive\.

The problems arise when this drive is not on the current system (unplugged and or configuration change), such as in a scenario where the Sandbox FileRootPath is used by way of a network share (or the Sandbox itself) on another computer (or different local user) with Sandboxie.

This is troubling me greatly.

As a workaround for Sandboxie following NTFS links to their targets and isolating files in the destination "drive\<letter>\" instead of "user\" (where they would always be seen through Libraries) but happen to lie outside %USERPROFILE% by, reparse point within, or registry based relocation, one can resort to setting the base ProfileImagePath (Sandboxed (or not, careful)) registry key, however, my %USERPROFILE% is broken up...

Directory of C:\Users\BUCKAROO

<DIR> .
<DIR> ..
<JUNCTION> Contacts [S:\Users\BUCKAROO\Contacts]
<DIR> Desktop
<JUNCTION> Documents [S:\Users\BUCKAROO\Documents]
<JUNCTION> Downloads [S:\Users\BUCKAROO\Downloads]
<JUNCTION> Favorites [S:\Users\BUCKAROO\Favorites]
<DIR> Links
<JUNCTION> Music [S:\Users\BUCKAROO\Music]
<JUNCTION> Pictures [S:\Users\BUCKAROO\Pictures]
<JUNCTION> Saved Games [S:\Users\BUCKAROO\Saved Games]
<DIR> Searches
<JUNCTION> Videos [S:\Users\BUCKAROO\Videos]

Registry values:
ProfileImagePath=C:\Users\BUCKAROO
(Sandboxed) ProfileImagePath=S:\Users\BUCKAROO

Of course, should the ProfileImagePath be changed to reflect the location of say, My Documents, then (the reverse important folders,) AppData, and Desktop, etc, end up in "%SANDBOX%\drive\C\Users\%USERNAME%\..." thereby breaking Sandbox portability (according to expectation) between distinct users.

[I need user AppData and user Registry to remain on a fixed drive. I am opposed to relocating the entire ProfilesDirectory or ProfileImagePath as a whole.]
[I don't think Sandboxie or Sandboxed programs mind that the user registry hive files are not in the respective path.]

Individual personal folder redirection (Windows supported) or NTFS based relocation of said files and folders is the issue for Sandboxie, please add special handling or add new Sandboxie Ini setting IncludeUserPath (or something) where included paths are merged, perhaps a toggle for the logical resolving of NTFS links (would also meet my preference and wouldn't be limited to user directories redirection but say %ProgramFiles% too)?

Some software integrates or installs to Documents. Sandboxed documents and settings should always be accessible in the Sandbox -- but aren't always what with the advent of SSD drives, subject to increasingly common custom personal folders' reassignments to storage drives -- as any \current\ user (per design?) given usage of the same Sandbox FileRootPath.

Edit:
Sorry for any aggravation. Do forget ProfileImagePath modification...
The following solution works best with least problems (for my case):

REM first Delete Contents of your Sandbox (from Sandboxie Control).

CMD /K "ECHO Elevated? Run as administrator"
SET "SbieRootPath=S:\Sandbox"
SET "USER=%USERNAME%"
SET "SANDBOX=DefaultBox"
SET "FileRootPath=%SbieRootPath%\%USER%\%SANDBOX%"
SET "drive=S"
START "" /WAIT "%ProgramFiles%\Sandboxie\Start.exe" /box:%SANDBOX% /wait CMD /C "RMDIR "%drive%:\Users"&PAUSE"
MKLINK /J "%FileRootPath%\drive\%drive%\Users\%USER%" "%FileRootPath%\user\current"

REM going further ... [execute on server]

NET SHARE Sandbox$ /DELETE
NET SHARE Sandbox$="%SbieRootPath%" /GRANT:"Everyone",FULL /CACHE:None

REM going too far ;-) [execute on client]

REM execute Elevated AND NOT Elevated
NET USE "\\__SERVER_PC__" /DELETE
NET USE /PERSISTENT:YES
NET USE "\\__SERVER_PC__" /SAVECRED

[DefaultBox]
FileRootPath=\\__SERVER_PC__\Sandbox$\BUCKAROO\__Sandbox__

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest