- Bug 242398. Fix to prevent the creation of micasad socket file by the

users other than root. This fix moves the socket file from
/tmp/.novellCASA to /var/run/.novellCASA
This commit is contained in:
Rajasekaran Nagarajan 2007-03-12 12:11:39 +00:00
parent 9f2f0ff262
commit 2a063797fe
3 changed files with 5 additions and 5 deletions

View File

@ -52,7 +52,7 @@ void* ipc_unx_create()
memset(&servAddr,0,sizeof(servAddr)); memset(&servAddr,0,sizeof(servAddr));
servAddr.sun_family = AF_UNIX; servAddr.sun_family = AF_UNIX;
strcpy(servAddr.sun_path,"/tmp/.novellCASA"); strcpy(servAddr.sun_path,"/var/run/.novellCASA");
retVal = connect(sockFd,(struct sockaddr*)&servAddr, sizeof(servAddr)); retVal = connect(sockFd,(struct sockaddr*)&servAddr, sizeof(servAddr));
if(retVal < 0 ) if(retVal < 0 )
{ {

View File

@ -43,7 +43,7 @@ namespace sscs.communication
{ {
private Socket listeningSocket; private Socket listeningSocket;
private Socket connectedSocket; private Socket connectedSocket;
private string socketFileName = "/tmp/.novellCASA"; private string socketFileName = "/var/run/.novellCASA";
private Mono.Unix.UnixEndPoint sockEndPoint; private Mono.Unix.UnixEndPoint sockEndPoint;
private ManualResetEvent eventVar = null; private ManualResetEvent eventVar = null;
@ -82,7 +82,7 @@ namespace sscs.communication
UnixFileSystemInfo sockFileInfo = new UnixFileInfo(socketFileName); UnixFileSystemInfo sockFileInfo = new UnixFileInfo(socketFileName);
UnixUserInfo sockFileOwner = sockFileInfo.OwnerUser; UnixUserInfo sockFileOwner = sockFileInfo.OwnerUser;
// check if ROOT is the owner of the file: /tmp/.novellCASA // check if ROOT is the owner of the file: /var/run/.novellCASA
if (sockFileOwner.UserId != 0) if (sockFileOwner.UserId != 0)
{ {
File.Delete(socketFileName); File.Delete(socketFileName);

View File

@ -37,7 +37,7 @@ namespace Novell.CASA.MiCasa.Communication
{ {
private Socket mSocket = null; private Socket mSocket = null;
private string socketFileName = "/tmp/.novellCASA"; private string socketFileName = "/var/run/.novellCASA";
private EndPoint sockEndPoint; private EndPoint sockEndPoint;
public UnixIPCClientChannel() public UnixIPCClientChannel()
@ -57,7 +57,7 @@ namespace Novell.CASA.MiCasa.Communication
} }
Syscall.lstat(socketFileName, out socketFileStatus); Syscall.lstat(socketFileName, out socketFileStatus);
// root is the owner of the file "/tmp/.novellCASA" // root is the owner of the file "/var/run/.novellCASA"
if (socketFileStatus.st_uid == 0) if (socketFileStatus.st_uid == 0)
{ {
sockEndPoint = new UnixEndPoint(socketFileName); sockEndPoint = new UnixEndPoint(socketFileName);