From 2a063797fe4d688528459f32aeca8a88cb8818e1 Mon Sep 17 00:00:00 2001 From: Rajasekaran Nagarajan Date: Mon, 12 Mar 2007 12:11:39 +0000 Subject: [PATCH] - 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 --- CASA/micasacache/sscs_ipc.c | 2 +- CASA/micasad/communication/UnixCommunication.cs | 4 ++-- CASA/micasad/lib/communication/UnixIPCClientChannel.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CASA/micasacache/sscs_ipc.c b/CASA/micasacache/sscs_ipc.c index c8947679..632dece2 100644 --- a/CASA/micasacache/sscs_ipc.c +++ b/CASA/micasacache/sscs_ipc.c @@ -52,7 +52,7 @@ void* ipc_unx_create() memset(&servAddr,0,sizeof(servAddr)); 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)); if(retVal < 0 ) { diff --git a/CASA/micasad/communication/UnixCommunication.cs b/CASA/micasad/communication/UnixCommunication.cs index 9980c578..7395cf2a 100644 --- a/CASA/micasad/communication/UnixCommunication.cs +++ b/CASA/micasad/communication/UnixCommunication.cs @@ -43,7 +43,7 @@ namespace sscs.communication { private Socket listeningSocket; private Socket connectedSocket; - private string socketFileName = "/tmp/.novellCASA"; + private string socketFileName = "/var/run/.novellCASA"; private Mono.Unix.UnixEndPoint sockEndPoint; private ManualResetEvent eventVar = null; @@ -82,7 +82,7 @@ namespace sscs.communication UnixFileSystemInfo sockFileInfo = new UnixFileInfo(socketFileName); 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) { File.Delete(socketFileName); diff --git a/CASA/micasad/lib/communication/UnixIPCClientChannel.cs b/CASA/micasad/lib/communication/UnixIPCClientChannel.cs index 2549f5cf..faac470f 100644 --- a/CASA/micasad/lib/communication/UnixIPCClientChannel.cs +++ b/CASA/micasad/lib/communication/UnixIPCClientChannel.cs @@ -37,7 +37,7 @@ namespace Novell.CASA.MiCasa.Communication { private Socket mSocket = null; - private string socketFileName = "/tmp/.novellCASA"; + private string socketFileName = "/var/run/.novellCASA"; private EndPoint sockEndPoint; public UnixIPCClientChannel() @@ -57,7 +57,7 @@ namespace Novell.CASA.MiCasa.Communication } 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) { sockEndPoint = new UnixEndPoint(socketFileName);