uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
32
pkgs/development/tools/unity3d/unity-nosuid.c
Normal file
32
pkgs/development/tools/unity3d/unity-nosuid.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue