subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1072692 - /subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
Date Sun, 20 Feb 2011 19:32:36 GMT
Author: ivan
Date: Sun Feb 20 19:32:36 2011
New Revision: 1072692

URL: http://svn.apache.org/viewvc?rev=1072692&view=rev
Log:
Fix issue 3206 for ra_local.

* subversion/libsvn_ra_local/ra_plugin.c
  (svn_ra_local__get_file): Check that provided path refers to file.

Modified:
    subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c

Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c?rev=1072692&r1=1072691&r2=1072692&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c Sun Feb 20 19:32:36 2011
@@ -1018,6 +1018,7 @@ svn_ra_local__get_file(svn_ra_session_t 
   svn_revnum_t youngest_rev;
   svn_ra_local__session_baton_t *sess = session->priv;
   const char *abs_path = svn_fspath__join(sess->fs_path->data, path, pool);
+  svn_node_kind_t node_kind;
 
   /* Open the revision's root. */
   if (! SVN_IS_VALID_REVNUM(revision))
@@ -1030,6 +1031,18 @@ svn_ra_local__get_file(svn_ra_session_t 
   else
     SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, pool));
 
+  SVN_ERR(svn_fs_check_path(&node_kind, root, abs_path, pool));
+  if (node_kind == svn_node_none)
+    {
+      return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
+                               _("'%s' path not found"), abs_path);
+    }
+  else if (node_kind != svn_node_file)
+    {
+      return svn_error_createf(SVN_ERR_FS_NOT_FILE, NULL,
+                               _("'%s' is not a file"), abs_path);
+    }
+
   if (stream)
     {
       /* Get a stream representing the file's contents. */



Mime
View raw message