On Wed, Sep 25, 2013 at 12:30 PM, Stephan Beal <sgb...@googlemail.com>wrote:

> On Tue, Sep 24, 2013 at 9:36 PM, Richard Hipp <d...@sqlite.org> wrote:
>
>> I think this is a bug.  My theory is that Fossil is putting itself in a
>> chroot jail to handle each request, but it is doing so after opening the
>> database file.  That's a huge no-no.  The database file needs to be opened
>> after entering the chroot jail.  If the database file is open prior to
>> entering the chroot jail, it needs to be closed prior to entry then
>> reopened afterwards.
>>
>
> enter_chroot_jail() closes/re-opens the repo, but it closes after doing
> the chdir. Do i understand correctly that the db_close() should be done
> before the chdir, and the db_open_repo...() afterwards?
>

Do you mean chroot()?  If so, then I think the answer is "yes".  But I
don't think chdir() matters.

Sorry I don't have time to look into this now.  Thanks for checking it for
me!



>
> @Krister: please try the following as a quick-hack fix, and if this works
> then i'll refactor this into something nicer:
>
> in main.c:
> enter_chroot_jail() (currently line 1156)
> at the bottom of the function is this block:
>
>     if( g.db!=0 ){
>       db_close(1);
>       db_open_repository(zRepo);
>     }
>
> It looks like:
>
> http://fossil-scm.org/index.html/artifact/0fa850420a5917a8f83e127caf849a2f6cb2f77a?ln=1171-1174
>
> _Copy_ that block to just after the variable declarations (line 1143),
> remove the db_open_xxx() part from the first copy and the db_close() part
> from the second copy. Then please give it a try.
>
> :-?
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
>
> _______________________________________________
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>
>


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to