Skip to content

Commit

Permalink
installing etc-cleanup tool in /usr/lib/firejail directory
Browse files Browse the repository at this point in the history
  • Loading branch information
netblue30 committed Feb 6, 2023
1 parent 82c244f commit e6f2374
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif

COMPLETIONDIRS = src/zsh_completion src/bash_completion

APPS = src/firecfg/firecfg src/firejail/firejail src/firemon/firemon src/profstats/profstats src/jailcheck/jailcheck
APPS = src/firecfg/firecfg src/firejail/firejail src/firemon/firemon src/profstats/profstats src/jailcheck/jailcheck src/etc-cleanup/etc-cleanup
SBOX_APPS = src/fbuilder/fbuilder src/ftee/ftee src/fids/fids
SBOX_APPS_NON_DUMPABLE = src/fcopy/fcopy src/fldd/fldd src/fnet/fnet src/fnetfilter/fnetfilter src/fzenity/fzenity
SBOX_APPS_NON_DUMPABLE += src/fsec-optimize/fsec-optimize src/fsec-print/fsec-print src/fseccomp/fseccomp
Expand Down Expand Up @@ -200,6 +200,7 @@ endif
install -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) $(SECCOMP_FILTERS)
install -m 0755 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS)
install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/profstats/profstats
install -m 0755 -t $(DESTDIR)$(libdir)/firejail src/etc-cleanup/etc-cleanup
# plugins w/o read permission (non-dumpable)
install -m 0711 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS_NON_DUMPABLE)
install -m 0711 -t $(DESTDIR)$(libdir)/firejail src/fshaper/fshaper.sh
Expand Down
12 changes: 3 additions & 9 deletions src/tools/cleanup_etc.c → src/etc-cleanup/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include "../include/etc_groups.h"
#define errExit(msg) do { char msgout[500]; sprintf(msgout, "Error %s:%s(%d)", msg, __FUNCTION__, __LINE__); perror(msgout); exit(1);} while (0)


#include "../include/common.h"
#include <stdarg.h>

#define MAX_BUF 4098
#define MAX_ARR 1024
Expand Down Expand Up @@ -223,7 +217,7 @@ static void usage(void) {
printf("Group and clean private-etc entries in one or more profile files.\n");
printf("Options:\n");
printf(" --debug - print debug messages\n");
printf(" --help - this help screen\n");
printf(" -h, -?, --help - this help screen\n");
printf(" --replace - replace profile file\n");
}

Expand Down
1 change: 1 addition & 0 deletions src/include/etc_groups.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#ifndef ETC_GROUPS_H
#define ETC_GROUPS_H
#include <stddef.h>

#define ETC_MAX 256

Expand Down

0 comments on commit e6f2374

Please sign in to comment.