Changeset 2461
- Timestamp:
- Jun 20, 2008, 8:05:13 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/zzuf.c
r2345 r2461 918 918 HANDLE pid; 919 919 void *epaddr; 920 #endif921 920 int ret; 921 #endif 922 922 923 923 #if defined HAVE_FORK … … 971 971 972 972 #if defined HAVE_FORK 973 /* M eaningless but makes sure there is space for everything*/973 /* Make sure there is space for everything we might do. */ 974 974 libpath = malloc(len + strlen(LIBDIR "/.libs/" FILENAME EXTRAINFO) + 1); 975 975 strcpy(libpath, opts->oldargv[0]); 976 976 977 /* Replace "/path/binaryname" with "/path/.libs/libzzuf.$(EXT)"978 * and "binaryname" with ".libs/libzzuf.$(EXT)"979 * Write the result in libpath. */977 /* If the binary name contains a '/', we look for a libzzuf in the 978 * same directory. Otherwise, we only look into the system directory 979 * to avoid shared library attacks. Write the result in libpath. */ 980 980 tmp = strrchr(libpath, '/'); 981 strcpy(tmp ? tmp + 1 : libpath, ".libs/" FILENAME); 982 983 ret = access(libpath, R_OK); 984 if(ret < 0) 981 if(tmp) 982 { 983 strcpy(tmp + 1, ".libs/" FILENAME); 984 if(access(libpath, R_OK) < 0) 985 strcpy(libpath, LIBDIR "/" FILENAME); 986 } 987 else 985 988 strcpy(libpath, LIBDIR "/" FILENAME); 986 989
Note: See TracChangeset
for help on using the changeset viewer.