IUBio

Zooming in dotter broken

Ed Griffiths edgrif at sanger.ac.uk
Mon Sep 3 12:51:55 EST 2001


Tim,

Just got back from holiday and didn't see an answer to this so...

> I'm currently preparing my site to upgrade to ACeDB 4.9, plus associated
> stuff.   Consequently, I have installed all the binaries with names
> ending in -4.9c, for people to test.  e.g.:
> 
> xace-4.9c
> 
> For the most part this works fine, but it causes problems for dotter's
> zoom function, where it spawns a new copy of itself.  Firstly, this is
> because the command name 'dotter' is hardwired, but installing a
> symbolic link from dotter -> dotter-4.9c doesn't solve the problem.
> 
> Investigation of the source code revealed that this is because it relies
> on csh to find the program, which in turn relies on you having a .cshrc
> set up.  This seems silly to me, since it breaks the software for anyone
> not using csh (which everyone knows is a horribly broken shell anyway,
> and tcsh isn't much better).

No, this is not correct, we do not rely on csh to find the program, the old code
which did this is now commented out.

> It also seems silly since the location of the dotter binary is already
> known; it was supplied as argc[0] in main()!  Why all this jumping
> through hoops for no reason?  Using argc[0] would (a) solve the problem
> with my using a non-standard name for the binary, and (b) stop the
> reliance on csh.  For dotter, this is not a major problem, but could be
> considered a security risk if ACeDB does the same thing.

NO, this doesn't work, argv[0] only contains the string by which the program was
invoked, e.g. if you type "./dotter" to start the program then argv[0] will only
contain  "./dotter". The jumping through hoops is because dotter is invoked both
as a stand alone program and from within xace and we just want one load of code
to do both.

> Any chance this could be fixed?  I suppose the hacky way to do it is to
> have a global variable with the path to the binary populated by main(),
> and then have findCommand() use that rather than its current code.

I'll pretend I didn't see this....

> Slightly less hacky but more work would be to make argc[0] a parameter
> to dotterZoom().

You might imagine that one of ths standard C library functions would implement
the function "given this program name, examine my environment and construct the
full pathname of the executable that will actually be run when I type that
name". Sadly this function does not exist, I really don't know why....so we do
our best....

cheers Ed

 ------------------------------------------------------------------------
| Ed Griffiths, Acedb development, Informatics Group,                    |
|               The Sanger Centre, Wellcome Trust Genome Campus,         |
|               Hinxton, Cambridge CB10 1SA, UK                          |
|                                                                        |
| email: edgrif at sanger.ac.uk  Tel: +44-1223-494780  Fax: +44-1223-494919 |
 ------------------------------------------------------------------------





More information about the Acedb mailing list

Send comments to us at biosci-help [At] net.bio.net