aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-01-25 01:37:40 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-01-27 23:58:30 -0300
commitc7c4f57d13b0e5720ee672a1761663d739d0bffa (patch)
tree11d8692f19391c2df62a573531f2e6b2d859dab6 /contrib
parentbuild: move syntax files to contrib/syntax/files (diff)
downloadfirejail-c7c4f57d13b0e5720ee672a1761663d739d0bffa.tar.gz
firejail-c7c4f57d13b0e5720ee672a1761663d739d0bffa.tar.zst
firejail-c7c4f57d13b0e5720ee672a1761663d739d0bffa.zip
build: auto-generate syntax lists
Changes: * Use the commands from contrib/vim/syntax/firejail.vim to create makefile targets to generate syntax lists in contrib/syntax/lists * Add contrib/syntax/files/example.in as an example of how to generate syntax files * Generate and add the syntax lists, to make it easier to spot if they are properly updated when a new command is added or if their recipes also need changes * Add "syntax" and "contrib" makefile targets Note: The generation commands are executed mostly silently to avoid generating too much noise when also making other targets. Note2: In some generation commands, a `$$` escape is used to pass `$` to the shell, to avoid being interpreted by make as the start of a macro. Note3: `@make_input@` is used in example.in to make it clear that the file is generated (and that it is generated by make rather than configure), similarly to how `@configure_input@` is used in configure input files. See also apparmor.vim: $ head -n 2 /usr/share/vim/vimfiles/syntax/apparmor.vim " generated from apparmor.vim.in by create-apparmor.vim.py " do not edit this file - edit apparmor.vim.in or create-apparmor.vim.py instead Environment: apparmor 3.1.2-1 on Artix Linux. Relates to #2679 #5502 #5577 #5612.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/syntax/files/example.in16
-rw-r--r--contrib/syntax/lists/profile_commands_arg0.list50
-rw-r--r--contrib/syntax/lists/profile_commands_arg1.list76
-rw-r--r--contrib/syntax/lists/profile_conditionals.list9
-rw-r--r--contrib/syntax/lists/profile_macros.list10
-rw-r--r--contrib/syntax/lists/syscall_groups.list29
-rw-r--r--contrib/syntax/lists/syscalls.list454
-rw-r--r--contrib/syntax/lists/system_errnos.list135
8 files changed, 779 insertions, 0 deletions
diff --git a/contrib/syntax/files/example.in b/contrib/syntax/files/example.in
new file mode 100644
index 000000000..74bcdc079
--- /dev/null
+++ b/contrib/syntax/files/example.in
@@ -0,0 +1,16 @@
1# @make_input@
2# Example file to check the values of input variables.
3
4FJ_PROFILE_COMMANDS_ARG0 = @FJ_PROFILE_COMMANDS_ARG0@
5
6FJ_PROFILE_COMMANDS_ARG1 = @FJ_PROFILE_COMMANDS_ARG1@
7
8FJ_PROFILE_CONDITIONALS = @FJ_PROFILE_CONDITIONALS@
9
10FJ_PROFILE_MACROS = @FJ_PROFILE_MACROS@
11
12FJ_SYSCALLS = @FJ_SYSCALLS@
13
14FJ_SYSCALL_GROUPS = @FJ_SYSCALL_GROUPS@
15
16FJ_SYSTEM_ERRNOS = @FJ_SYSTEM_ERRNOS@
diff --git a/contrib/syntax/lists/profile_commands_arg0.list b/contrib/syntax/lists/profile_commands_arg0.list
new file mode 100644
index 000000000..a402671a6
--- /dev/null
+++ b/contrib/syntax/lists/profile_commands_arg0.list
@@ -0,0 +1,50 @@
1allow-debuggers
2allusers
3apparmor
4apparmor-replace
5apparmor-stack
6caps
7deterministic-exit-code
8deterministic-shutdown
9disable-mnt
10ipc-namespace
11keep-config-pulse
12keep-dev-shm
13keep-var-tmp
14machine-id
15memory-deny-write-execute
16netfilter
17netlock
18no3d
19noautopulse
20nodbus
21nodvd
22nogroups
23noinput
24nonewprivs
25noprinters
26noroot
27nosound
28notv
29nou2f
30novideo
31overlay
32overlay-tmpfs
33private
34private-cache
35private-cwd
36private-dev
37private-etc
38private-lib
39private-tmp
40quiet
41restrict-namespaces
42seccomp
43seccomp\.block-secondary
44tab
45tracelog
46writable-etc
47writable-run-user
48writable-var
49writable-var-log
50x11
diff --git a/contrib/syntax/lists/profile_commands_arg1.list b/contrib/syntax/lists/profile_commands_arg1.list
new file mode 100644
index 000000000..c703f2257
--- /dev/null
+++ b/contrib/syntax/lists/profile_commands_arg1.list
@@ -0,0 +1,76 @@
1apparmor
2bind
3blacklist
4blacklist-nolog
5caps.drop
6caps.keep
7cpu
8dbus-system.broadcast
9dbus-system.call
10dbus-system.own
11dbus-system.see
12dbus-system.talk
13dbus-user.broadcast
14dbus-user.call
15dbus-user.own
16dbus-user.see
17dbus-user.talk
18defaultgw
19dns
20env
21hostname
22hosts-file
23ignore
24include
25ip
26ip6
27iprange
28join-or-start
29keep-fd
30mac
31mkdir
32mkfile
33mtu
34name
35net
36netfilter
37netfilter6
38netmask
39netns
40nice
41noblacklist
42noexec
43nowhitelist
44overlay-named
45private
46private-bin
47private-cwd
48private-etc
49private-home
50private-lib
51private-opt
52private-srv
53protocol
54read-only
55read-write
56restrict-namespaces
57rlimit-as
58rlimit-cpu
59rlimit-fsize
60rlimit-nofile
61rlimit-nproc
62rlimit-sigpending
63rmenv
64seccomp
65seccomp-error-action
66seccomp.32
67seccomp.32.drop
68seccomp.32.keep
69seccomp.drop
70seccomp.keep
71timeout
72tmpfs
73veth-name
74whitelist
75whitelist-ro
76xephyr-screen
diff --git a/contrib/syntax/lists/profile_conditionals.list b/contrib/syntax/lists/profile_conditionals.list
new file mode 100644
index 000000000..2cae76c96
--- /dev/null
+++ b/contrib/syntax/lists/profile_conditionals.list
@@ -0,0 +1,9 @@
1ALLOW_TRAY
2BROWSER_ALLOW_DRM
3BROWSER_DISABLE_U2F
4HAS_APPIMAGE
5HAS_NET
6HAS_NODBUS
7HAS_NOSOUND
8HAS_PRIVATE
9HAS_X11
diff --git a/contrib/syntax/lists/profile_macros.list b/contrib/syntax/lists/profile_macros.list
new file mode 100644
index 000000000..4ba780f11
--- /dev/null
+++ b/contrib/syntax/lists/profile_macros.list
@@ -0,0 +1,10 @@
1CFG
2DESKTOP
3DOCUMENTS
4DOWNLOADS
5HOME
6MUSIC
7PATH
8PICTURES
9RUNUSER
10VIDEOS
diff --git a/contrib/syntax/lists/syscall_groups.list b/contrib/syntax/lists/syscall_groups.list
new file mode 100644
index 000000000..fb42ae5f7
--- /dev/null
+++ b/contrib/syntax/lists/syscall_groups.list
@@ -0,0 +1,29 @@
1aio
2basic-io
3chown
4clock
5cpu-emulation
6debug
7default
8default-keep
9default-nodebuggers
10file-system
11io-event
12ipc
13keyring
14memlock
15module
16mount
17network-io
18obsolete
19privileged
20process
21raw-io
22reboot
23resources
24setuid
25signal
26swap
27sync
28system-service
29timer
diff --git a/contrib/syntax/lists/syscalls.list b/contrib/syntax/lists/syscalls.list
new file mode 100644
index 000000000..abb740b24
--- /dev/null
+++ b/contrib/syntax/lists/syscalls.list
@@ -0,0 +1,454 @@
1_llseek
2_newselect
3_sysctl
4accept
5accept4
6access
7acct
8add_key
9adjtimex
10afs_syscall
11alarm
12arch_prctl
13arm_fadvise64_64
14arm_sync_file_range
15bdflush
16bind
17bpf
18break
19brk
20capget
21capset
22chdir
23chmod
24chown
25chown32
26chroot
27clock_adjtime
28clock_adjtime64
29clock_getres
30clock_getres_time64
31clock_gettime
32clock_gettime64
33clock_nanosleep
34clock_nanosleep_time64
35clock_settime
36clock_settime64
37clone
38clone3
39close
40close_range
41connect
42copy_file_range
43creat
44create_module
45delete_module
46dup
47dup2
48dup3
49epoll_create
50epoll_create1
51epoll_ctl
52epoll_ctl_old
53epoll_pwait
54epoll_pwait2
55epoll_wait
56epoll_wait_old
57eventfd
58eventfd2
59execve
60execveat
61exit
62exit_group
63faccessat
64faccessat2
65fadvise64
66fadvise64_64
67fallocate
68fanotify_init
69fanotify_mark
70fchdir
71fchmod
72fchmodat
73fchown
74fchown32
75fchownat
76fcntl
77fcntl64
78fdatasync
79fgetxattr
80finit_module
81flistxattr
82flock
83fork
84fremovexattr
85fsconfig
86fsetxattr
87fsmount
88fsopen
89fspick
90fstat
91fstat64
92fstatat64
93fstatfs
94fstatfs64
95fsync
96ftime
97ftruncate
98ftruncate64
99futex
100futex_time64
101futex_waitv
102futimesat
103get_kernel_syms
104get_mempolicy
105get_robust_list
106get_thread_area
107getcpu
108getcwd
109getdents
110getdents64
111getegid
112getegid32
113geteuid
114geteuid32
115getgid
116getgid32
117getgroups
118getgroups32
119getitimer
120getpeername
121getpgid
122getpgrp
123getpid
124getpmsg
125getppid
126getpriority
127getrandom
128getresgid
129getresgid32
130getresuid
131getresuid32
132getrlimit
133getrusage
134getsid
135getsockname
136getsockopt
137gettid
138gettimeofday
139getuid
140getuid32
141getxattr
142gtty
143idle
144init_module
145inotify_add_watch
146inotify_init
147inotify_init1
148inotify_rm_watch
149io_cancel
150io_destroy
151io_getevents
152io_pgetevents
153io_pgetevents_time64
154io_setup
155io_submit
156io_uring_enter
157io_uring_register
158io_uring_setup
159ioctl
160ioperm
161iopl
162ioprio_get
163ioprio_set
164ipc
165kcmp
166kexec_file_load
167kexec_load
168keyctl
169kill
170landlock_add_rule
171landlock_create_ruleset
172landlock_restrict_self
173lchown
174lchown32
175lgetxattr
176link
177linkat
178listen
179listxattr
180llistxattr
181lock
182lookup_dcookie
183lremovexattr
184lseek
185lsetxattr
186lstat
187lstat64
188madvise
189mbind
190membarrier
191memfd_create
192migrate_pages
193mincore
194mkdir
195mkdirat
196mknod
197mknodat
198mlock
199mlock2
200mlockall
201mmap
202mmap2
203modify_ldt
204mount
205mount_setattr
206move_mount
207move_pages
208mprotect
209mpx
210mq_getsetattr
211mq_notify
212mq_open
213mq_timedreceive
214mq_timedreceive_time64
215mq_timedsend
216mq_timedsend_time64
217mq_unlink
218mremap
219msgctl
220msgget
221msgrcv
222msgsnd
223msync
224munlock
225munlockall
226munmap
227name_to_handle_at
228nanosleep
229newfstatat
230nfsservctl
231nice
232oldfstat
233oldlstat
234oldolduname
235oldstat
236olduname
237open
238open_by_handle_at
239open_tree
240openat
241openat2
242pause
243pciconfig_iobase
244pciconfig_read
245pciconfig_write
246perf_event_open
247personality
248pidfd_getfd
249pidfd_open
250pidfd_send_signal
251pipe
252pipe2
253pivot_root
254pkey_alloc
255pkey_free
256pkey_mprotect
257poll
258ppoll
259ppoll_time64
260prctl
261pread64
262preadv
263preadv2
264prlimit64
265process_madvise
266process_mrelease
267process_vm_readv
268process_vm_writev
269prof
270profil
271pselect6
272pselect6_time64
273ptrace
274putpmsg
275pwrite64
276pwritev
277pwritev2
278query_module
279quotactl
280quotactl_fd
281read
282readahead
283readdir
284readlink
285readlinkat
286readv
287reboot
288recv
289recvfrom
290recvmmsg
291recvmmsg_time64
292recvmsg
293remap_file_pages
294removexattr
295rename
296renameat
297renameat2
298request_key
299restart_syscall
300rmdir
301rseq
302rt_sigaction
303rt_sigpending
304rt_sigprocmask
305rt_sigqueueinfo
306rt_sigreturn
307rt_sigsuspend
308rt_sigtimedwait
309rt_sigtimedwait_time64
310rt_tgsigqueueinfo
311sched_get_priority_max
312sched_get_priority_min
313sched_getaffinity
314sched_getattr
315sched_getparam
316sched_getscheduler
317sched_rr_get_interval
318sched_rr_get_interval_time64
319sched_setaffinity
320sched_setattr
321sched_setparam
322sched_setscheduler
323sched_yield
324seccomp
325security
326select
327semctl
328semget
329semop
330semtimedop
331semtimedop_time64
332send
333sendfile
334sendfile64
335sendmmsg
336sendmsg
337sendto
338set_mempolicy
339set_robust_list
340set_thread_area
341set_tid_address
342setdomainname
343setfsgid
344setfsgid32
345setfsuid
346setfsuid32
347setgid
348setgid32
349setgroups
350setgroups32
351sethostname
352setitimer
353setns
354setpgid
355setpriority
356setregid
357setregid32
358setresgid
359setresgid32
360setresuid
361setresuid32
362setreuid
363setreuid32
364setrlimit
365setsid
366setsockopt
367settimeofday
368setuid
369setuid32
370setxattr
371sgetmask
372shmat
373shmctl
374shmdt
375shmget
376shutdown
377sigaction
378sigaltstack
379signal
380signalfd
381signalfd4
382sigpending
383sigprocmask
384sigreturn
385sigsuspend
386socket
387socketcall
388socketpair
389splice
390ssetmask
391stat
392stat64
393statfs
394statfs64
395statx
396stime
397stty
398swapoff
399swapon
400symlink
401symlinkat
402sync
403sync_file_range
404syncfs
405sysfs
406sysinfo
407syslog
408tee
409tgkill
410time
411timer_create
412timer_delete
413timer_getoverrun
414timer_gettime
415timer_gettime64
416timer_settime
417timer_settime64
418timerfd_create
419timerfd_gettime
420timerfd_gettime64
421timerfd_settime
422timerfd_settime64
423times
424tkill
425truncate
426truncate64
427tuxcall
428ugetrlimit
429ulimit
430umask
431umount
432umount2
433uname
434unlink
435unlinkat
436unshare
437uselib
438userfaultfd
439ustat
440utime
441utimensat
442utimensat_time64
443utimes
444vfork
445vhangup
446vm86
447vm86old
448vmsplice
449vserver
450wait4
451waitid
452waitpid
453write
454writev
diff --git a/contrib/syntax/lists/system_errnos.list b/contrib/syntax/lists/system_errnos.list
new file mode 100644
index 000000000..f0f816943
--- /dev/null
+++ b/contrib/syntax/lists/system_errnos.list
@@ -0,0 +1,135 @@
1E2BIG
2EACCES
3EADDRINUSE
4EADDRNOTAVAIL
5EADV
6EAFNOSUPPORT
7EAGAIN
8EALREADY
9EBADE
10EBADF
11EBADFD
12EBADMSG
13EBADR
14EBADRQC
15EBADSLT
16EBFONT
17EBUSY
18ECANCELED
19ECHILD
20ECHRNG
21ECOMM
22ECONNABORTED
23ECONNREFUSED
24ECONNRESET
25EDEADLK
26EDEADLOCK
27EDESTADDRREQ
28EDOM
29EDOTDOT
30EDQUOT
31EEXIST
32EFAULT
33EFBIG
34EHOSTDOWN
35EHOSTUNREACH
36EHWPOISON
37EIDRM
38EILSEQ
39EINPROGRESS
40EINTR
41EINVAL
42EIO
43EISCONN
44EISDIR
45EISNAM
46EKEYEXPIRED
47EKEYREJECTED
48EKEYREVOKED
49EL2HLT
50EL2NSYNC
51EL3HLT
52EL3RST
53ELIBACC
54ELIBBAD
55ELIBEXEC
56ELIBMAX
57ELIBSCN
58ELNRNG
59ELOOP
60EMEDIUMTYPE
61EMFILE
62EMLINK
63EMSGSIZE
64EMULTIHOP
65ENAMETOOLONG
66ENAVAIL
67ENETDOWN
68ENETRESET
69ENETUNREACH
70ENFILE
71ENOANO
72ENOATTR
73ENOBUFS
74ENOCSI
75ENODATA
76ENODEV
77ENOENT
78ENOEXEC
79ENOKEY
80ENOLCK
81ENOLINK
82ENOMEDIUM
83ENOMEM
84ENOMSG
85ENONET
86ENOPKG
87ENOPROTOOPT
88ENOSPC
89ENOSR
90ENOSTR
91ENOSYS
92ENOTBLK
93ENOTCONN
94ENOTDIR
95ENOTEMPTY
96ENOTNAM
97ENOTRECOVERABLE
98ENOTSOCK
99ENOTSUP
100ENOTTY
101ENOTUNIQ
102ENXIO
103EOPNOTSUPP
104EOVERFLOW
105EOWNERDEAD
106EPERM
107EPFNOSUPPORT
108EPIPE
109EPROTO
110EPROTONOSUPPORT
111EPROTOTYPE
112ERANGE
113EREMCHG
114EREMOTE
115EREMOTEIO
116ERESTART
117ERFKILL
118EROFS
119ESHUTDOWN
120ESOCKTNOSUPPORT
121ESPIPE
122ESRCH
123ESRMNT
124ESTALE
125ESTRPIPE
126ETIME
127ETIMEDOUT
128ETOOMANYREFS
129ETXTBSY
130EUCLEAN
131EUNATCH
132EUSERS
133EWOULDBLOCK
134EXDEV
135EXFULL