Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect check for sandbox name validity [bug] #649

Closed
typpos opened this issue Mar 7, 2021 · 1 comment
Closed

Incorrect check for sandbox name validity [bug] #649

typpos opened this issue Mar 7, 2021 · 1 comment
Labels
fixed in next build Fixed in the next Sandboxie version

Comments

@typpos
Copy link
Contributor

typpos commented Mar 7, 2021

Sandboxie Classic 5.49.0

New validity check tests for matching start of string instead of whole string when checking sandbox names against special device names.

Example: Unable to create sandbox "consort" because it starts with "con".

Related suggestions & bugs:

  • Would be good if all components would use the same shared code, say, a common function "IsValidBoxName()", for these tests (Classic, Plus, Driver, etc etc)
  • "clock$" need not be tested as "$" is an invalid char
  • Potentially similar issue in project "Start" > delete.cpp > ProcessFiles line 820
  • Disallow "GlobalSettings" as a sandbox name, or create an appropriate fix as the headings in .ini overlap
  • Disallow "UserSettings_xxx" for same reason

Line 191:

if (!errmsg && len <= 8) {
static const WCHAR* deviceNames[] = {
L"aux", L"clock$", L"con", L"nul", L"prn",
L"com1", L"com2", L"com3", L"com4", L"com5",
L"com6", L"com7", L"com8", L"com9",
L"lpt1", L"lpt2", L"lpt3", L"lpt4", L"lpt5",
L"lpt6", L"lpt7", L"lpt8", L"lpt9",
NULL
};
for (ULONG devNum = 0; deviceNames[devNum]; ++devNum) {
const WCHAR* devName = deviceNames[devNum];
ULONG devNameLen = wcslen(devName);
if (_wcsnicmp(name, devName, devNameLen) == 0) {
errmsg = MSG_3667;
break;
}
}

@DavidXanatos
Copy link
Member

I have fixed the issue with the device names.

@DavidXanatos DavidXanatos added the fixed in next build Fixed in the next Sandboxie version label Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next build Fixed in the next Sandboxie version
Projects
None yet
Development

No branches or pull requests

2 participants