]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rados_sync: complain if import src is inaccessible
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 6 May 2011 23:01:02 +0000 (16:01 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 6 May 2011 23:01:02 +0000 (16:01 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/rados_sync.cc

index 02546c2d7d78956ce6791bd03ee879be60694f28..703e1394d9a396fb0bb003580ffe66988f0530f5 100644 (file)
@@ -834,6 +834,11 @@ int main(int argc, const char **argv)
   std::string dir_name = (action == "import") ? src : dst;
 
   if (action == "import") {
+    if (access(dir_name.c_str(), R_OK)) {
+       cerr << argv[0] << ": source directory '" << dst
+            << "' appears to be inaccessible." << std::endl;
+       exit(ENOENT);
+    }
     ret = xattr_test(dir_name.c_str());
     if (ret)
       return ret;
@@ -851,7 +856,7 @@ int main(int argc, const char **argv)
        }
       }
       else {
-       cerr << argv[0] << ": directory '" << dst << "' does not exist. Use "
+       cerr << argv[0] << ": directory '" << dst << "' is not accessible. Use "
             << "--create to try to create it.\n";
        exit(ENOENT);
       }