create /usr/local for firecfg if the directory doesn't exist

This commit is contained in:
netblue30 2017-08-19 08:02:22 -04:00
parent 85bb547e40
commit ecf0794d2e
2 changed files with 21 additions and 0 deletions

View file

@ -13,6 +13,7 @@ firejail (0.9.49) baseline; urgency=low
* enhancement: support for newer Xpra versions (2.1+) -
set "xpra-attach yes" in /etc/firejail/firejail.config
* enhancement: all profiles use a standard layout style
* enhancement: create /usr/local for firecfg if the directory doesn't exist
* new profiles: curl, mplayer2, SMPlayer, Calibre, ebook-viewer, KWrite,
* new profiles: Geary, Liferea, peek, silentarmy, IntelliJ IDEA,
* new profiles: Android Studio, electron, riot-web, Extreme Tux Racer,

View file

@ -579,6 +579,26 @@ int main(int argc, char **argv) {
fprintf(stderr, "The proper way to run this command is \"sudo firecfg\".\n");
return 1;
}
else {
// create /usr/local directory if it doesn't exist (Solus distro)
struct stat s;
if (stat("/usr/local", &s) != 0) {
printf("Creating /usr/local directory\n");
int rv = mkdir("/usr/local", 0755);
if (rv != 0) {
fprintf(stderr, "Error: cannot create /usr/local directory\n");
return 1;
}
}
if (stat("/usr/local/bin", &s) != 0) {
printf("Creating /usr/local directory\n");
int rv = mkdir("/usr/local/bin", 0755);
if (rv != 0) {
fprintf(stderr, "Error: cannot create /usr/local/bin directory\n");
return 1;
}
}
}
set_links();