Re: [Demexp-dev] Problem with preference saving ?
Hello, Thomas Petazzoni <[EMAIL PROTECTED]> writes: > Anyway, I think that a proper fix would involve > throwing an exception in io.ml when the bases cannot be loaded, and in > demexp-server.ml, when this exception is catched, initialize a default > participant base. This bug is now fixed. I have used a much simpler scheme that the one you proposed: the empty participant base (with root access) is created at server startup and is overwritten if a .dmxp file is loaded. Yours, d. -- pub 1024D/A3AD7A2A 2004-10-03 David MENTRE <[EMAIL PROTECTED]> 5996 CC46 4612 9CA4 3562 D7AC 6C67 9E96 A3AD 7A2A ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
Hello Thomas, 2005/9/28, Thomas Petazzoni <[EMAIL PROTECTED]>: > Ok, I *think* I've found the bug. (Line numbers refers to 0.6.2). > > In srv/participants.ml.nw, the function which is in charge of creating > the default root login (with the demexp password) is > initialize_default_participant_base. After a quick grep inside > srv/*.ml.nw, I found two places where this function is called: > - inside the participants autotest > - in src/demexp-server.ml.nw > > In srv/demexp-server.ml.nw, line 290, we can read: > > if !flag_autotests then ( > log "server: use default participant base"; > Participants.initialize_default_participant_base () >) else > log "server: use bases '%s'" !flag_bases_name; > start_server () > > If I correctly read OCaml, it means that > initialize_default_participant_base() is called *only* in the case of > autotests. Otherwise, start_server() is called, will try to load a > bases.dmxp file, won't find it... and will run the server with not > default root login. > > Is that right ? I think you have spoted the bug quite well. > Anyway, the enclosed patch fixes it. It simply calls the > initialize_default_participant_base() when the base loading fails. At first sight, your patch is wrong. The initialize_default_participant_base() is always called, because the else includes only the log function call. > (The !flag_autotests notation is quite strange for the C programmer, > which may think that it's the same as if flag_autotests == FALSE. In > fact, after a quick read inside Weis and Leroy book, I've > (re)-discovered that it's like the '*' in C, a dereference operator. Funny). Yes. Even after years of using OCaml, I easily read this construct as negation. :( > --- demexp-0.6.2/srv/io.ml.nw 2005-09-28 00:36:50.0 +0200 > +++ demexp-0.6.2-new/srv/io.ml.nw 2005-09-28 00:37:02.0 +0200 > @@ -103,5 +103,6 @@ > log " done." > ) else > log " File \"%s\" does not exists. Don't load bases." filename; > +Participants.initialize_default_participant_base () ; >flush_all () > @ I would write it: ) else ( log " File \"%s\" does not exists. Don't load bases." filename; Participants.initialize_default_participant_base () ) ; flush_all () I just looked at your patch an not the original source code, so do not take my words for an absolute answer. ;) It's been a long time since I looked at that code, so I need to dive into it to fix it properly. Sorry for the stupid bug, Yours, d. ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
Hello, David MENTRE wrote: > I think you have spoted the bug quite well. Cool ;-) > I would write it: > ) else ( > log " File \"%s\" does not exists. Don't load bases." filename; > Participants.initialize_default_participant_base () > ) ; > flush_all () Ok, I understand. Anyway, I think that a proper fix would involve throwing an exception in io.ml when the bases cannot be loaded, and in demexp-server.ml, when this exception is catched, initialize a default participant base. > It's been a long time since I looked at that code, so I need to dive > into it to fix it properly. Ok. Thanks, Thomas -- Thomas Petazzoni [EMAIL PROTECTED] ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
Hi, Thomas Petazzoni a écrit : > After a small modification of the server, I've been able to see that the > received password is really "demexp", as suggested by the network trace. Ok, I *think* I've found the bug. (Line numbers refers to 0.6.2). In srv/participants.ml.nw, the function which is in charge of creating the default root login (with the demexp password) is initialize_default_participant_base. After a quick grep inside srv/*.ml.nw, I found two places where this function is called: - inside the participants autotest - in src/demexp-server.ml.nw In srv/demexp-server.ml.nw, line 290, we can read: if !flag_autotests then ( log "server: use default participant base"; Participants.initialize_default_participant_base () ) else log "server: use bases '%s'" !flag_bases_name; start_server () If I correctly read OCaml, it means that initialize_default_participant_base() is called *only* in the case of autotests. Otherwise, start_server() is called, will try to load a bases.dmxp file, won't find it... and will run the server with not default root login. Is that right ? Anyway, the enclosed patch fixes it. It simply calls the initialize_default_participant_base() when the base loading fails. I don't think io.ml is the right place to call this function (should be done in demexp-server.ml), but as I'm an OCaml newbie, this is just a quick and dirty fix. (The !flag_autotests notation is quite strange for the C programmer, which may think that it's the same as if flag_autotests == FALSE. In fact, after a quick read inside Weis and Leroy book, I've (re)-discovered that it's like the '*' in C, a dereference operator. Funny). Sincerly, Thomas --- demexp-0.6.2/srv/io.ml.nw 2005-09-28 00:36:50.0 +0200 +++ demexp-0.6.2-new/srv/io.ml.nw 2005-09-28 00:37:02.0 +0200 @@ -103,5 +103,6 @@ log " done." ) else log " File \"%s\" does not exists. Don't load bases." filename; +Participants.initialize_default_participant_base () ; flush_all () @ -- PETAZZONI Thomas - [EMAIL PROTECTED] http://{thomas,sos,kos}.enix.org - Jabber: [EMAIL PROTECTED] http://{agenda,livret}dulibre.org Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E 1624 F653 CB30 98D3 F7A7 signature.asc Description: OpenPGP digital signature ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
Hi, Thomas Petazzoni a écrit : > <0>2005-09-27T22:16:28+0200 RPC login(1, "root", **passw**) After a small modification of the server, I've been able to see that the received password is really "demexp", as suggested by the network trace. <0>2005-09-28T00:15:06-2200 RPC login(1, "root", "demexp") Sincerly, Thomas -- PETAZZONI Thomas - [EMAIL PROTECTED] http://{thomas,sos,kos}.enix.org - Jabber: [EMAIL PROTECTED] http://{agenda,livret}dulibre.org Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E 1624 F653 CB30 98D3 F7A7 signature.asc Description: OpenPGP digital signature ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
Hi, David MENTRE a écrit : > 2005/9/27, Thomas Petazzoni <[EMAIL PROTECTED]>: > >>However, I wasn't able to login on the locally running demexp server >>with root/demexp. Is it really the default root password ? > > > Yes. I have checked in 0.6.2 sources, in participants.ml.nw: > """ > Function [[initialize_default_participant_base]] initializes the base of > participants with an empty base containing only one participant: an > administrator of name ``[[root]]'', of login ``[[demexp]]'' and > belonging to the group [[administration_group]]. > > \nextchunklabel{code:root-login} > <>= > let administration_group = "admin" > > let classification_group = "classifier" > > let initialize_default_participant_base () = > the_participant_base := create_participant_base (); > ignore(add_participant "root" "demexp" [administration_group; > classification_group]); > check_invariants () > @ > """ > > Have you tried following procedure? > > 1. demexp-gtk2-client demexp://localhost:5 > > 2. In Preferences, set login/pass to root/demexp > > 3. quit and restart client with demexp-gtk2-client demexp://localhost:5 Okay, I've tried this. The client correctly sends root/demexp, according to the following 'ngrep': crazy:/home/thomas# ngrep -d lo port 5 interface: lo (127.0.0.0/255.0.0.0) filter: (ip or ip6) and ( port 5 ) T 127.0.0.1:34057 -> 127.0.0.1:5 [AP] [EMAIL PROTECTED] ...rootdemexp.. However, I still got the « login invalid » dialog box. Here are the logs of the server when run with -d: [EMAIL PROTECTED]:~$ demexp-server -d <0>2005-09-27T22:16:26+0200 demexp server (0.6.2 -- U2: Unscalable & Unsecure) demexp server comes with ABSOLUTELY NO WARRANTY. This program is free software, and you are welcome to redistribute it under certain conditions (see http://www.gnu.org/licenses/gpl.html). <0>2005-09-27T22:16:26+0200 server: use bases 'bases.dmxp' <0>2005-09-27T22:16:26+0200 File "bases.dmxp" does not exists. Don't load bases. <0>2005-09-27T22:16:26+0200 server: opening main socket (127.0.0.1:5) <0>2005-09-27T22:16:26+0200 server: ready <0>2005-09-27T22:16:28+0200 RPC login(1, "root", **passw**) <0>2005-09-27T22:16:28+0200 => participant 'root' failed to log in, remains Anonymous (cookie:150854162) <0>2005-09-27T22:16:29+0200 RPC get_timestamps(150854162) <0>2005-09-27T22:16:29+0200 update timestamp list <0>2005-09-27T22:16:29+0200 RPC max_question_id(150854162) <0>2005-09-27T22:16:29+0200 => return max_question_id:-1 <0>2005-09-27T22:16:29+0200 RPC max_tag_id(150854162) <0>2005-09-27T22:16:29+0200 => return max_tag:-1 I must be doing something really really wrong. But I can't see what. Is the message regarding the non-existing bases.dmxp a problem ? Sincerly, Thomas -- PETAZZONI Thomas - [EMAIL PROTECTED] http://{thomas,sos,kos}.enix.org - Jabber: [EMAIL PROTECTED] http://{agenda,livret}dulibre.org Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E 1624 F653 CB30 98D3 F7A7 signature.asc Description: OpenPGP digital signature ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
2005/9/27, Thomas Petazzoni <[EMAIL PROTECTED]>: > However, I wasn't able to login on the locally running demexp server > with root/demexp. Is it really the default root password ? Yes. I have checked in 0.6.2 sources, in participants.ml.nw: """ Function [[initialize_default_participant_base]] initializes the base of participants with an empty base containing only one participant: an administrator of name ``[[root]]'', of login ``[[demexp]]'' and belonging to the group [[administration_group]]. \nextchunklabel{code:root-login} <>= let administration_group = "admin" let classification_group = "classifier" let initialize_default_participant_base () = the_participant_base := create_participant_base (); ignore(add_participant "root" "demexp" [administration_group; classification_group]); check_invariants () @ """ Have you tried following procedure? 1. demexp-gtk2-client demexp://localhost:5 2. In Preferences, set login/pass to root/demexp 3. quit and restart client with demexp-gtk2-client demexp://localhost:5 Yours, d. ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
Hi, David MENTRE wrote: > This should work if you start the client with demexp://localhost:5 > URL in the command line. Ok, works with the URL on the command line. However, I wasn't able to login on the locally running demexp server with root/demexp. Is it really the default root password ? Sincerly, Thomas -- Thomas Petazzoni [EMAIL PROTECTED] ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
Hi David, David MENTRE wrote: > Did you try to specify a new default server different that > tuxinette.linux-france.org:5? Did you launch the client with the > URL of the new server in the command line? Here are the steps to reproduce (from my remembers): - rm -rf ~/.demexp* - demexp-client-gtk2 - warns about login as Anonymous - the client lists all question of tuxinette:5 - go in Edit->Preferences - change login to root/demexp, put something in delegate, and change server to localhost - save, quit the client - demexp-client-gtk2 - still the warning about login as Anonymous - client logged on tuxinette:5, and not localhost:5 Note: I might be doing something wrong. But I think it worked previously. Sincerly, Thomas -- Thomas Petazzoni [EMAIL PROTECTED] ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
Hello, 2005/9/26, Thomas Petazzoni <[EMAIL PROTECTED]>: > - rm -rf ~/.demexp* > - demexp-client-gtk2 > - warns about login as Anonymous > - the client lists all question of tuxinette:5 > - go in Edit->Preferences > - change login to root/demexp, put something in delegate, and change > server to localhost > - save, quit the client > - demexp-client-gtk2 > - still the warning about login as Anonymous > - client logged on tuxinette:5, and not localhost:5 This should work if you start the client with demexp://localhost:5 URL in the command line. > Note: I might be doing something wrong. But I think it worked previously. It worked in the 0.4. In fact, the multi-server support in 0.6 is a quick hack and the current client does not really understand the notion of default server. tuxinette:5 is always the default server, except if given a demexp URL on the command line. The current Preference dialog edits preferences for the server given on the command line (or tuxinette:5 if none given). I recognize that I should write the GUI to properly support multiple servers but, well, I'm always reluctant to write GUI code: so boring and difficult. Yours, d. ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
Re: [Demexp-dev] Problem with preference saving ?
Hi Thomas, 2005/9/25, Thomas Petazzoni <[EMAIL PROTECTED]>: > Today, when I tried to modify the preferences in my 0.6.2 demexp client, > the new preferences were not taken into account when restarting the > client. What do you mean exactly by "the new preferences were not taken into account"? Did you try to specify a new default server different that tuxinette.linux-france.org:5? Did you launch the client with the URL of the new server in the command line? There is currently an issue with the client: if launched without command line demexp URL, the tuxinette:5 is used as default server. Yours, d. ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev
[Demexp-dev] Problem with preference saving ?
Hi, Today, when I tried to modify the preferences in my 0.6.2 demexp client, the new preferences were not taken into account when restarting the client. I've tried to remove my ~/.demexp/, tried with an other Unix user, same problem. I recompiled the tarball from scratch (in case of a trouble with the Debian packaging). Still the same problem. Am I the only one in this case ? Sincerly, Thomas -- PETAZZONI Thomas - [EMAIL PROTECTED] http://{thomas,sos,kos}.enix.org - Jabber: [EMAIL PROTECTED] http://{agenda,livret}dulibre.org Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E 1624 F653 CB30 98D3 F7A7 signature.asc Description: OpenPGP digital signature ___ Demexp-dev mailing list Demexp-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/demexp-dev