今日,git爆出遠程執行代碼漏洞(CVE-2016-2324),攻擊者可利用這個漏洞來引發目標系統的緩衝區溢出,從而在目標主機中實現遠程代碼執行。viagit
雖然尚未嘗試,可是升升級老是好的。centos
# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel # yum install gcc perl-ExtUtils-MakeMaker
# cd /usr/src # wget https://www.kernel.org/pub/software/scm/git/git-2.7.3.tar.gz # tar xzf git-2.7.0.tar.gz
# cd git-2.7.0 # make prefix=/usr/local/git all # make prefix=/usr/local/git install # echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc # source /etc/bashrc
# git --version
centos自帶git,7.x版本自帶git 1.8.3.1(應該是,也可能不是),安裝新版本以前須要使用yun remove git
卸載(安裝後卸載也能夠)。bash
執行make prefix=/usr/local/git all
時,可能會報錯:make: * [git-credential-store] Error 1,此時能夠使用如下命令代替curl
# ./configure --without-iconv # make CFLAGS=-liconv prefix=/usr/local/git all # make CFLAGS=-liconv prefix=/usr/local/git install
能夠成功安裝和使用,不知道有沒有啥反作用。url