Re: [sqlite] Make a database read-only?

2014-10-15 Thread James K. Lowden
On Tue, 14 Oct 2014 18:21:27 -0400 Ross Altman wrote: > Yeah, that's actually a really good point. Oh well, I guess I'll just > have to hope that people decide to use the database responsibly... > haha You can advertise your database with the tagline, "Please compute

Re: [sqlite] Make a database read-only?

2014-10-15 Thread Stephen Chrzanowski
I've got three options, two of which require an internet connection, one part time, the other full time. The third option has the constraint on the size of the data in question. - Have your preference of a resultant hash check in a plain text file sitting somewhere on your web server. The

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Ross Altman
Dear Ross, > > From: Ross Altman <altman...@husky.neu.edu> > Sent: Tue, 14 Oct 2014 14:38:41 -0400 > To: General Discussion of SQLite Database <sqlite-users@sqlite.org> > Subject: Re: [sqlite] Make a database read-only? > > > >> Thanks everyone for the helpful

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Jungle Boogie
Dear Ross, From: Ross Altman <altman...@husky.neu.edu> Sent: Tue, 14 Oct 2014 14:38:41 -0400 To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Subject: Re: [sqlite] Make a database read-only? > Thanks everyone

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Igor Tandetnik
On 10/14/2014 2:38 PM, Ross Altman wrote: I don't mind if there are multiple COPIES, but I want to make sure that they're all the same. Well, you can't, really. If nothing else, whoever has read access to the database can read all the data out, then create a new database of their own,

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Ross Altman
Thanks everyone for the helpful answers. Here's some context: The database I have is for academic purposes. Research groups will need to be able to download it in order to do large-scale scans using it as input, so putting it in a wrapper (in PHP, say) isn't useful. But, I don't want someone else

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Igor Tandetnik
On 10/14/2014 10:12 AM, John Hascall wrote: Some code you may find useful to enforce the readonly byte Of course, anyone smart enough to change the byte from read-only to read-write before making changes, would also be smart enough to set it back afterwards. -- Igor Tandetnik

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Andrea Peri
Against legal. The best approach is to calculate the MD5 of the file If the file chance, the MD5 change Aldo. Il 14/ott/2014 15:37 "RSmith" ha scritto: > > On 2014/10/14 13:48, Ross Altman wrote: > >> Hi Martin, >> >> Thank you, I'll definitely look into that. It's

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Igor Tandetnik
On 10/14/2014 2:19 AM, Ross Altman wrote: I need to host a fixed, unchanging database online, and I want to make sure that anyone who downloads it cannot add to it. Is there any way to set the permissions to be read-only within sqlite? Why do you care what a person does with a file on their

Re: [sqlite] Make a database read-only?

2014-10-14 Thread John Hascall
Well some keystroke I hit apparently made the stupid browser send that before I finished editing it, but you get the idea Sigh, John On Tue, Oct 14, 2014 at 9:12 AM, John Hascall wrote: > Some code you may find useful to enforce the readonly byte (do this before > your

Re: [sqlite] Make a database read-only?

2014-10-14 Thread John Hascall
Some code you may find useful to enforce the readonly byte (do this before your program opens the DB). John #include #include #define int setRObyte ( const char * sqDBfn ) { int fd = open(sqDBfn, O_WRONLY, 0); int rc = -1; if (fd == -1) return

Re: [sqlite] Make a database read-only?

2014-10-14 Thread RSmith
On 2014/10/14 13:48, Ross Altman wrote: Hi Martin, Thank you, I'll definitely look into that. It's unfortunate that there isn't a simpler way to do this... oh well. Let me bud in here since I encounter this question a lot in other matters. There typically are three reasons one would like to

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Clemens Ladisch
Ross Altman wrote: > I need to host a fixed, unchanging database online, An SQLite database is just a file. > and I want to make sure that anyone who downloads it cannot add to it. It's possible to run "sqlite3 thedata.db .dump > thedata.sql" and then to remove any protection that is still

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Richard Hipp
On Tue, Oct 14, 2014 at 2:19 AM, Ross Altman wrote: > I need to host a fixed, unchanging database online, and I want to make sure > that anyone who downloads it cannot add to it. Is there any way to set the > permissions to be read-only within sqlite? > Change the 18th

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Martin Engelschalk
Hi Ross, i don't know if there is a simpler way. Perhaps someone on the list has a better idea. What I wanted to say is that you probanly cannot prevent your downloaders from removing anything you add to make the data read-only. Martin. Am 14.10.2014 13:48, schrieb Ross Altman: Hi Martin,

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Ross Altman
Hi Martin, Thank you, I'll definitely look into that. It's unfortunate that there isn't a simpler way to do this... oh well. Best, Ross On Tue, Oct 14, 2014 at 7:22 AM, Martin Engelschalk < engelsch...@codeswift.com> wrote: > Hello Ross, > > you could add triggers to all tables that

Re: [sqlite] Make a database read-only?

2014-10-14 Thread Martin Engelschalk
Hello Ross, you could add triggers to all tables that RAISE(ROLLBACK, 'Forbidden') on all operations (insert, update and delete), see http://www.sqlite.org/lang_createtrigger.html, bottom of the page. However, it is difficult to see how to stop the downloaders from removing these triggers or

[sqlite] Make a database read-only?

2014-10-14 Thread Ross Altman
I need to host a fixed, unchanging database online, and I want to make sure that anyone who downloads it cannot add to it. Is there any way to set the permissions to be read-only within sqlite? Thanks, Ross ___ sqlite-users mailing list