about summary refs log tree commit diff
path: root/pkgs/development/tools/unity3d/unity-nosuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/unity3d/unity-nosuid.c')
-rw-r--r--pkgs/development/tools/unity3d/unity-nosuid.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/pkgs/development/tools/unity3d/unity-nosuid.c b/pkgs/development/tools/unity3d/unity-nosuid.c
deleted file mode 100644
index 26a923ab03943..0000000000000
--- a/pkgs/development/tools/unity3d/unity-nosuid.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dlfcn.h>
-
-static const char sandbox_path[] = "/chrome-sandbox";
-
-int __xstat(int ver, const char* path, struct stat* stat_buf) {
-  static int (*original_xstat)(int, const char*, struct stat*) = NULL;
-  if (original_xstat == NULL) {
-    int (*fun)(int, const char*, struct stat*) = dlsym(RTLD_NEXT, "__xstat");
-    if (fun == NULL) {
-      return -1;
-    };
-    original_xstat = fun;
-  };
-
-  int res = (*original_xstat)(ver, path, stat_buf);
-  if (res == 0) {
-    char* pos = strstr(path, sandbox_path);
-    if (pos != NULL && *(pos + sizeof(sandbox_path) - 1) == '\0') {
-      printf("Lying about chrome-sandbox access rights...\n");
-      stat_buf->st_uid = 0;
-      stat_buf->st_gid = 0;
-      stat_buf->st_mode = 0104755;
-    };
-  }
-  return res;
-}