summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-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);