如何更改文件 /data/misc/dhcp/dhcp6c_duid的other组的读写 权限
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
默认情况下, 文件/data/misc/dhcp/dhcp6c_duid的other组是有读写权限的,出于安全的考量,客户要求取消其读写
权限。
[SOLUTION]
去除/data/misc/dhcp/dhcp6c_duid的other组有读写权限,可以像下面这样修改:
1)将alps/external/dhcpcd/dhcpcd.c第2069行
pidfd = open(pidfile, O_WRONLY | O_CREAT | O_NONBLOCK, 0664);
改为
pidfd = open(pidfile, O_WRONLY | O_CREAT | O_NONBLOCK, 0660);
2)将alps/external/dhcpcd/dhcp.c第1133行
fd = open(iface->leasefile, O_WRONLY | O_CREAT | O_TRUNC, 0444);
改为
fd = open(iface->leasefile, O_WRONLY | O_CREAT | O_TRUNC, 0440);
第1138行
fd = open(iface->leasefile, O_WRONLY | O_CREAT | O_TRUNC, 0444);
也改为
fd = open(iface->leasefile, O_WRONLY | O_CREAT | O_TRUNC, 0440);
3)修改alps/external/wide-dhcpv6/common.c 在1006加上一句:
umask(007);