feat: add uid/gid for ProcFs

close: #I3WGVP

Signed-off-by: chenwei <chenwei26@huawei.com>
This commit is contained in:
chenwei 2021-06-18 10:09:26 +08:00
parent e5a3ee6f33
commit 67806596a3
2 changed files with 5 additions and 5 deletions

View File

@ -89,6 +89,8 @@ struct ProcFileOperations {
};
struct ProcDirEntry {
uint uid;
uint gid;
mode_t mode;
int flags;
const struct ProcFileOperations *procFileOps;

View File

@ -60,11 +60,9 @@ static struct Vnode *EntryToVnode(struct ProcDirEntry *entry)
node->fop = &g_procfsFops;
node->data = entry;
node->type = entry->type;
if (node->type == VNODE_TYPE_DIR) {
node->mode = S_IFDIR | PROCFS_DEFAULT_MODE;
} else {
node->mode = S_IFREG | PROCFS_DEFAULT_MODE;
}
node->uid = entry->uid;
node->gid = entry->gid;
node->mode = entry->mode;
return node;
}