diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-01-05 18:45:36 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-01-05 18:45:36 +0100 |
| commit | af1176274ac7c55a1402fbcab505e3b0bbb72414 (patch) | |
| tree | 8ce907ebca123b60afbdd84e86bc2a445bd10df3 /src/main.c | |
| parent | 4c2ef9947ae5c89f4bfb0b217d6653aa73b95ac2 (diff) | |
| download | box64-af1176274ac7c55a1402fbcab505e3b0bbb72414.tar.gz box64-af1176274ac7c55a1402fbcab505e3b0bbb72414.zip | |
Added more command to rcfiles, and a default one when system version is not found (and move some essential detection there)
Diffstat (limited to 'src/main.c')
| -rwxr-xr-x | src/main.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c index 229b38cc..310018f0 100755 --- a/src/main.c +++ b/src/main.c @@ -55,6 +55,7 @@ int box64_dynarec_safeflags = 1; int box64_dynarec_callret = 0; int box64_dynarec_hotpage = 16; int box64_dynarec_bleeding_edge = 1; +int box64_nosandbox = 0; uintptr_t box64_nodynarec_start = 0; uintptr_t box64_nodynarec_end = 0; #ifdef ARM64 @@ -1115,6 +1116,8 @@ static void load_rcfiles() { if(FileExist("/etc/box64.box64rc", IS_FILE)) LoadRCFile("/etc/box64.box64rc"); + else + LoadRCFile(NULL); // load default rcfile char* p = getenv("HOME"); if(p) { char tmp[4096]; @@ -1322,21 +1325,6 @@ int main(int argc, const char **argv, char **env) { if(box64_wine) { AddPath("libdl.so.2", &ld_preload, 0); } - // special case for steam that somehow seems to alter libudev opaque pointer (udev_monitor) - if(!strcmp(prgname, "steam")) { - printf_log(LOG_INFO, "steam detected...\n"); - box64_steam = 1; - } - // special case for steam-runtime-check-requirements to fake 64bits suport - if(strstr(prgname, "steam-runtime-check-requirements")==prgname) { - printf_log(LOG_INFO, "steam-runtime-check-requirements detected, faking All is good!\n"); - exit(0); // exiting, not testing anything - } - // special case for steamwebhelper - if(strstr(prgname, "steamwebhelper")==prgname) { - printf_log(LOG_INFO, "steamwebhelper, ignoring for now!\n"); - exit(0); // exiting - } // special case for zoom if(strstr(prgname, "zoom")==prgname) { printf_log(LOG_INFO, "Zoom detected, trying to use system libturbojpeg if possible\n"); @@ -1371,6 +1359,19 @@ int main(int argc, const char **argv, char **env) { my_context->argv[i] = box_strdup(argv[i+nextarg]); printf_log(LOG_INFO, "argv[%i]=\"%s\"\n", i, my_context->argv[i]); } + if(box64_nosandbox) + { + // check if sandbox is already there + int there = 0; + for(int i=1; i<my_context->argc && !there; ++i) + if(!strcmp(my_context->argv[i], "--no-sandbox")) + there = 1; + if(!there) { + my_context->argv = (char**)box_realloc(my_context->argv, (my_context->argc+1)*sizeof(char*)); + my_context->argv[my_context->argc] = box_strdup("--no-sandbox"); + my_context->argc++; + } + } // check if file exist if(!my_context->argv[0] || !FileExist(my_context->argv[0], IS_FILE)) { |