From owner-freebsd-questions Tue Jul 24 21:31:17 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id 158E037B401 for ; Tue, 24 Jul 2001 21:31:12 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 38190 invoked by uid 100); 25 Jul 2001 04:31:10 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15198.19342.439806.730383@guru.mired.org> Date: Tue, 24 Jul 2001 23:31:10 -0500 To: Richard Smith Cc: questions@freebsd.org Subject: Re: applixware In-Reply-To: <102384027@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Richard Smith 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 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. 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