subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1547873 - /subversion/trunk/subversion/libsvn_subr/sqlite.c
Date Wed, 04 Dec 2013 18:38:05 GMT
Author: philip
Date: Wed Dec  4 18:38:04 2013
New Revision: 1547873

URL: http://svn.apache.org/r1547873
Log:
Another part of issue 3437, rep-cache.db created with wrong permissions.

* subversion/libsvn_subr/sqlite.c
  (svn_sqlite__hotcopy): Create file before calling into SQLite.

Modified:
    subversion/trunk/subversion/libsvn_subr/sqlite.c

Modified: subversion/trunk/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/sqlite.c?rev=1547873&r1=1547872&r2=1547873&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/trunk/subversion/libsvn_subr/sqlite.c Wed Dec  4 18:38:04 2013
@@ -1314,6 +1314,12 @@ svn_sqlite__hotcopy(const char *src_path
     svn_sqlite__db_t *dst_db;
     sqlite3_backup *backup;
     int rc1, rc2;
+    svn_node_kind_t kind;
+
+    /* Create empty file first to avoid SQLITE_DEFAULT_FILE_PERMISSIONS. */
+    SVN_ERR(svn_io_check_path(dst_path, &kind, scratch_pool));
+    if (kind == svn_node_none)
+      SVN_ERR(svn_io_file_create_empty(dst_path, scratch_pool));
 
     SVN_ERR(svn_sqlite__open(&dst_db, dst_path, svn_sqlite__mode_rwcreate,
                              NULL, 0, NULL, scratch_pool, scratch_pool));



Mime
View raw message