Re: [fossil-users] JSON login demo: is this interface acceptable?

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 4:18 AM, Ron Wilson ronw.m...@gmail.com wrote: On Wed, Sep 14, 2011 at 6:40 PM, Stephan Beal Instead of sending the password in plain text, you hash the password with a nonce received from the server. Of course, to get the nonce, you have to attempt to login without

Re: [fossil-users] JSON/wiki: what info needs to be returned for...

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 5:48 AM, Ron Wilson ronw.m...@gmail.com wrote: Actually, Fossil fetches wiki pages by name. Artifact Id would be used to fetch a specific version of a page Sorry, i meant when we get a list of pages from the server, e.g. for creating a list all wiki pages page. i

Re: [fossil-users] authentication in JSON: anonymous vs. guest user

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 5:07 AM, Ron Wilson ronw.m...@gmail.com wrote: A simplification on templates would be a list of fields in the desired order. Since most of the JSON responses would be lists of fields and their values, this would achieve nearly all that templates could. (True, some

[fossil-users] Windows build of json branch?

2011-09-16 Thread Stephan Beal
Hello, fellow developers, Could i ask (beg!) one of you Windows users to try to compile the json branch on Windows? i've introduced two new files in that branch (the underlying JSON lib) and while i am 98% certain that all of that code is portable C89 (it builds warning-free on tcc, clang, and

Re: [fossil-users] Has any fossil user ever experienced a SHA1 collision?

2011-09-16 Thread Michael Richter
On 15 September 2011 22:43, Ron Aaron r...@ronware.org wrote: On 09/15/2011 05:34 PM, Richard Hipp wrote: Using the birthday paradox, I calculated last year that for the SQLite repository, if it continues to change and evolve at the same rate it has for the previous 10 years, will

Re: [fossil-users] Windows build of json branch?

2011-09-16 Thread Joe Mistachkin
Tried here (using MinGW) and got the following errors: src/cson_amalgamation.c:3914:0: warning: ignoring #pragma warning src/cson_amalgamation.c: In function 'cson_session_file_remove': src/cson_amalgamation.c:5445:4: error: #error unlink not implemented for this platform.

Re: [fossil-users] JSON login demo: is this interface acceptable?

2011-09-16 Thread Joshua Paine
On 9/15/2011 10:18 PM, Ron Wilson wrote: For the password on GET, you could mimic what HTTP-Auth-Digest does. AFAIK, in every programming context where you'd want to make a JSON request, POST is as easy to do as GET. The main reason to support GET at all is to make it easy for people to

Re: [fossil-users] Windows build of json branch?

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 3:34 PM, Joe Mistachkin sql...@mistachkin.comwrote: src/cson_amalgamation.c:5445:4: error: #error unlink not implemented for this platform. i just committed that fix before your mail arrived, thanks to a report from Robert Engelhardt. :) i now use remove() in Windows

Re: [fossil-users] Windows build of json branch?

2011-09-16 Thread Stephan Beal
2011/9/16 Robert Engelhardt m...@robert-engelhardt.de ...Ja, damit funktioniert es nun, und man erhält ein lauffähiges Binary :) Translation: the windows build now works and the binary runs. THANK YOU, Robert and Joe! -- - stephan beal http://wanderinghorse.net/home/stephan/

Re: [fossil-users] Windows build of json branch?

2011-09-16 Thread Richard Hipp
On Fri, Sep 16, 2011 at 9:50 AM, Stephan Beal sgb...@googlemail.com wrote: 2011/9/16 Robert Engelhardt m...@robert-engelhardt.de ...Ja, damit funktioniert es nun, und man erhält ein lauffähiges Binary :) Translation: the windows build now works and the binary runs. THANK YOU, Robert and

Re: [fossil-users] Windows build of json branch?

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 4:20 PM, Richard Hipp d...@sqlite.org wrote: The MinGW build works for me, but MSVC errors out. Unresolved cson_* symbols. No time to debug it now - perhaps latter. This is related to the build files, not the code. i need to figure out how to tell makemake.tcl to

[fossil-users] Ticket editing problems

