php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31573 sqlite_open create database file umask incorrect
Submitted: 2005-01-16 17:28 UTC Modified: 2005-01-16 18:20 UTC
From: hunreal+php dot bug dot report at gmail dot com Assigned:
Status: Not a bug Package: SQLite related
PHP Version: 5.0.3 OS: FreeBSD 4.11/5.3
Private report: No CVE-ID: None
 [2005-01-16 17:28 UTC] hunreal+php dot bug dot report at gmail dot com
Description:
------------
The database file created by 0644 permission and not user setted.
And my php was not running in safe-more

Reproduce code:
---------------
<?
$db=sqlite_open('db', 0666, $error);
?>
<?
$db=sqlite_open('db');
?>

Expected result:
----------------
-rw-r--r--   1 root  wheel          0 Jan 17 00:15 db



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-16 17:58 UTC] wez@php.net
From http://www.php.net/sqlite_open

"
The mode parameter specifies the mode of the file and is intended to be used to open the database in read-only mode. Presently, this parameter is ignored by the sqlite library. The default value for mode is the octal value 0666 and this is the recommended value to use if you need access to the errmessage parameter.
"

If you need to set the umask, set the umask.
http://www.php.net/umask

 [2005-01-16 18:06 UTC] hunreal+php dot bug dot report at gmail dot com
umask(0000);
$db=sqlite_open('db');

problem is the same
-rw-r--r--   1 root  wheel          0 Jan 17 01:05 db
 [2005-01-16 18:20 UTC] wez@php.net
Consult the sqlite library developers if you feel this should be changed.
Not a PHP bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC