Make sure users has rights to directory on export.

This commit is contained in:
Jim Norman 2006-10-02 21:57:55 +00:00
parent fd8d57708d
commit 2631525040

View File

@ -92,7 +92,21 @@ namespace Novell.CASA.GUI
string sFileName = GetStorageFileName(sHintDir, sHintFile); string sFileName = GetStorageFileName(sHintDir, sHintFile);
if (sFileName != null) if (sFileName != null)
{ {
#if LINUX
// make sure user has 'Write' rights to this directory
string sDir = sFileName.Substring(0, sFileName.LastIndexOf("/"));
int rcode = Mono.Unix.Native.Syscall.access(sDir,
Mono.Unix.Native.AccessModes.R_OK |
Mono.Unix.Native.AccessModes.W_OK );
if (rcode != 0)
{
CommonGUI.DisplayMessage(Gtk.MessageType.Error, "You do not have rights to export your files here.\r\n"+sDir);
return;
}
#endif
//Store off this location for next export //Store off this location for next export
int iLastSlash = sFileName.LastIndexOf("/"); int iLastSlash = sFileName.LastIndexOf("/");