[rt-devel] Issue with new users in RT CLI
Iain Price
iain.price at post.serco.com
Mon Oct 13 08:56:15 EDT 2003
Iain Price wrote:
> Hi,
>
> For once i'm (hopefully) posting something useful and not just moans
> about slow databases ;)
>
> I've started implementing the RT CLI tool in my Java API where i was
> writing direct to the DB before, it seems to work oK although the
> examples are wrong (there was a patch on a previous mail to fix them),
> but I had issues with creating new users. The code seems to create a
> user called "New user" then modify it to fit ur parameters, the issue
> (as the code points out) is if this user already exists. I suspect
> the comment might refer to the case that the user creates a 'New user'
> user rather than the code breaking but anyway... if you botch the RT
> CLI parameters in some way, or something breaks it leaves New user
> around, and then cant create a new one any more.
Always a bad sign when you reply to yourself :P
Even if this patch isn't used, the default code will proceed to apply ur
modifications to 'id=NULL' (according to mysql query trace file) and the
RT cli returns with 'user creation successful', even though it got
botched rather badly - rather than take my approach assuming New user is
safe, you could code a error to return here instead (as i initially did
to debug) - anything would be better than pretending it all went fine :)
perhaps deeper in the API something should be modified to check if we're
trying to update ID=NULL and fail, as such a statement surely indicates
a bug higher up in the code.
Iain
More information about the Rt-devel
mailing list