Author: danielsh
Date: Sat May 7 14:19:43 2011
New Revision: 1100549
URL: http://svn.apache.org/viewvc?rev=1100549&view=rev
Log:
Add file:offset coordinates to an error message.
Note: the file's path may potentially disclose the repository's on-disk
path, or part of it.
* subversion/libsvn_fs_fs/fs_fs.c
(read_rep_line): When a non-self-DELTA header is corrupt, give
its offset in the revision file.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1100549&r1=1100548&r2=1100549&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Sat May 7 14:19:43 2011
@@ -2701,8 +2701,20 @@ read_rep_line(struct rep_args **rep_args
return SVN_NO_ERROR;
error:
- return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
- _("Malformed representation header"));
+ {
+ const char *path;
+ apr_off_t offset;
+
+ if (apr_file_name_get(&path, file) != APR_SUCCESS)
+ path = "(unknown)";
+
+ if (apr_file_seek(file, APR_CUR, &offset) != APR_SUCCESS)
+ offset = -1;
+
+ return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+ _("Malformed representation header at %s:%s"),
+ path, apr_psprintf(pool, "%" APR_OFF_T_FMT,
offset));
+ }
}
/* Given a revision file REV_FILE, opened to REV in FS, find the Node-ID