SRB bug fix:

The .miCASA files would have rw only for the user.
This commit is contained in:
Poorna Pushkala 2005-10-17 12:48:30 +00:00
parent 8ed7a09320
commit 68f3349396

View File

@ -44,6 +44,9 @@ namespace sscs.crypto
//Encrypt the data to a file //Encrypt the data to a file
FileStream fsEncrypt = new FileStream(fileName, FileMode.Create); FileStream fsEncrypt = new FileStream(fileName, FileMode.Create);
#if LINUX
Mono.Unix.Syscall.chmod(fileName,Mono.Unix.FilePermissions.S_IRUSR | Mono.Unix.FilePermissions.S_IWUSR);
#endif
SHA256 sha = new SHA256Managed(); SHA256 sha = new SHA256Managed();
byte[] hash = sha.ComputeHash(key); byte[] hash = sha.ComputeHash(key);
@ -135,6 +138,9 @@ namespace sscs.crypto
//Encrypt the data to a file //Encrypt the data to a file
FileStream fsEncrypt = new FileStream(fileName, FileMode.Create); FileStream fsEncrypt = new FileStream(fileName, FileMode.Create);
#if LINUX
Mono.Unix.Syscall.chmod(fileName,Mono.Unix.FilePermissions.S_IRUSR | Mono.Unix.FilePermissions.S_IWUSR);
#endif
SHA256 sha = new SHA256Managed(); SHA256 sha = new SHA256Managed();
byte[] hash = sha.ComputeHash(xmlData); byte[] hash = sha.ComputeHash(xmlData);
@ -325,6 +331,9 @@ namespace sscs.crypto
//Encrypt the data to a file //Encrypt the data to a file
FileStream fsEncrypt = new FileStream(fileName,FileMode.Create); FileStream fsEncrypt = new FileStream(fileName,FileMode.Create);
#if LINUX
Mono.Unix.Syscall.chmod(fileName,Mono.Unix.FilePermissions.S_IRUSR | Mono.Unix.FilePermissions.S_IWUSR);
#endif
CryptoStream csEncrypt = new CryptoStream(fsEncrypt, encryptor, CryptoStream csEncrypt = new CryptoStream(fsEncrypt, encryptor,
CryptoStreamMode.Write); CryptoStreamMode.Write);