diff --git a/CASA/CASA.changes b/CASA/CASA.changes index 375484cd..94093dbd 100644 --- a/CASA/CASA.changes +++ b/CASA/CASA.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 27 15:10:47 MDT 2006 - jnorman@novell.com + +- Prevent users from moving .miCASA files to directories other + /home/... and /media... + ------------------------------------------------------------------- Wed Sep 27 11:57:09 MDT 2006 - jnorman@novell.com diff --git a/CASA/gui/CasaMain.cs b/CASA/gui/CasaMain.cs index e73cfcbd..4fbc4368 100644 --- a/CASA/gui/CasaMain.cs +++ b/CASA/gui/CasaMain.cs @@ -2189,7 +2189,29 @@ namespace Novell.CASA.GUI { if (Directory.Exists(sDirectory)) { - entryStorageDirectory.Text = sDirectory; + // make sure user as rights to read and write to this directory + try + { +#if LINUX + int rcode = Mono.Unix.Native.Syscall.access(sDirectory, + Mono.Unix.Native.AccessModes.R_OK | + Mono.Unix.Native.AccessModes.W_OK ); + + if (rcode == 0) + { + entryStorageDirectory.Text = sDirectory; + } + else + { + CommonGUI.DisplayMessage(Gtk.MessageType.Error, "Moving files to\r\n" + sDirectory + "\r\nis not allowed"); + } + } + catch (Exception e) + { + CommonGUI.DisplayMessage(Gtk.MessageType.Error, "Not allowed\r\n" + sDirectory); + } +#endif + } else { diff --git a/CASA/gui/FileChooser.cs b/CASA/gui/FileChooser.cs index aedf729b..334900c5 100644 --- a/CASA/gui/FileChooser.cs +++ b/CASA/gui/FileChooser.cs @@ -81,6 +81,8 @@ namespace Novell.CASA.GUI //if (m_currentDirectory.EndsWith(m_pathSeparator)) // m_currentDirectory = m_currentDirectory.Substring(0, m_currentDirectory.Length - 1); + SetNewFolderButton(); + DisplayDirectory(); } @@ -204,12 +206,22 @@ namespace Novell.CASA.GUI } +#if LINUX + tsDrives.AppendValues("/home"); + tsDrives.AppendValues("/media"); + +#else // show logical drives string[] drives = Directory.GetLogicalDrives(); for (int i=0; i