subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1547866 - /subversion/trunk/subversion/libsvn_fs_fs/rep-cache.c
Date Wed, 04 Dec 2013 18:16:40 GMT
Author: philip
Date: Wed Dec  4 18:16:40 2013
New Revision: 1547866

URL: http://svn.apache.org/r1547866
Log:
Fix issue 3437, rep-cache.db created with wrong permissions.

* subversion/libsvn_fs_fs/rep-cache.c
  (open_rep_cache): Create file before calling into SQLite.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/rep-cache.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/rep-cache.c?rev=1547866&r1=1547865&r2=1547866&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/rep-cache.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/rep-cache.c Wed Dec  4 18:16:40 2013
@@ -79,10 +79,16 @@ open_rep_cache(void *baton,
   svn_sqlite__db_t *sdb;
   const char *db_path;
   int version;
+  svn_boolean_t exists;
+
+  SVN_ERR(svn_fs_fs__exists_rep_cache(&exists, fs, pool));
 
   /* Open (or create) the sqlite database.  It will be automatically
-     closed when fs->pool is destoyed. */
+     closed when fs->pool is destoyed.  We create the empty file first
+     to avoid SQLITE_DEFAULT_FILE_PERMISSIONS. */
   db_path = path_rep_cache_db(fs->path, pool);
+  if (!exists)
+    SVN_ERR(svn_io_file_create_empty(db_path, pool));
   SVN_ERR(svn_sqlite__open(&sdb, db_path,
                            svn_sqlite__mode_rwcreate, statements,
                            0, NULL,



Mime
View raw message