-
-
Save fxdgear/04add8e333e9f3025271 to your computer and use it in GitHub Desktop.
Checkinstall Malloc Patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/installwatch/installwatch.c b/installwatch/installwatch.c | |
index 8e6c616..9183f04 100644 | |
--- a/installwatch/installwatch.c | |
+++ b/installwatch/installwatch.c | |
@@ -64,6 +64,7 @@ | |
#define error(X) (X < 0 ? strerror(errno) : "success") | |
+int __installwatch_init = 0; | |
int __installwatch_refcount = 0; | |
int __installwatch_timecount = 0; | |
@@ -423,6 +424,8 @@ static void initialize(void) { | |
#endif | |
if(instw_init()) exit(-1); | |
+ | |
+ __installwatch_init = 1; | |
} | |
void _init(void) { | |
@@ -2968,6 +2971,14 @@ ssize_t readlink(const char *path,char *buf,size_t bufsiz) { | |
instw_t instw; | |
int status; | |
+ if ( __installwatch_init == 0 && | |
+ libc_handle == RTLD_NEXT && | |
+ strcmp(path, "/etc/malloc.conf") == 0 ) { | |
+ | |
+ errno = ENOENT; | |
+ return -1; | |
+ } | |
+ | |
if (!libc_handle) | |
initialize(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment