提交 8fe0cc77 编写于 作者: O openharmony_ci 提交者: Gitee

!344 对proc文件系统内的节点增加uid/gid管理

Merge pull request !344 from LeonChan/proc-uid
...@@ -89,6 +89,8 @@ struct ProcFileOperations { ...@@ -89,6 +89,8 @@ struct ProcFileOperations {
}; };
struct ProcDirEntry { struct ProcDirEntry {
uint uid;
uint gid;
mode_t mode; mode_t mode;
int flags; int flags;
const struct ProcFileOperations *procFileOps; const struct ProcFileOperations *procFileOps;
......
...@@ -60,11 +60,9 @@ static struct Vnode *EntryToVnode(struct ProcDirEntry *entry) ...@@ -60,11 +60,9 @@ static struct Vnode *EntryToVnode(struct ProcDirEntry *entry)
node->fop = &g_procfsFops; node->fop = &g_procfsFops;
node->data = entry; node->data = entry;
node->type = entry->type; node->type = entry->type;
if (node->type == VNODE_TYPE_DIR) { node->uid = entry->uid;
node->mode = S_IFDIR | PROCFS_DEFAULT_MODE; node->gid = entry->gid;
} else { node->mode = entry->mode;
node->mode = S_IFREG | PROCFS_DEFAULT_MODE;
}
return node; return node;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册