From 68beb4b1a3ead9958cd38f08a5e2bda3221736c9 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Wed, 21 Mar 2007 20:24:01 +0000 Subject: [PATCH] Fixed some minor annoyances with dlsym - Added missing newline character to "File not found" message - Now properly handles relative file paths --- plugins/dlsym | Bin 8106 -> 8144 bytes plugins/dlsym.c | 9 ++++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/dlsym b/plugins/dlsym index 7b9f48c55332afbdd67d1f9dbd8519edc5e8a74e..819b25a297724fa5d26e065966857e6d8de8b7fa 100755 GIT binary patch literal 8144 zcmcIpeQ;b=6~FtDbW1`>(+>-+vS|~V&a`i{X(?@`&^ArlFr_U`ftCV~-R#Tm>SlM{ zeOptNF(oY!GtnZ7pq(iwj{nHeaTFbKv|0zI|1gnZjxjJ8QKp{@X3oFxQ_^+kh{%d&4l25Lox zl_0iDxt}ZqdNLRyjRBJ=XB#BeX+_(lFfhr;?s(fx0Dd5u`jJdJ9?2wDWzyNwfK|*{ z?W!)CmVMv0^G;cp{h&=WCExjK@OlvK%m#TAb(lCdW}NWK07|XeB40>n-9C{oxkcd&q+QV`73}U^sFO%%?NZT6 zzzS<O(2NBmIEy zJvW`kC$ANc>9Pii1L8ZtOg>oZ0;fLHJSndc-$$Nhs(!GlzJIFzS@?D>oMIe&78;%) z$9JD3ha+7i=ZAU<9Ni3(!}&twaISiCIAQ}i?93;J1Km0N_Rxh;`EArJ-weCuU zw5Z%zhQ&(D1w0`Wl@_*~V)oqG3Q`MukfQ9|n8fT!im!6+l*H^&Y7y~CiP^JMnD}Xl z*~3&T@iB?n(-epD+@QqlacUiLUSjq7g!>1<@i$)&52-(qB-J0?f$m~0C=JYX{ z)YuGeY(`7Mtv|nH=v44~VSvi3&ybBY9DTKP{-qkqeW;}LpQ*=-A3fzZ{)}xPGyCOW zGs`Mt&>7v)97Go@pSuX{I}TrH#)u7%mj70%yxcj?3NLp~C^ktpa+IQ>b$)jdtUQXz zST6hry1`~j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~;#VOzu zZhNr4<8FCgDbSt|Q(mX1{c3=9{c2FZt2}dT2>g}`ywb%f*Pe*9h*07w0gQXZN@Jr%j%qhZtIv( zVW*!>*$!@Jm$tXyUlgM@6o_T4cq-EyNm=sbU_}bMggjALu|j|UfOgQezH`#P25UC1 zy1mQNh|Y9+(yBa`NUPtmA$atZ*U^0I&U@Ccy1lytwPP#e+>(n7SazC!&pa9O1^`+7 z8eY!Yo(-#4^;jF$tl8AH+1k8nbx#-D&O>uc_GPWa!_dU?87m>Lv;pMrIb8opPx5cx z%9Z*TU9*r@g!+BwCDS-CPF=1}{@QbYD^4*``Tx(WE diff --git a/plugins/dlsym.c b/plugins/dlsym.c index d827b768..2958b02e 100755 --- a/plugins/dlsym.c +++ b/plugins/dlsym.c @@ -5,26 +5,29 @@ #include #include #include +#include int main(int argc, char **argv) { char *file=NULL; void *dl= NULL; FILE *fp = NULL; + char path[PATH_MAX]; if (argc != 2) { printf("Usage: dlsym \n"); exit(0); } file = argv[1]; - fp = fopen(file, "rb"); + realpath(file, path); + fp = fopen(path, "rb"); if (!fp) { - printf("File not found."); + printf("File not found.\n"); exit(0); } - dl = dlopen(file, RTLD_NOW); + dl = dlopen(path, RTLD_NOW); if (dl) {