From 67806596a3c0df9a54893d8c74ebe9da98d7fb06 Mon Sep 17 00:00:00 2001 From: chenwei Date: Fri, 18 Jun 2021 10:09:26 +0800 Subject: [PATCH] feat: add uid/gid for ProcFs close: #I3WGVP Signed-off-by: chenwei --- fs/proc/include/proc_fs.h | 2 ++ fs/proc/os_adapt/proc_vfs.c | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/proc/include/proc_fs.h b/fs/proc/include/proc_fs.h index c519db91..ed1f6fcb 100644 --- a/fs/proc/include/proc_fs.h +++ b/fs/proc/include/proc_fs.h @@ -89,6 +89,8 @@ struct ProcFileOperations { }; struct ProcDirEntry { + uint uid; + uint gid; mode_t mode; int flags; const struct ProcFileOperations *procFileOps; diff --git a/fs/proc/os_adapt/proc_vfs.c b/fs/proc/os_adapt/proc_vfs.c index 00cfb7ac..7cabbaf9 100644 --- a/fs/proc/os_adapt/proc_vfs.c +++ b/fs/proc/os_adapt/proc_vfs.c @@ -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; } -- GitLab