I have a copy of your earlier work (as it seems) and in the execve.c file, at the end you have:
if(!strcmp(argv[i], "-static")) // trying to statically compile a binary.. eww
{
// This works and removes the -static flag from the gcc execution but for some reason gcc throws a "not found error" with an empty string
// printf("gcc -static flag detected. overwriting -static flag\n");
// strncpy(argv[i], "", strlen(argv[i]));
// printf("-static flag overwritten\n");
// For now, let's just return a kernel memory error
// Sigh...
errno = ENOMEM;
return -1;
}
I think GCC returns error, because it gets it's argument/option/parameter which is empty now. And when it parses it, the parser does not recognize it as a option, starting with '-', so it decides it's a file to compile. But empty filename is "not found".
Just a wild guess... try to replace it with some pointless option like '-Wvarargs' (which is by default anyway).
I guess this should work...
(Sorry for not testing it myself, I was just reading what you've done there and I though to share my wild guess, but I do not have time or need to try it myself)
I have a copy of your earlier work (as it seems) and in the execve.c file, at the end you have:
I think GCC returns error, because it gets it's argument/option/parameter which is empty now. And when it parses it, the parser does not recognize it as a option, starting with '-', so it decides it's a file to compile. But empty filename is "not found". Just a wild guess... try to replace it with some pointless option like '-Wvarargs' (which is by default anyway). I guess this should work...
(Sorry for not testing it myself, I was just reading what you've done there and I though to share my wild guess, but I do not have time or need to try it myself)