Bug when opening a database file in a deep directory

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug when opening a database file in a deep directory

Dan Billings
To reproduce:
1) create a directory structure that produces a long path.
2) attempt to open a DB file.
3) observe error :Error: unable to open database "X.db": unable to open
database file
4) mv file to home dir
5) attempt to open
6) observe it opens as expected

This has been tested in an environment controlled for permissions.

Tested on:
Ubuntu Linux 17.10

Not tested on Mac/Windows/other distros

Sqlite3 --version
3.19.3 2017-06-08 14:26:16
0ee482a1e0eae22e08edc8978c9733a96603d4509645f348ebf55b579e89636b
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Bug when opening a database file in a deep directory

Richard Hipp-3
On 4/4/18, Dan Billings <[hidden email]> wrote:
> To reproduce:
> 1) create a directory structure that produces a long path.

Why are you creating pathnames longer than 512 bytes?  Seems like
there will be usability issues there?


> 2) attempt to open a DB file.
> 3) observe error :Error: unable to open database "X.db": unable to open
> database file
> 4) mv file to home dir
> 5) attempt to open
> 6) observe it opens as expected
>
> This has been tested in an environment controlled for permissions.
>
> Tested on:
> Ubuntu Linux 17.10
>
> Not tested on Mac/Windows/other distros
>
> Sqlite3 --version
> 3.19.3 2017-06-08 14:26:16
> 0ee482a1e0eae22e08edc8978c9733a96603d4509645f348ebf55b579e89636b
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Bug when opening a database file in a deep directory

Warren Young
In reply to this post by Dan Billings
On Apr 4, 2018, at 9:17 AM, Dan Billings <[hidden email]> wrote:
>
> 1) create a directory structure that produces a long path.

If it’s longer than PATH_MAX on your system, then you’re exceeding your OS’s ability here, not a limit in SQLite.  Using such paths is likely to cause problems with other applications as well.

POSIX only requires that an OS support 256 character paths, which includes the trailing null.  See:

   http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users