1 Star 0 Fork 35

hd_zhoujie/criu

forked from src-openEuler/criu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0066-zdtm-print-more-info-for-fs.c.patch 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
river 提交于 2022-04-13 15:05 . criu: backport kinds of features/bugfix
From af97bc76b1dc1e6ca2b924d7e5666dd04a1847b2 Mon Sep 17 00:00:00 2001
From: "fu.lin" <fulin10@huawei.com>
Date: Wed, 16 Feb 2022 10:39:06 +0800
Subject: [PATCH 66/72] zdtm: print more info for fs.c
---
test/zdtm/lib/fs.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/test/zdtm/lib/fs.c b/test/zdtm/lib/fs.c
index 7b8be5f..a716b40 100644
--- a/test/zdtm/lib/fs.c
+++ b/test/zdtm/lib/fs.c
@@ -4,6 +4,7 @@
#include <errno.h>
#include <unistd.h>
#include <limits.h>
+#include <sys/stat.h>
#include "zdtmtst.h"
#include "fs.h"
@@ -103,11 +104,15 @@ int get_cwd_check_perm(char **result)
}
if (access(cwd, X_OK)) {
- pr_err("access check for bit X for current dir path '%s' "
- "failed for uid:%d,gid:%d, error: %d(%s). "
+ struct stat sb;
+
+ stat(cwd, &sb);
+ pr_err("access check for bit X for current dir path '%s'(uid:%d,gid:%d,mode:%o) "
+ "failed for uid:%d,gid:%d,euid:%d, error: %d(%s). "
"Bit 'x' should be set in all path components of "
"this directory\n",
- cwd, getuid(), getgid(), errno, strerror(errno));
+ cwd, sb.st_uid, sb.st_gid, sb.st_mode, getuid(), getgid(),
+ geteuid(), errno, strerror(errno));
return -1;
}
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hd-zhoujie/criu.git
git@gitee.com:hd-zhoujie/criu.git
hd-zhoujie
criu
criu
master

搜索帮助