-
Notifications
You must be signed in to change notification settings - Fork 1
/
fix.sh
executable file
·46 lines (35 loc) · 1.04 KB
/
fix.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Program to detect CVE-2024-2961 and Mitigate
# Matt Perkins 24-4-2024
# Check for GLIBC
# Path to iconv
ICONVPATH='/usr/lib/x86_64-linux-gnu/gconv'
if [ -d $ICONVPATH ]; then
echo "$ICONVPATH found. "
else
echo "$ICONVPATH not found please edit."
exit
fi
CHECKGLIBC=`ldd --version | grep GLIBC`
SUB="GLIBC"
if [[ "$CHECKGLIBC" =~ .*"$SUB".* ]]; then
echo Checking for $SUB - $CHECKGLIBC Found.
else
echo Checking for $SUB - $CHECKGLIBC not found.
echo Nothing to display.
fi
# Check for spcific Chinese Fonts
CHECKICONV=`iconv -l | grep -E 'CN-?EXT'`
SUB="EXT"
echo -n Checking for fonts .
if [[ "$CHECKICONV" =~ .*"$SUB".* ]]; then
echo $CHECKICONV found.
else
echo not found.
echo nothing to do.
exit
fi
grep -v -E 'CN-?EXT' <$ICONVPATH/gconv-modules.d/gconv-modules-extra.conf >$ICONVPATH/gconv-modules.d/gconv-modules-extra.conf.new
mv -f $ICONVPATH/gconv-modules.d/gconv-modules-extra.conf.new $ICONVPATH/gconv-modules.d/gconv-modules-extra.conf
iconvconfig
echo Where all done if your it doubt run it agian.