2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

Don't overwrite sigaction magic

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2011-12-01 17:15:00 +04:00
committed by Cyrill Gorcunov
parent 9a544596fe
commit baf69d6757
2 changed files with 9 additions and 0 deletions

View File

@@ -1051,6 +1051,7 @@ static int open_pipe(int pid, struct pipe_entry *e, int *pipes_fd)
static int prepare_sigactions(int pid)
{
u32 type = 0;
int fd_sigact, ret;
int sig, i;
struct sigaction act, oact;
@@ -1061,6 +1062,12 @@ static int prepare_sigactions(int pid)
return 1;
}
ret = read(fd_sigact, &type, sizeof(type));
if (ret != sizeof(type) || type != SIGACT_MAGIC) {
pr_perror("%d: Bad sigactions file\n", pid);
return 1;
}
for (sig = 1; sig < SIGMAX; sig++) {
if (sig == SIGKILL || sig == SIGSTOP)
continue;

View File

@@ -239,6 +239,8 @@ static int dump_sigact(parasite_args_cmd_dumpsigacts_t *args)
return ret;
}
sys_lseek(fd, MAGIC_OFFSET, SEEK_SET);
for (sig = 1; sig < SIGMAX; sig++) {
if (sig == SIGKILL || sig == SIGSTOP)
continue;