2011-09-16 Thread Jousef Lofstrom
I have a user with limited access. The account can only handle wiki, attachments and tickets. But I am unable to modify tickets in the web gui as no clickable links are active. Here is the permission string bcfjkmnrtw. Did I miss something? /Jousef Fossil version 1.19 [6517b5c857] 2011-09-01

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 4:24 PM, Jousef Lofstrom jou...@netscape.netwrote: Here is the permission string bcfjkmnrtw. According to the sources, permission k==write wiki and: if( (rid g.perm.WrWiki) || (!rid g.perm.NewWiki) ){ style_submenu_element(Edit, Edit Wiki Page,

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 4:29 PM, Stephan Beal sgb...@googlemail.com wrote: On Fri, Sep 16, 2011 at 4:24 PM, Jousef Lofstrom jou...@netscape.netwrote: Here is the permission string bcfjkmnrtw. According to the sources, permission k==write wiki and: sorry, thought-error on my part - i

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 4:30 PM, Stephan Beal sgb...@googlemail.com wrote: On Fri, Sep 16, 2011 at 4:29 PM, Stephan Beal sgb...@googlemail.comwrote: On Fri, Sep 16, 2011 at 4:24 PM, Jousef Lofstrom jou...@netscape.netwrote: Here is the permission string bcfjkmnrtw. According to the

Re: [fossil-users] Windows build of json branch?

2011-09-16 Thread Richard Hipp
On Fri, Sep 16, 2011 at 10:24 AM, Stephan Beal sgb...@googlemail.comwrote: i'm hoping that outputing raw UTF8 to a FILE handle is portable. If by FILE handle you mean one that is connected via TCP/IP to a client on the other end, then yes, you should be OK. But any input/output from the the

Re: [fossil-users] Windows build of json branch?

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 4:33 PM, Richard Hipp d...@sqlite.org wrote: If by FILE handle you mean one that is connected via TCP/IP to a client on the other end, then yes, you should be OK. g.httpOut, for example. In HTTP mode i'm using that handle. In CLI mode i'm using stdout. For POST data

Re: [fossil-users] Windows build of json branch?

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 4:36 PM, Stephan Beal sgb...@googlemail.com wrote: On Fri, Sep 16, 2011 at 4:33 PM, Richard Hipp d...@sqlite.org wrote: If by FILE handle you mean one that is connected via TCP/IP to a client on the other end, then yes, you should be OK. g.httpOut, for example. In

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Jousef Lofstrom
Stephan Beal sgbeal@... writes: ... I cloned http://www.fossil-scm.org/ and built on 32 bit CentOS 5 and now have ... Fossil version 1.19 [9f5c40cbe7] 2011-09-16 11:19:08. Alas, with the same result. /Jousef ___ fossil-users mailing list

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 4:55 PM, Jousef Lofstrom jou...@netscape.netwrote: Stephan Beal sgbeal@... writes: I cloned http://www.fossil-scm.org/ and built on 32 bit CentOS 5 and now have ... Fossil version 1.19 [9f5c40cbe7] 2011-09-16 11:19:08. Alas, with the same result. i can't explain

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 4:59 PM, Stephan Beal sgb...@googlemail.com wrote: And then please try: /json/stat sorry: /json/cap not /json/stat (that's the repo stats) -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ fossil-users

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Jousef Lofstrom
Stephan Beal sgbeal@... writes: ... http://localhost:8080/tvo/json/login?n=usernamep=password == { fossil:afd36e987ca1f2841bd2d819e64804c1f1a9f971, timestamp:1316185867, resultCode:FOSSIL-1002, resultText:Unknown Command } HTTP/1.0 200 OK Date: Fri, 16 Sep 2011

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 5:20 PM, Stephan Beal sgb...@googlemail.com wrote: aha - that's because of the /tvo part. i don't yet handle sub-repositories. Damn. i need to figure out how to do that (i've never used sub-repos before). Doh - i'm also seeing this now without the prefix, so i've

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 5:39 PM, Stephan Beal sgb...@googlemail.com wrote: On Fri, Sep 16, 2011 at 5:20 PM, Stephan Beal sgb...@googlemail.comwrote: aha - that's because of the /tvo part. i don't yet handle sub-repositories. Damn. i need to figure out how to do that (i've never used

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 5:51 PM, Stephan Beal sgb...@googlemail.com wrote: the problem is that f is an alias for ~/bin/fossil, which isn't the binary i want to test. When i use ./fossil ... it works as expected. i'm fixing the /pathprefix problem right now - the current code won't dispatch

[fossil-users] how to get path part of request in server mode?

2011-09-16 Thread Stephan Beal
Hi, all! When fossil server is running i'm not seeing the path, query string via getenv(). Looking at cgi_http_server() and friends, it's not clear how i can get the path bits. i'm specifically looking for what CGI mode sets as PATH_INFO. -- - stephan beal

Re: [fossil-users] how to get path part of request in server mode?

2011-09-16 Thread Richard Hipp
On Fri, Sep 16, 2011 at 12:12 PM, Stephan Beal sgb...@googlemail.comwrote: Hi, all! When fossil server is running i'm not seeing the path, query string via getenv(). Looking at cgi_http_server() and friends, it's not clear how i can get the path bits. i'm specifically looking for what CGI

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 5:18 PM, Jousef Lofstrom jou...@netscape.netwrote: resultCode:FOSSIL-1002 That should be fixed now in server and CGI modes. The bug was in a mismatch between server mode and CGI mode. i have added code to accommodate the optional /prefix path part (everything up

Re: [fossil-users] Ticket editing problems

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 7:28 PM, Stephan Beal sgb...@googlemail.com wrote: then /json/stat i just can't get this right today: /json/cap, not /json/stat -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ fossil-users mailing list

[fossil-users] fossil code style question...

2011-09-16 Thread Stephan Beal
Hi! Which of these is more correct for fossil's code style for if/else's which have only a single expression: if( ... ) continue; else break; or if( ... ){ continue; }else{ break; } (hypothetical example) The question only applies to single-expression if/else/for/while/etc. For others

Re: [fossil-users] fossil code style question...

2011-09-16 Thread Richard Hipp
On Fri, Sep 16, 2011 at 2:26 PM, Stephan Beal sgb...@googlemail.com wrote: Hi! Which of these is more correct for fossil's code style for if/else's which have only a single expression: if( ... ) continue; else break; or if( ... ){ continue; }else{ break; } The second is

Re: [fossil-users] fossil code style question...

2011-09-16 Thread Martin S. Weber
On 09/16/11 14:26, Stephan Beal wrote: To be clear: i'm not going to argue either way, i just want to conform. Which reminds me, try building your code with either c89 as compiler or pass -ansi to gcc. There's still a fix necessary for fossil's sha1 computation (see previous thread starting

Re: [fossil-users] fossil code style question...

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 8:32 PM, Martin S. Weber martin.we...@nist.govwrote: Which reminds me, try building your code with either c89 as compiler or pass -ansi to gcc. There's still a fix necessary for fossil's sha1 computation (see previous thread starting at http://www.mail-archive.com/*

[fossil-users] a fix wish for the configure guru(s)...

2011-09-16 Thread Stephan Beal
This is mostly for Steve (configure guy), in blob.c readlink() is used, but according to my man pages (and compiler), we need: #define _POSIX_C_SOURCE 200112L (or some greater value - i don't know all the legal values) before including unistd.h (which is included in config.h). Assuming that

Re: [fossil-users] is there a fossil/sqlite3 routine to get a Unix Epoch GMT int (current time)?

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 9:16 PM, Richard Hipp d...@sqlite.org wrote: db_int64(0, SELECT strftime('%%s','now')); i forgot to mention (well, forgot period), that i'm doing this at a point which might be called before the db is opened, e.g. to report a db-opening error or some error which happens

Re: [fossil-users] is there a fossil/sqlite3 routine to get a Unix Epoch GMT int (current time)?

2011-09-16 Thread Richard Hipp
On Fri, Sep 16, 2011 at 3:21 PM, Stephan Beal sgb...@googlemail.com wrote: On Fri, Sep 16, 2011 at 9:16 PM, Richard Hipp d...@sqlite.org wrote: db_int64(0, SELECT strftime('%%s','now')); i forgot to mention (well, forgot period), that i'm doing this at a point which might be called before

Re: [fossil-users] is there a fossil/sqlite3 routine to get a Unix Epoch GMT int (current time)?

2011-09-16 Thread Gé Weijers
On Fri, 16 Sep 2011, Richard Hipp wrote: time(0) should give you UTC directly.  No need to convert. This is the common implementation, but not required by any standard. Most OSes do it this way, but POSIX and C99 do only require that time_t be an integer or real type (so it could be a

Re: [fossil-users] is there a fossil/sqlite3 routine to get a Unix Epoch GMT int (current time)?

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 10:20 PM, Gé Weijers g...@weijers.org wrote: - get the time_t value - use gmtime() to get a 'struct tm' value representing UTC - calculate the # of seconds since 1970-01-01T00:00+0:00 from this representation, which except for counting leap years is simple enough.

Re: [fossil-users] new fossil docs: is the wiki or embedded docs preferred?

2011-09-16 Thread Stephan Beal
On Fri, Sep 16, 2011 at 9:39 PM, Paul Ruizendaal p...@planet.nl wrote: Hmmm… If Fossil was created today, with the knowledge of today, would it still have wiki pages? Would it make Fossil a simpler, but equally powerful tool if it just had (web editable) embedded documentation? Good

Re: [fossil-users] a fix wish for the configure guru(s)...

2011-09-16 Thread Dmitry Chestnykh
in blob.c readlink() is used, but according to my man pages (and compiler), we need: #define _POSIX_C_SOURCE 200112L Is this Linux with glibc from 2006? :-) According to `man feature_test_macros`: If no feature test macros are explicitly defined, then the following feature

Re: [fossil-users] new fossil docs: is the wiki or embedded docs preferred?

2011-09-16 Thread Dmitry Chestnykh
On Sep 16, 2011, at 9:39 PM, Paul Ruizendaal wrote: Hmmm… If Fossil was created today, with the knowledge of today, would it still have wiki pages? Would it make Fossil a simpler, but equally powerful tool if it just had (web editable) embedded documentation? Embedded documentation is

[fossil-users] JSON login/logout/permissions demo

2011-09-16 Thread Stephan Beal
Hi, all! http://fossil.wanderinghorse.net/repos/fossil-sgb/json/ Quick demo: 1) Click the 'cap' button and note the output in the bottom textarea. 2) Enter: User: json-demo Password: json-demo click the login button 3) Repeat step (1) 4) Click the logout button 5) Repeat step (1) With

Re: [fossil-users] is there a fossil/sqlite3 routine to get a Unix Epoch GMT int (current time)?

2011-09-16 Thread Gé Weijers
Stephan, 'mktime' converts localtime, it's not designed to do what you want it to do. Setting is_dst just sets the assumption about whether DST is in effect. Setting it to -1 makes the routine look it up. I don't know what happens in that one 'ambiguous' hour each year.

Re: [fossil-users] is there a fossil/sqlite3 routine to get a Unix Epoch GMT int (current time)?

2011-09-16 Thread Stephan Beal
On Sat, Sep 17, 2011 at 12:25 AM, Gé Weijers g...@weijers.org wrote: 'mktime' converts localtime, it's not designed to do what you want it to do. Setting is_dst just sets the assumption about i was always under the impression (apparently wrong) that time() returned localtime. My man pages say

Re: [fossil-users] is there a fossil/sqlite3 routine to get a Unix Epoch GMT int (current time)?

2011-09-16 Thread Stephan Beal
On Sat, Sep 17, 2011 at 12:25 AM, Gé Weijers g...@weijers.org wrote: long UnixTime(time_t now) { struct tm *p = gmtime(now); but now the question: if time(0) returns time in either GMT or local TZ, how can i know which value to pass to UnixTime()? -- - stephan beal

Re: [fossil-users] is there a fossil/sqlite3 routine to get a Unix Epoch GMT int (current time)?

2011-09-16 Thread Gé Weijers
time(0) returns the current time in whatever representation your system uses. 'gmtime' is supposed to be able to convert whatever the system uses into a representation based on UTC. So UnixTime(time(0)) will return the number of seconds passed since 1970-01-01T00:00+0:00 (the Unix epoch).

Re: [fossil-users] is there a fossil/sqlite3 routine to get a Unix Epoch GMT int (current time)?

2011-09-16 Thread Stephan Beal
On Sat, Sep 17, 2011 at 2:47 AM, Gé Weijers g...@weijers.org wrote: BTW: look at mkgmtime in cgi.c. The assumption that time_t is seconds after the Unix Epoch is assumed there. Trying to write a fully portable implementation of that thing will only give you grief. That mkgmtime() requires a