[CRIU] [PATCH] dump: fix check for service dentries
Kinsbursky Stanislav
skinsbursky at openvz.org
Thu Mar 1 03:35:29 EST 2012
Without the patch all files,. starting from "." will be ommited.
Use of strcmp() is safe - look at kernel "filldir" function.
Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
cr-dump.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/cr-dump.c b/cr-dump.c
index b99e023..7d43b74 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -391,7 +391,9 @@ static int dump_task_files(pid_t pid, struct cr_fdset *cr_fdset,
struct fd_parms p;
int lfd;
- if (de->d_name[0] == '.')
+ if (!strcmp(de->d_name, "."))
+ continue;
+ if (!strcmp(de->d_name, ".."))
continue;
if (read_fd_params(pid, de->d_name, &p))
return -1;
More information about the CRIU
mailing list