]> git.p6c8.net - devedit.git/blobdiff - devedit.pl
- Check if we have enough permissions to write in directory at the following
[devedit.git] / devedit.pl
index aa7a3caf61e965a8dc82de2f89c578961296bd59..3ec92dfb17df1fd48f385a294187958e3139894a 100644 (file)
@@ -6,7 +6,7 @@
 # Dev-Editor's main program
 #
 # Author:        Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2004-11-13
+# Last modified: 2004-11-26
 #
 
 use strict;
@@ -82,6 +82,14 @@ if($newfile ne '' && $newfile !~ /^\s+$/)
   abort($config->{'errors'}->{'create_ar'},"/");
  }
 
+ # Check if we have enough permissions to create a file
+ # in this directory
+
+ unless(-r $new_physical && -w $new_physical && -x $new_physical)
+ {
+  abort($config->{'errors'}->{'dir_no_create'},"/",{DIR => $new_virtual});
+ }
+
  # Create the physical and the virtual path
 
  $new_physical = File::Spec->canonpath($new_physical."/".$file);

patrick-canterino.de