summaryrefslogtreecommitdiff
path: root/pkg/launcher
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-02-14 23:54:20 +0100
committerKali Kaneko <kali@leap.se>2018-02-15 16:36:59 +0100
commitbf12655dffd3ec6db77e3d139bca734b09faff22 (patch)
tree9e2b0b272758337c16fade682695e525c06ae554 /pkg/launcher
parent5abd127f3780ca2078962ace489bd4c32b5d545d (diff)
[pkg] add --no-pie to CFLAGS for wrapper
-Resolves: #9232
Diffstat (limited to 'pkg/launcher')
-rw-r--r--pkg/launcher/Makefile4
-rw-r--r--pkg/launcher/bitmask-launcher.c11
2 files changed, 7 insertions, 8 deletions
diff --git a/pkg/launcher/Makefile b/pkg/launcher/Makefile
index 8948e6b4..2114ec99 100644
--- a/pkg/launcher/Makefile
+++ b/pkg/launcher/Makefile
@@ -1,5 +1,5 @@
CC = gcc
-CFLAGS = -g -Wall -fPIE
+CFLAGS = -g -Wall -no-pie -fstack-protector-strong
STRIP = strip
default: bitmask
@@ -8,7 +8,7 @@ bitmask.o: bitmask-launcher.c
$(CC) $(CFLAGS) -c bitmask-launcher.c -o bitmask.o
bitmask: bitmask.o
- $(CC) bitmask.o -o bitmask
+ $(CC) $(CFLAGS) bitmask.o -o bitmask
$(STRIP) bitmask
clean:
-rm -f bitmask.o
diff --git a/pkg/launcher/bitmask-launcher.c b/pkg/launcher/bitmask-launcher.c
index b9bda1c2..09f5fe21 100644
--- a/pkg/launcher/bitmask-launcher.c
+++ b/pkg/launcher/bitmask-launcher.c
@@ -16,24 +16,23 @@
#include <stdio.h>
#include <string.h>
-#define MAXBUFFSIZE 1024
+#define MAXBUFSIZE 1024
char* const lib = "/lib";
-char* const entrypoint = "app";
+char* const entrypoint = "bitmask";
char* const linkname = "/proc/self/exe";
int main(int argc, char *argv[])
{
- char buf[MAXBUFFSIZE];
- char pth[MAXBUFFSIZE];
+ char buf[MAXBUFSIZE];
+ char pth[MAXBUFSIZE];
char *dirc, *dname;
- const size_t bufsize = MAXBUFFSIZE + 1;
argv[0] = entrypoint;
buf[0] = 0;
pth[0] = 0;
- readlink(linkname, buf, bufsize - 1);
+ readlink(linkname, buf, MAXBUFSIZE);
dirc = strdup(buf);
dname = dirname(dirc);