提交 c6b898ea 编写于 作者: M mucor

fix capabilities in write and execute case

Change-Id: Ic9abc53cd0aafa1fd6272fab8191493c609ea995
上级 62e708c7
......@@ -107,20 +107,21 @@ int VfsPermissionCheck(uint fuid, uint fgid, uint fileMode, int accMode)
tmpMode = 0;
if (S_ISDIR(fileMode)) {
if (((uint)accMode & EXEC_OP) && (IsCapPermit(CAP_DAC_READ_SEARCH))) {
if (IsCapPermit(CAP_DAC_EXECUTE)
|| (!((uint)accMode & WRITE_OP) && IsCapPermit(CAP_DAC_READ_SEARCH))) {
tmpMode |= EXEC_OP;
}
} else {
if (((uint)accMode & EXEC_OP) && (IsCapPermit(CAP_DAC_EXECUTE)) && (fileMode & MODE_IXUGO)) {
if (IsCapPermit(CAP_DAC_EXECUTE) && (fileMode & MODE_IXUGO)) {
tmpMode |= EXEC_OP;
}
}
if (((uint)accMode & WRITE_OP) && IsCapPermit(CAP_DAC_WRITE)) {
if (IsCapPermit(CAP_DAC_WRITE)) {
tmpMode |= WRITE_OP;
}
if (((uint)accMode & READ_OP) && IsCapPermit(CAP_DAC_READ_SEARCH)) {
if (IsCapPermit(CAP_DAC_READ_SEARCH)) {
tmpMode |= READ_OP;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册