Index: trunk/Nebulous-Server/lib/Nebulous/Server.pm
===================================================================
--- trunk/Nebulous-Server/lib/Nebulous/Server.pm	(revision 18457)
+++ trunk/Nebulous-Server/lib/Nebulous/Server.pm	(revision 19036)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004-2008  Joshua Hoblitt
 #
-# $Id: Server.pm,v 1.81 2008-07-10 02:40:33 jhoblitt Exp $
+# $Id: Server.pm,v 1.82 2008-08-12 23:53:40 jhoblitt Exp $
 
 package Nebulous::Server;
@@ -1342,4 +1342,12 @@
                 or die "can't create storage path: $storage_path";
         }
+        # check to make sure at least the parent directory has the proper
+        # permissions
+        my $mode = (stat($storage_path))[2] & 07777;
+        unless ($mode == 0775) {
+            $log->error("$storage_path has the wrong permissions of: %04o", $mode);
+            chmod(0775, $storage_path) or die "can't chmod $storage_path: $!";
+        }
+
         my $fqpn = File::Spec->catfile($storage_path, $storage_filename);
         $uri = URI::file->new($fqpn);
