From a7cfa7e34930d3cd153c58d911f49e8957e4dc29 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Wed, 26 Oct 2022 14:32:39 +1100 Subject: [PATCH] using a macro for library name --- tarmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tarmap.c b/tarmap.c index e61e788..279b234 100644 --- a/tarmap.c +++ b/tarmap.c @@ -5,6 +5,9 @@ #include #define MAXSIZE 1000000 + +#define LIBTARMAP "libtarmap-0.so" + // Add/create string to end of env var with colon separation static char *makeEnv(char *name,char *value) { static char buffer[ MAXSIZE ]; // new variable value @@ -54,7 +57,7 @@ int main(int argc,char *argv[],char *envp[]) { } char **nenvp = (char**) calloc( sizeof( char* ), n+1 ); memcpy( nenvp, envp, n * sizeof( char*) ); - nenvp[ i_preload ] = makeEnv( "LD_PRELOAD", "libtarmap.so" ); + nenvp[ i_preload ] = makeEnv( "LD_PRELOAD", LIBTARMAP ); nenvp[ i_tarmap ] = makeEnv( "TARMAP", argv[1] ); execve( "/bin/bash", argv+1, nenvp ); perror( "tarmap exec" ); -- 2.47.2