linux ntp漏洞升级,SUSE Linux ntp 升级报错(MAKE [1]:*** 【all】Error 2)

NTP升级,升级RedHat时很顺利,升级完成后会默认覆盖掉原有文件,重启服务后,使用ntpd --version查看验证上即可,可在升级SUSE Linux时却发现错误频频,以下是我再升级时遇到的一些问题,小结之后希望有和我遇到同样错误的亲们可以作为参考:

一. 由于NTP包有漏洞,需下载4.2.7之后版本,网络下ntp-dev-4.2.7p26.tar.gz

1.解压

#  tar –zxf  ntp-dev-4.2.7p26.tar.gz –C /usr/src

2.编译

#  cd/usr/src/ntp-dev-4.2.7p26

#./configure --prefix=/usr/local/ntp-dev-4.2.7p26--enable-all-clocks --enable-parse-clocks

如果生成Makefile文件时报错,提示信息为usge –-host skip在./configure 参数后添加--host=x86_64,这个参数(x86_64)来源于uname –m后得出的结果

3. #make 如果make报错,信息如下

ntp_loopfilter.c: In function ‘local_clock’:

ntp_loopfilter.c:516: error: ‘MOD_NANO’ undeclared (first use in this function)

ntp_loopfilter.c:516: error: (Each undeclaredidentifier is reported only once

ntp_loopfilter.c:516: error: for each function itappears in.)

make[3]: *** [ntp_loopfilter.o] Error 1

make[3]: Leaving directory`/usr/src/ntp-dev-4.2.7p26/ntpd'

make[2]: *** [all] Error 2

make[2]: Leaving directory`/usr/src/ntp-dev-4.2.7p26/ntpd'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/usr/src/ntp-dev-4.2.7p26'

make: *** [all] Error 2

解决方法如下:

vim include/ntp_syscall.h.patch

--- ntp-4.2.4p7/include/ntp_syscall.h

+++ ntp-4.2.4p7/include/ntp_syscall.h

@@ -14,5+14,13 @@

#include

#endif

+#if defined(ADJ_NANO) && !defined(MOD_NANO)

+#define MOD_NANO ADJ_NANO

+#endif

+

+#if defined(ADJ_TAI) && !defined(MOD_TAI)

+#define MOD_TAI ADJ_TAI

+#endif

+

#ifndefNTP_SYSCALLS_LIBC

#ifdefNTP_SYSCALLS_STD

# cd include

# patch -p0 < ntp_syscall.h.patch

patch file to:ntp_syscall.h

# cd ..

# make && make install

编译安装OK

4.生成环境变量

# echo '#ntp seting' >>  /etc/profile.local

# echo 'export PATH=$PATH:/usr/local/ntp/bin'>>  /etc/profile.local

#echo /usr/local/ntp/bin/ntpd -c /etc/ntp.conf -p/tmp/ntpd.pid >> /etc/profile.local

# source /etc/profile.local

5 验证

# ntpd –version

版本已升级为4.2.7p26

ps:

vim include/ntp_syscall.h.patch ,里的内容有的需要缩进,以#开关内容须缩进

--------------------------------------分割线 --------------------------------------

--------------------------------------分割线 --------------------------------------

0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值