diff --git a/CASA/gui/ExportSecrets.cs b/CASA/gui/ExportSecrets.cs index 889e6310..77462ae5 100644 --- a/CASA/gui/ExportSecrets.cs +++ b/CASA/gui/ExportSecrets.cs @@ -92,7 +92,21 @@ namespace Novell.CASA.GUI string sFileName = GetStorageFileName(sHintDir, sHintFile); 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 int iLastSlash = sFileName.LastIndexOf("/");