summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike McLaughlin <mikem@microsoft.com>2016-02-11 13:28:09 -0800
committerMike McLaughlin <mikem@microsoft.com>2016-02-12 11:21:24 -0800
commitc66f88cda89166d74b33522c13b2523302202d9d (patch)
treea03282898184ed3ace8f81e6b2caa30f68d75415
parent58a96714860f3acab33ddbb22f572bff0ea6ad4b (diff)
downloadcoreclr-c66f88cda89166d74b33522c13b2523302202d9d.tar.gz
coreclr-c66f88cda89166d74b33522c13b2523302202d9d.tar.bz2
coreclr-c66f88cda89166d74b33522c13b2523302202d9d.zip
Change the transport pipe and dbgshim runtime startup semaphores permissions to user only
Since the mechanism used to enumerate process modules (/proc/xxxx/maps on Linux, running vmvmap on OSX) is user only and the default group new users get on OSX is the same ("staff") restricting the transport pipes and runtime startup named semaphores to user only is the right way to go. If we find some reason to give groups permissions, we can always change that later though the process module enumeration would have to be figured out.
-rw-r--r--src/debug/debug-pal/unix/twowaypipe.cpp5
-rw-r--r--src/pal/src/thread/process.cpp4
2 files changed, 4 insertions, 5 deletions
diff --git a/src/debug/debug-pal/unix/twowaypipe.cpp b/src/debug/debug-pal/unix/twowaypipe.cpp
index b266ac14cc..f8f82be546 100644
--- a/src/debug/debug-pal/unix/twowaypipe.cpp
+++ b/src/debug/debug-pal/unix/twowaypipe.cpp
@@ -35,13 +35,12 @@ bool TwoWayPipe::CreateServer(DWORD id)
GetPipeName(inPipeName, id, "in");
GetPipeName(outPipeName, id, "out");
- //TODO: REVIEW if S_IRWXU | S_IRWXG is the right access level in prof use
- if (mkfifo(inPipeName, S_IRWXU | S_IRWXG) == -1)
+ if (mkfifo(inPipeName, S_IRWXU) == -1)
{
return false;
}
- if (mkfifo(outPipeName, S_IRWXU | S_IRWXG) == -1)
+ if (mkfifo(outPipeName, S_IRWXU) == -1)
{
remove(inPipeName);
return false;
diff --git a/src/pal/src/thread/process.cpp b/src/pal/src/thread/process.cpp
index 78480359f8..eb2e8d5b29 100644
--- a/src/pal/src/thread/process.cpp
+++ b/src/pal/src/thread/process.cpp
@@ -1475,7 +1475,7 @@ public:
// Create the continue semaphore first so we don't race with PAL_NotifyRuntimeStarted. This open will fail if another
// debugger is trying to attach to this process because the name will already exist.
- m_continueSem = sem_open(continueSemName, O_CREAT | O_EXCL | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO, 0);
+ m_continueSem = sem_open(continueSemName, O_CREAT | O_EXCL | O_RDWR, S_IRWXU, 0);
if (m_continueSem == SEM_FAILED)
{
TRACE("sem_open(continue) failed: errno is %d (%s)\n", errno, strerror(errno));
@@ -1485,7 +1485,7 @@ public:
// Create the debuggee startup semaphore so the runtime (debuggee) knows to wait for a debugger
// connection.
- m_startupSem = sem_open(startupSemName, O_CREAT | O_EXCL | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO, 0);
+ m_startupSem = sem_open(startupSemName, O_CREAT | O_EXCL | O_RDWR, S_IRWXU, 0);
if (m_startupSem == SEM_FAILED)
{
TRACE("sem_open(startup) failed: errno is %d (%s)\n", errno, strerror(errno));