Import/Export changes

This commit is contained in:
Jim Norman 2006-08-22 17:19:50 +00:00
parent 3e07033d1c
commit ba603b256f

View File

@ -221,11 +221,11 @@ namespace sscs.verbs
}
case MiCasaRequestReply.VERB_EXPORT_SECRETS:
{
return DoExportSecrets(ssStore, wo);
return DoExportSecrets(ssStore, wo, userId);
}
case MiCasaRequestReply.VERB_ADD_XML_SECRETS:
{
return DoMergeXMLSecrets(ssStore, wo);
return DoMergeXMLSecrets(ssStore, wo, UserIdentifier userId);
}
default:
@ -262,7 +262,7 @@ namespace sscs.verbs
int iBytes = fs.Read(baXMLSecrets, 0, (int)fs.Length);
fs.Flush();
fs.Close();
fs.Close();
}
}
catch (Exception e)
@ -300,7 +300,7 @@ namespace sscs.verbs
return wo;
}
private WrappedObject DoExportSecrets(SecretStore ssStore, WrappedObject wo)
private WrappedObject DoExportSecrets(SecretStore ssStore, WrappedObject wo, UserIdentifier userId)
{
ExportXMLSecrets secrets = (ExportXMLSecrets)wo.GetObject();
@ -328,6 +328,12 @@ namespace sscs.verbs
fs.Write(baSecrets, 0, baSecrets.Length);
fs.Flush();
fs.Close();
#if LINUX
// change file ownership to the user
Mono.Unix.Native.Syscall.chown(sFilePath, userId.GetUID(), userId.GetUID());
#endif
}
else
{