[Gnucash-changes] r12020 - gnucash/trunk - Remove redundant RPC variable

Neil Williams linux at codehelp.co.uk
Wed Nov 23 04:20:32 EST 2005


On Wednesday 23 November 2005 1:02 am, Derek Atkins wrote:
> Umm, but you've left the code in a state where a user can cause gnucash
> to crash because there's a missing symbol!

No, I did not. With the current code, starting gnucash with:
gnucash --rpc-server
fails with an error message. OK, that message could be improved, but at least 
anyone who is (for some unknown reason) using RPC with gnucash despite the 
warnings, will find:
1. svn won't build with the --enable-rpc option - no such option exists.
2. gnucash won't start with the --rpc-server command as may be used in a 
variety of scripts that this theoretical user may have.

> It's not too hard to remove 
> the references to gnc:run-rpc-server in the command-line scm file.

When I do that, gnucash starts up fine with absolutely no warnings, errors or 
reports - making the user believe that the RPC server is fully functional!

I believe that is wrong. Absolutely the wrong thing to do. Far better that the 
user gets an error message of some kind, even if it isn't the most helpful in 
the world.

> Personally we'd be better off in the short run just creating a gnucash
> binary in C that just calls the guile interpretter -- so we're not
> dependent on /usr/bin/guile being the correct version.  But that still
> requires changing command-line.scm.

It would require deleting it. I'd replace all the command line options with 
popt. I was not thinking of providing any command-line guile access.

> Please don't be lazy.

I'm not. I deliberately left the command line options untouched because:
1. I aim to replace them soon
2. I knew gnucash would not inform the user that a command line option had 
been removed.

gnucash currently starts with any arbitrary command line. You can pass it 
absolute junk and there is no complaint. That isn't right.

Try this command line:
gnucash --dsfs234 --sere3w43

That's appalling behaviour. At the very least it should print a usage message 
and inform the user:
a) that a bad option was passed
b) the accepted options.

popt does this with just a couple of lines of C.

> Yes, we did..  But we did NOT agree that we should add the ability for
> users to crash gnucash

gnucash does *not* crash as-is. It reports an error, as it should.

> by giving it command-line arguments that point off 
> to non-existant functions.

You can pass complete nonsense to gnucash without a crash. At least as-is, a 
previously valid option raises an error, such as it is.

> Who knows if we'll get this re-write done in 
> time for 2.0?  I doubt it.

I'm expecting to be able to do that. The majority of the code is already in 
cashutil.

> It's 60 seconds of work to clean this up.  Please do it.

I'd rather not mislead users into thinking rpc-server is suddenly enabled by 
default. We've removed some functionality, (albeit rarely used), users are 
right to expect an error if they try to use that functionality. It is not a 
crash, it is a simple (if not directly helpful) error.

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20051123/2b0ae456/attachment.bin


More information about the gnucash-devel mailing list