If the xAccess() call used by "PRAGMA temp_store_directory = /new/path/" to determine if the supplied directory is writable returns an error, assume the directory is not writable. (CVS 5707)

FossilOrigin-Name: e8418588f2c23487cefda702849d4546202fd8ec
This commit is contained in:
danielk1977
2008-09-16 14:38:02 +00:00
parent 7eae4f52ee
commit fab1127bd1
4 changed files with 26 additions and 12 deletions
+7 -7
View File
@@ -1,5 +1,5 @@
C Modify\sthe\ssqlite3VdbeMemCompare()\sroutine\sso\sthat\sit\sdoes\snot\smodify\sany\sMem.z\svalues.\sTicket\s#3376.\s(CVS\s5706)
D 2008-09-16T12:06:08
C If\sthe\sxAccess()\scall\sused\sby\s"PRAGMA\stemp_store_directory\s=\s/new/path/"\sto\sdetermine\sif\sthe\ssupplied\sdirectory\sis\swritable\sreturns\san\serror,\sassume\sthe\sdirectory\sis\snot\swritable.\s(CVS\s5707)
D 2008-09-16T14:38:03
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in d15a7ebfe5e057a72a49805ffb302dbb601c8329
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -142,7 +142,7 @@ F src/pager.h c45380ca9d0933ea5bc4ecb3a43958b6d2ec5a9c
F src/parse.y d0f76d2cb8d6883d5600dc20beb961a6022b94b8
F src/pcache.c d3c0f4ad708929fba15886914b18b82d64e286bf
F src/pcache.h 53730c33310cdf7a5c94e8333c853d59a3b30226
F src/pragma.c 9d00ed41b261968757c02707e1508a707f2d46a7
F src/pragma.c e633b6b7dabc110e2abfed4e35ba34a4039cb65c
F src/prepare.c c7e00ed1b0bdcf699b1aad651247d4dc3d281b0b
F src/printf.c 785f87120589c1db672e37c6eb1087c456e6f84d
F src/random.c 11bbdf7def3746a762fbdb56c9d04648135ad6d8
@@ -380,7 +380,7 @@ F test/interrupt.test 42e7cf98646fd9cb4a3b131a93ed3c50b9e149f1
F test/intpkey.test 537669fd535f62632ca64828e435b9e54e8d677f
F test/io.test 92cedb5eff70064f9fcf4ec51e86591b1f0ad130
F test/ioerr.test b42f249c9181b5864e53fdae38ef75475d71c66f
F test/ioerr2.test 988bda4d8d6fa1593765a514bf7a24adb3240da9
F test/ioerr2.test a8428580ce12ce67a6f16d85e2640fa6ce2da888
F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd
F test/ioerr4.test fc6eddfec2efc2f1ed217b9eae4c1c1d3516ce86
F test/ioerr5.test 89f69b09a6b5d4f5bbfe58d4231f28236d842dcb
@@ -636,7 +636,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P c64260579d353df3eae8c355b082b8206bc6185b
R 7535949cc5ece243cee76f2451e698a1
P 2d4505510032bf903a9c5d582edda442a0592c77
R 2996f0a258d4d9a1b26c7a1bf3e80edf
U danielk1977
Z f8c645f05684cc478b17c2db72cd6df0
Z d865bbdb4adfc742b05c90684125e5c6
+1 -1
View File
@@ -1 +1 @@
2d4505510032bf903a9c5d582edda442a0592c77
e8418588f2c23487cefda702849d4546202fd8ec
+4 -3
View File
@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the PRAGMA command.
**
** $Id: pragma.c,v 1.186 2008/09/02 15:44:09 danielk1977 Exp $
** $Id: pragma.c,v 1.187 2008/09/16 14:38:03 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -668,9 +668,10 @@ void sqlite3Pragma(
}else{
#ifndef SQLITE_OMIT_WSD
if( zRight[0] ){
int rc;
int res;
sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res);
if( res==0 ){
rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res);
if( rc!=SQLITE_OK || res==0 ){
sqlite3ErrorMsg(pParse, "not a writable directory");
goto pragma_out;
}
+14 -1
View File
@@ -15,7 +15,7 @@
# The tests in this file use special facilities that are only
# available in the SQLite test fixture.
#
# $Id: ioerr2.test,v 1.9 2008/08/20 14:49:25 danielk1977 Exp $
# $Id: ioerr2.test,v 1.10 2008/09/16 14:38:04 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -132,4 +132,17 @@ do_test ioerr2-5 {
list $rc $msg
} {1 {callback requested query abort}}
if {$::tcl_platform(platform) == "unix"} {
# Cause the call to xAccess used by [pragma temp_store_directory] to
# determine if the specified directory is writable to fail. This causes
# SQLite to report "not a writable directory", which is probably the
# right answer.
#
do_test ioerr2-6 {
set ::sqlite_io_error_hit 0
set ::sqlite_io_error_pending 1
catchsql {PRAGMA temp_store_directory = '/tmp/'}
} {1 {not a writable directory}}
}
finish_test