Import/Export changes
This commit is contained in:
		| @@ -221,11 +221,11 @@ namespace sscs.verbs | |||||||
| 					} | 					} | ||||||
| 					case MiCasaRequestReply.VERB_EXPORT_SECRETS: | 					case MiCasaRequestReply.VERB_EXPORT_SECRETS: | ||||||
| 					{ | 					{ | ||||||
| 						return DoExportSecrets(ssStore, wo); | 						return DoExportSecrets(ssStore, wo, userId); | ||||||
| 					} | 					} | ||||||
| 					case MiCasaRequestReply.VERB_ADD_XML_SECRETS: | 					case MiCasaRequestReply.VERB_ADD_XML_SECRETS: | ||||||
| 					{ | 					{ | ||||||
| 						return DoMergeXMLSecrets(ssStore, wo); | 						return DoMergeXMLSecrets(ssStore, wo, UserIdentifier userId); | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
| 					default: | 					default: | ||||||
| @@ -300,7 +300,7 @@ namespace sscs.verbs | |||||||
| 			return wo; | 			return wo; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		private WrappedObject DoExportSecrets(SecretStore ssStore, WrappedObject wo) | 		private WrappedObject DoExportSecrets(SecretStore ssStore, WrappedObject wo, UserIdentifier userId) | ||||||
| 		{ | 		{ | ||||||
| 			ExportXMLSecrets secrets = (ExportXMLSecrets)wo.GetObject(); | 			ExportXMLSecrets secrets = (ExportXMLSecrets)wo.GetObject(); | ||||||
|  |  | ||||||
| @@ -328,6 +328,12 @@ namespace sscs.verbs | |||||||
| 				fs.Write(baSecrets, 0, baSecrets.Length); | 				fs.Write(baSecrets, 0, baSecrets.Length); | ||||||
| 				fs.Flush(); | 				fs.Flush(); | ||||||
| 				fs.Close(); | 				fs.Close(); | ||||||
|  |  | ||||||
|  | #if LINUX | ||||||
|  | 				// change file ownership to the user  | ||||||
|  | 				Mono.Unix.Native.Syscall.chown(sFilePath, userId.GetUID(), userId.GetUID());				 | ||||||
|  | #endif | ||||||
|  |  | ||||||
| 			} | 			} | ||||||
| 			else | 			else | ||||||
| 			{ | 			{ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user