Commit 1e538cf0 authored by Pavel Emelyanov's avatar Pavel Emelyanov

dump: Drop unused image file perm change before sending it to parasite

Since we send _fd_ it's pointless to call chmod on image file.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 5ff01339
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "../protobuf/vma.pb-c.h" #include "../protobuf/vma.pb-c.h"
#define CR_FD_PERM (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH) #define CR_FD_PERM (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH)
#define CR_FD_PERM_DUMP (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
#define CRIU_VERSION_MAJOR 0 #define CRIU_VERSION_MAJOR 0
#define CRIU_VERSION_MINOR 3 #define CRIU_VERSION_MINOR 3
......
...@@ -318,22 +318,6 @@ static int parasite_send_fd(struct parasite_ctl *ctl, int fd) ...@@ -318,22 +318,6 @@ static int parasite_send_fd(struct parasite_ctl *ctl, int fd)
return 0; return 0;
} }
static int parasite_prep_file(int fd, struct parasite_ctl *ctl)
{
int ret;
if (fchmod(fd, CR_FD_PERM_DUMP)) {
pr_perror("Can't change permissions on file");
return -1;
}
ret = parasite_send_fd(ctl, fd);
if (ret)
return ret;
return 0;
}
static int parasite_set_logfd(struct parasite_ctl *ctl, pid_t pid) static int parasite_set_logfd(struct parasite_ctl *ctl, pid_t pid)
{ {
int ret; int ret;
...@@ -568,7 +552,7 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a ...@@ -568,7 +552,7 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a
pr_info("Dumping pages (type: %d pid: %d)\n", CR_FD_PAGES, ctl->pid); pr_info("Dumping pages (type: %d pid: %d)\n", CR_FD_PAGES, ctl->pid);
pr_info("----------------------------------------\n"); pr_info("----------------------------------------\n");
ret = parasite_prep_file(fdset_fd(cr_fdset, CR_FD_PAGES), ctl); ret = parasite_send_fd(ctl, fdset_fd(cr_fdset, CR_FD_PAGES));
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -632,7 +616,6 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a ...@@ -632,7 +616,6 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a
out_fini: out_fini:
parasite_execute(PARASITE_CMD_DUMPPAGES_FINI, ctl); parasite_execute(PARASITE_CMD_DUMPPAGES_FINI, ctl);
out: out:
fchmod(fdset_fd(cr_fdset, CR_FD_PAGES), CR_FD_PERM);
pr_info("----------------------------------------\n"); pr_info("----------------------------------------\n");
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment