Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2001 23:31:10 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Richard Smith <rdls@satamatics.com>
Cc:        questions@freebsd.org
Subject:   Re: applixware
Message-ID:  <15198.19342.439806.730383@guru.mired.org>
In-Reply-To: <102384027@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Richard Smith <rdls@satamatics.com> types:
> On Tue, Jul 24, 2001 at 01:13:19AM -0700, zer0700@excite.com wrote:
> > after installing a fresh copy of 4.3 release and the applixware 5.0 suite
> > that came with my copy of 4.1 release, i get this error:
> > 
> > $applix
> > /usr/libexec/ld-elf.so.1: /usr/X11R6/lib/libgtk12.so.2: Undefined symbol
> > "getresuid"
> > axnet error, axmain already started.
> The simplest solution I've found (here, I think) is as follows:
> Create the file `getresuid.c' containing the offending symbol:
>     void getresuid(void){}
> Install it somewhere with:
> 	# cc -shared -fPIC -DPIC -o /usr/local/lib/getresuid.so getresuid.c
> Then start applix with this script:
> 	#!/bin/sh -
> 	export LD_PRELOAD=/usr/local/lib/getresuid.so
> 	applix $*

Wouldn't surprise me. The problem is that applixware uses gtk, which
conditionally compiles in code depending on whether or not you have
getresuid available. All gtk does is check the various ids to make
sure you're not running setxid, refusing to start if you are. That
means you call getresuid exactly once, and if you make it past that
function, you're golden. Unfortunately, the library that the gtk
config checks for getresuid is libc.so.4, but the one that applix
loads is libc.so.3 - which doesn't have getresuid.

I've been fixing it by fixing the gtk config so it thinks I don't have
getresuid, as gtk will then use older syscalls. Your solution is
cleaner, as applications that use gtk & libc.so.4 will actually use
getresuid, which will be three syscalls faster over the entire life of
the program. Better yet, it means I don't have to keep remembering to
fix gtk - or more likely, *not* remembering, then cursing when applix
fails to start and fixing it.

However, gtk is expecting a return value from getresuid, and you're
not seting one, so you are returning garbage. Should that garbage
happen to be 0, applix will fail looking for getresgid. The easy fix
is to provide a return value indicating failure - 1 - which will make
gtk use the same method it uses if you don't have getresuid. I also
plugged in the proper argument decelerations, because I can't stand
sloppy code:

#include <sys/types.h>
int getresuid(uid_t *a, uid_t *b, uid_t *c) { return 1; }

On the shell script - /usr/local/bin/applix is a shell script that
sets one environment variable and starts the binary, so I just fixed
it. It also passes it's arguments to the binary with "$@" instead $*
(yes, you want the quotes in it). That way, if someone says "applix
'~/docs/my current resume'", it will invoke applix with one argument
instead of three.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15198.19342.439806.730383>