aboutsummaryrefslogtreecommitdiffstats
path: root/src/firecfg
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2022-03-05 07:31:11 -0500
committerLibravatar GitHub <noreply@github.com>2022-03-05 07:31:11 -0500
commitbaeec77b760cb7789dba99f885d0d65a817a335b (patch)
tree5c9232a95b0d163e74d70c10759e0eb73b64d95f /src/firecfg
parentwhitelist /usr/share/gnupg2 for consistency (#5007) (diff)
parentAdd ability to disable user profiles at compile time. (diff)
downloadfirejail-baeec77b760cb7789dba99f885d0d65a817a335b.tar.gz
firejail-baeec77b760cb7789dba99f885d0d65a817a335b.tar.zst
firejail-baeec77b760cb7789dba99f885d0d65a817a335b.zip
Merge pull request #4990 from chestnykh/user_profiles
Add ability to disable user profiles at compile time.
Diffstat (limited to 'src/firecfg')
-rw-r--r--src/firecfg/desktop_files.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/firecfg/desktop_files.c b/src/firecfg/desktop_files.c
index d434cb95e..408662907 100644
--- a/src/firecfg/desktop_files.c
+++ b/src/firecfg/desktop_files.c
@@ -24,11 +24,16 @@
24static int check_profile(const char *name, const char *homedir) { 24static int check_profile(const char *name, const char *homedir) {
25 // build profile name 25 // build profile name
26 char *profname1; 26 char *profname1;
27#ifndef HAVE_ONLY_SYSCFG_PROFILES
27 char *profname2; 28 char *profname2;
29#endif
28 if (asprintf(&profname1, "%s/%s.profile", SYSCONFDIR, name) == -1) 30 if (asprintf(&profname1, "%s/%s.profile", SYSCONFDIR, name) == -1)
29 errExit("asprintf"); 31 errExit("asprintf");
32
33#ifndef HAVE_ONLY_SYSCFG_PROFILES
30 if (asprintf(&profname2, "%s/.config/firejail/%s.profile", homedir, name) == -1) 34 if (asprintf(&profname2, "%s/.config/firejail/%s.profile", homedir, name) == -1)
31 errExit("asprintf"); 35 errExit("asprintf");
36#endif
32 37
33 int rv = 0; 38 int rv = 0;
34 if (access(profname1, R_OK) == 0) { 39 if (access(profname1, R_OK) == 0) {
@@ -36,14 +41,18 @@ static int check_profile(const char *name, const char *homedir) {
36 printf("found %s\n", profname1); 41 printf("found %s\n", profname1);
37 rv = 1; 42 rv = 1;
38 } 43 }
44#ifndef HAVE_ONLY_SYSCFG_PROFILES
39 else if (access(profname2, R_OK) == 0) { 45 else if (access(profname2, R_OK) == 0) {
40 if (arg_debug) 46 if (arg_debug)
41 printf("found %s\n", profname2); 47 printf("found %s\n", profname2);
42 rv = 1; 48 rv = 1;
43 } 49 }
50#endif
44 51
45 free(profname1); 52 free(profname1);
53#ifndef HAVE_ONLY_SYSCFG_PROFILES
46 free(profname2); 54 free(profname2);
55#endif
47 return rv; 56 return rv;
48} 57}
49 58