… | |
… | |
260 | |
260 | |
261 | These can be found at |
261 | These can be found at |
262 | <http://cvs.schmorp.de/deliantra/Deliantra-Client/util/>, but |
262 | <http://cvs.schmorp.de/deliantra/Deliantra-Client/util/>, but |
263 | looking at them can lead to premature blindless. |
263 | looking at them can lead to premature blindless. |
264 | |
264 | |
|
|
265 | Shared Libraries |
|
|
266 | It is often desirable to package shared libraries - for example the |
|
|
267 | Deliantra client packages SD>, Berkely DB, Pango and amny other |
|
|
268 | libraries that are unlikely to be available on the target system. |
|
|
269 | |
|
|
270 | This usually requires some fiddling (see below), and additionally |
|
|
271 | some environment variables to be set. |
|
|
272 | |
|
|
273 | For example, on ELF systems you usually want LD_LIBRARY_PATH=. and |
|
|
274 | on OS X, you want DYLD_LIBRARY_PATH=. (these are effectively the |
|
|
275 | default on windows). |
|
|
276 | |
|
|
277 | These can most easily be specified when building the packfile: |
|
|
278 | |
|
|
279 | urlader-util ... LD_LIBRARY_PATH=. ./perl run |
|
|
280 | |
|
|
281 | Portability: RPATH |
|
|
282 | Often perl is linked against a shared libperl.so - and might be so |
|
|
283 | using an rpath. Perl extensikns likewise might use an rpath, which |
|
|
284 | means the binary will mostly ignore LD_LIBRARY_PATH, which leads to |
|
|
285 | trouble. |
|
|
286 | |
|
|
287 | There is an utility called chrpath, whose -d option can remove the |
|
|
288 | rpath from binaries, shared library and shared objects. |
|
|
289 | |
|
|
290 | Portability: OS X DLL HELL |
|
|
291 | OS X has the most severe form of DLL hell I have seen - if you link |
|
|
292 | against system libraries, which is practically unavoidable, you get |
|
|
293 | libraries of well-known names (e.g. libjpeg) that have nothing to do |
|
|
294 | with what you normally expect libjpeg to be, and there is no way to |
|
|
295 | get your version of libjpeg into your program. |
|
|
296 | |
|
|
297 | Moreover, even if apple ships well-known libraries (e.g. libiconv), |
|
|
298 | they often ship patched versions which have a different ABI or even |
|
|
299 | API then the real releases. |
|
|
300 | |
|
|
301 | The only way aorund this I found was to change all library names in |
|
|
302 | my releases (libjpeg.dylib becomes libdeliantra-jpeg.dylin and so |
|
|
303 | on), by patching the paths in the share dlibraries and shared |
|
|
304 | objects. install-name-tool (with -id and -change) works in many |
|
|
305 | cases, but often paths are embedded indirectly, so you might have to |
|
|
306 | use a *dirty* string replacement. |
|
|
307 | |
|
|
308 | SECURITY CONSIDERATIONS |
|
|
309 | The urlader executable itself does not support setuig/setgid operation, |
|
|
310 | or running with elevated privileges - it does no input sanitisation, and |
|
|
311 | is trivially exploitable. |
|
|
312 | |
265 | AUTHOR |
313 | AUTHOR |
266 | Marc Lehmann <schmorp@schmorp.de> |
314 | Marc Lehmann <schmorp@schmorp.de> |
267 | http://home.schmorp.de/ |
315 | http://home.schmorp.de/ |
268 | |
316 | |