diff options
author | netblue30 <netblue30@yahoo.com> | 2015-11-14 13:20:47 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-11-14 13:20:47 -0500 |
commit | d3cbab9b3cf9bdfc0af94830fa2b7b373f7f66de (patch) | |
tree | 15f63a41ca510caea6dbf1951f74c1e9c209b9db /src | |
parent | firefox profile (diff) | |
download | firejail-d3cbab9b3cf9bdfc0af94830fa2b7b373f7f66de.tar.gz firejail-d3cbab9b3cf9bdfc0af94830fa2b7b373f7f66de.tar.zst firejail-d3cbab9b3cf9bdfc0af94830fa2b7b373f7f66de.zip |
fixed sysconfdir
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/Makefile.in | 4 | ||||
-rw-r--r-- | src/firejail/main.c | 4 | ||||
-rw-r--r-- | src/firejail/profile.c | 2 | ||||
-rw-r--r-- | src/firejail/restricted_shell.c | 6 |
4 files changed, 11 insertions, 5 deletions
diff --git a/src/firejail/Makefile.in b/src/firejail/Makefile.in index 255784ac7..c2663f1a9 100644 --- a/src/firejail/Makefile.in +++ b/src/firejail/Makefile.in | |||
@@ -3,6 +3,7 @@ all: firejail | |||
3 | prefix=@prefix@ | 3 | prefix=@prefix@ |
4 | exec_prefix=@exec_prefix@ | 4 | exec_prefix=@exec_prefix@ |
5 | libdir=@libdir@ | 5 | libdir=@libdir@ |
6 | sysconfdir=@sysconfdir@ | ||
6 | 7 | ||
7 | VERSION=@PACKAGE_VERSION@ | 8 | VERSION=@PACKAGE_VERSION@ |
8 | NAME=@PACKAGE_NAME@ | 9 | NAME=@PACKAGE_NAME@ |
@@ -12,11 +13,12 @@ HAVE_CHROOT=@HAVE_CHROOT@ | |||
12 | HAVE_BIND=@HAVE_BIND@ | 13 | HAVE_BIND=@HAVE_BIND@ |
13 | HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@ | 14 | HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@ |
14 | 15 | ||
16 | |||
15 | H_FILE_LIST = $(wildcard *.[h]) | 17 | H_FILE_LIST = $(wildcard *.[h]) |
16 | C_FILE_LIST = $(wildcard *.c) | 18 | C_FILE_LIST = $(wildcard *.c) |
17 | OBJS = $(C_FILE_LIST:.c=.o) | 19 | OBJS = $(C_FILE_LIST:.c=.o) |
18 | BINOBJS = $(foreach file, $(OBJS), $file) | 20 | BINOBJS = $(foreach file, $(OBJS), $file) |
19 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(prefix)"' -DLIBDIR='"$(libdir)"' $(HAVE_SECCOMP) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_BIND) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security | 21 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_SECCOMP) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_BIND) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security |
20 | LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread | 22 | LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread |
21 | 23 | ||
22 | %.o : %.c $(H_FILE_LIST) | 24 | %.o : %.c $(H_FILE_LIST) |
diff --git a/src/firejail/main.c b/src/firejail/main.c index 601999db5..3a2da0852 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -1222,7 +1222,7 @@ int main(int argc, char **argv) { | |||
1222 | } | 1222 | } |
1223 | if (!custom_profile) { | 1223 | if (!custom_profile) { |
1224 | // look for a user profile in /etc/firejail directory | 1224 | // look for a user profile in /etc/firejail directory |
1225 | int rv = profile_find(cfg.command_name, "/etc/firejail"); | 1225 | int rv = profile_find(cfg.command_name, SYSCONFDIR); |
1226 | custom_profile = rv; | 1226 | custom_profile = rv; |
1227 | } | 1227 | } |
1228 | } | 1228 | } |
@@ -1252,7 +1252,7 @@ int main(int argc, char **argv) { | |||
1252 | 1252 | ||
1253 | if (!custom_profile) { | 1253 | if (!custom_profile) { |
1254 | // look for the profile in /etc/firejail directory | 1254 | // look for the profile in /etc/firejail directory |
1255 | custom_profile = profile_find(profile_name, "/etc/firejail"); | 1255 | custom_profile = profile_find(profile_name, SYSCONFDIR); |
1256 | } | 1256 | } |
1257 | 1257 | ||
1258 | if (custom_profile && !arg_quiet) | 1258 | if (custom_profile && !arg_quiet) |
diff --git a/src/firejail/profile.c b/src/firejail/profile.c index 5ab6bc776..de89cf40f 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c | |||
@@ -429,7 +429,7 @@ void profile_read(const char *fname) { | |||
429 | // open profile file: | 429 | // open profile file: |
430 | FILE *fp = fopen(fname, "r"); | 430 | FILE *fp = fopen(fname, "r"); |
431 | if (fp == NULL) { | 431 | if (fp == NULL) { |
432 | fprintf(stderr, "Error: cannot open profile file\n"); | 432 | fprintf(stderr, "Error: cannot open profile file %s\n", fname); |
433 | exit(1); | 433 | exit(1); |
434 | } | 434 | } |
435 | 435 | ||
diff --git a/src/firejail/restricted_shell.c b/src/firejail/restricted_shell.c index 72354d71b..5b1ce12e0 100644 --- a/src/firejail/restricted_shell.c +++ b/src/firejail/restricted_shell.c | |||
@@ -27,7 +27,11 @@ int restricted_shell(const char *user) { | |||
27 | assert(user); | 27 | assert(user); |
28 | 28 | ||
29 | // open profile file: | 29 | // open profile file: |
30 | FILE *fp = fopen("/etc/firejail/login.users", "r"); | 30 | char *fname; |
31 | if (asprintf(&fname, "%s/login.users", SYSCONFDIR) == -1) | ||
32 | errExit("asprintf"); | ||
33 | FILE *fp = fopen(fname, "r"); | ||
34 | free(fname); | ||
31 | if (fp == NULL) | 35 | if (fp == NULL) |
32 | return 0; | 36 | return 0; |
33 | 37 | ||