Bug#490570: Create CASA directory under
c:/Progra~1/Novell/CASA/Profiles/<userSID>/ for users who don't have home directory defined in the system registry and grant rights to only the system user and the CASA client user over the CASA directory.
This commit is contained in:
parent
d4c128e677
commit
21ba1ead80
11
CASA/micasad/cache/SecretStore.cs
vendored
11
CASA/micasad/cache/SecretStore.cs
vendored
@ -1041,7 +1041,18 @@ namespace sscs.cache
|
|||||||
|
|
||||||
if (!Directory.Exists(sNewPath))
|
if (!Directory.Exists(sNewPath))
|
||||||
{
|
{
|
||||||
|
string sSIDString;
|
||||||
|
string secDesc;
|
||||||
|
|
||||||
Directory.CreateDirectory(sNewPath);
|
Directory.CreateDirectory(sNewPath);
|
||||||
|
|
||||||
|
/* Give permissions to the user and system account */
|
||||||
|
sSIDString = ((WinUserIdentifier)user.UserIdentifier).GetSID();
|
||||||
|
System.Security.AccessControl.DirectorySecurity dirSec = Directory.GetAccessControl(sNewPath);
|
||||||
|
secDesc = "D:P(A;ID;GA;;;SY)(A;ID;GA;;;" + sSIDString + ")";
|
||||||
|
System.Diagnostics.Trace.WriteLine("Setting security descriptor" + secDesc);
|
||||||
|
dirSec.SetSecurityDescriptorSddlForm(secDesc);
|
||||||
|
Directory.SetAccessControl(sNewPath, dirSec);
|
||||||
}
|
}
|
||||||
|
|
||||||
sSeperator = "\\";
|
sSeperator = "\\";
|
||||||
|
@ -81,9 +81,22 @@ namespace sscs.common
|
|||||||
CSSSLogger.DbgLog("Reading Reg: SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\" + sSIDString);
|
CSSSLogger.DbgLog("Reading Reg: SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\" + sSIDString);
|
||||||
string sProfile = ReadRegKey(Registry.LocalMachine, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\" + sSIDString, "ProfileImagePath");
|
string sProfile = ReadRegKey(Registry.LocalMachine, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\" + sSIDString, "ProfileImagePath");
|
||||||
|
|
||||||
if (sProfile == null)
|
if (sProfile == null) {
|
||||||
CSSSLogger.DbgLog("WinUser:GetUserHomeDir get Profile return null");
|
CSSSLogger.DbgLog("WinUser:GetUserHomeDir get Profile return null");
|
||||||
else
|
if (sSIDString.Equals("S-1-5-18")) {
|
||||||
|
// Bug#490570
|
||||||
|
string programFiles;
|
||||||
|
programFiles = ReadRegKey(Registry.LocalMachine, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir");
|
||||||
|
if (programFiles == null) {
|
||||||
|
programFiles = ReadRegKey(Registry.LocalMachine, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "ProgramFiles");
|
||||||
|
}
|
||||||
|
if (programFiles == null) {
|
||||||
|
CSSSLogger.DbgLog("WinUser:GetUserHomeDir unable to read program files path");
|
||||||
|
} else {
|
||||||
|
m_sUserHome = programFiles + "\\Novell\\CASA\\profiles\\S-1-5-18";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
m_sUserHome = sProfile;
|
m_sUserHome = sProfile;
|
||||||
|
|
||||||
//string sHomeDrive = ReadRegKey(Registry.Users, sSIDString+"\\Volatile Environment", "HOMEDRIVE");
|
//string sHomeDrive = ReadRegKey(Registry.Users, sSIDString+"\\Volatile Environment", "HOMEDRIVE");
|
||||||
|
Loading…
Reference in New Issue
Block a user