RedHat針對涉及預加載庫的Shellshock漏洞提供瞭解決方法。解決方法源代碼的URL位於bash_ld_preload.c。Shellshock Bash bug預加載解決方法
但是解決方法的步驟似乎已經失蹤了。這是一個糟糕的解決方案還是無解決方案
的代碼:
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
static void __attribute__ ((constructor)) strip_env(void);
extern char **environ;
static void strip_env()
{
char *p,*c;
int i = 0;
for (p = environ[i]; p!=NULL;i++) {
c = strstr(p,"=() {");
if (c != NULL) {
*(c+2) = '\0';
}
p = environ[i];
}
}
好了,_good_解決方案將可能繼續支持導出函數的地方究竟是誰想要/使用人。 – 2014-09-25 21:34:58
這個問題似乎是無關緊要的,因爲它是關於計算機安全的。 http://security.stackexchange.com/會更合適。 – 2014-09-26 05:46:49