diff options
author | netblue30 <netblue30@yahoo.com> | 2017-08-19 08:02:22 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-08-19 08:02:22 -0400 |
commit | ecf0794d2eae0201e9888e7b9228f8fef3e94fc6 (patch) | |
tree | e445175fde480818961df75b12f7371096bab6ae /src/firecfg | |
parent | Postpone installation of seccomp filters just before execve (diff) | |
download | firejail-ecf0794d2eae0201e9888e7b9228f8fef3e94fc6.tar.gz firejail-ecf0794d2eae0201e9888e7b9228f8fef3e94fc6.tar.zst firejail-ecf0794d2eae0201e9888e7b9228f8fef3e94fc6.zip |
create /usr/local for firecfg if the directory doesn't exist
Diffstat (limited to 'src/firecfg')
-rw-r--r-- | src/firecfg/main.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/firecfg/main.c b/src/firecfg/main.c index 8e5b5e6fa..1ecfbf524 100644 --- a/src/firecfg/main.c +++ b/src/firecfg/main.c | |||
@@ -579,6 +579,26 @@ int main(int argc, char **argv) { | |||
579 | fprintf(stderr, "The proper way to run this command is \"sudo firecfg\".\n"); | 579 | fprintf(stderr, "The proper way to run this command is \"sudo firecfg\".\n"); |
580 | return 1; | 580 | return 1; |
581 | } | 581 | } |
582 | else { | ||
583 | // create /usr/local directory if it doesn't exist (Solus distro) | ||
584 | struct stat s; | ||
585 | if (stat("/usr/local", &s) != 0) { | ||
586 | printf("Creating /usr/local directory\n"); | ||
587 | int rv = mkdir("/usr/local", 0755); | ||
588 | if (rv != 0) { | ||
589 | fprintf(stderr, "Error: cannot create /usr/local directory\n"); | ||
590 | return 1; | ||
591 | } | ||
592 | } | ||
593 | if (stat("/usr/local/bin", &s) != 0) { | ||
594 | printf("Creating /usr/local directory\n"); | ||
595 | int rv = mkdir("/usr/local/bin", 0755); | ||
596 | if (rv != 0) { | ||
597 | fprintf(stderr, "Error: cannot create /usr/local/bin directory\n"); | ||
598 | return 1; | ||
599 | } | ||
600 | } | ||
601 | } | ||
582 | set_links(); | 602 | set_links(); |
583 | 603 | ||
584 | 604 | ||