From 0c187b6ff97f91c41dab65a6426dc61f77305cdf Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Sun, 20 Aug 2023 15:44:41 +0200 Subject: Import dssp5 Signed-off-by: Dominick Grift --- src/dev/termdev/ptytermdev/loginptytermdev.cil | 55 ++++++++++++++++++++++ .../loginptytermdev/sysloginptytermdev.cil | 29 ++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 src/dev/termdev/ptytermdev/loginptytermdev.cil create mode 100644 src/dev/termdev/ptytermdev/loginptytermdev/sysloginptytermdev.cil (limited to 'src/dev/termdev/ptytermdev') diff --git a/src/dev/termdev/ptytermdev/loginptytermdev.cil b/src/dev/termdev/ptytermdev/loginptytermdev.cil new file mode 100644 index 0000000..b9019d4 --- /dev/null +++ b/src/dev/termdev/ptytermdev/loginptytermdev.cil @@ -0,0 +1,55 @@ +;; SPDX-FileCopyrightText: © 2023 Dominick Grift +;; SPDX-License-Identifier: Unlicense + +(block loginptytermdev + + (macro all_type_change ((type ARG1)(type ARG2)) + (typechange ARG1 typeattr chr_file ARG2)) + + (macro appendinherited_all_chr_files ((type ARG1)) + (allow ARG1 typeattr appendinherited_chr_file) + (allowx ARG1 typeattr FIOCLEX_FIONCLEX_CHRFILE) + (allowx ARG1 typeattr IOCTLCONSOLE) + (allowx ARG1 typeattr IOCTLTTY_NOT_TIOCSTI) + (allowx ARG1 typeattr IOCTLVT)) + + (macro readwriteinherited_all_chr_files ((type ARG1)) + (allow ARG1 typeattr readwriteinherited_chr_file) + (allowx ARG1 typeattr FIOCLEX_FIONCLEX_CHRFILE) + (allowx ARG1 typeattr IOCTLCONSOLE) + (allowx ARG1 typeattr IOCTLTTY_NOT_TIOCSTI) + (allowx ARG1 typeattr IOCTLVT)) + + (macro type ((type ARG1)) + (typeattributeset typeattr ARG1)) + + (macro writeinherited_all_chr_files ((type ARG1)) + (allow ARG1 typeattr writeinherited_chr_file) + (allowx ARG1 typeattr FIOCLEX_FIONCLEX_CHRFILE) + (allowx ARG1 typeattr IOCTLCONSOLE) + (allowx ARG1 typeattr IOCTLTTY_NOT_TIOCSTI) + (allowx ARG1 typeattr IOCTLVT)) + + (typeattribute typeattr) + + (blockinherit .file.all_macro_template_chr_files) + + (call .ptytermdev.type (typeattr)) + + (block base_template + + (blockabstract base_template) + + (blockinherit .ptytermdev.base_template) + + (call .loginptytermdev.type (ptytermdev))) + + (block template + + (blockabstract template) + + (macro ptytermdev_type_change ((type ARG1)(type ARG2)) + (typechange ARG1 ptytermdev chr_file ARG2)) + + (blockinherit .loginptytermdev.base_template) + (blockinherit .ptytermdev.macro_template_chr_files))) diff --git a/src/dev/termdev/ptytermdev/loginptytermdev/sysloginptytermdev.cil b/src/dev/termdev/ptytermdev/loginptytermdev/sysloginptytermdev.cil new file mode 100644 index 0000000..598a925 --- /dev/null +++ b/src/dev/termdev/ptytermdev/loginptytermdev/sysloginptytermdev.cil @@ -0,0 +1,29 @@ +;; SPDX-FileCopyrightText: © 2023 Dominick Grift +;; SPDX-License-Identifier: Unlicense + +(in dev.unconfined + + (call .sys.loginptytermdev_all_type_change_ptytermdev (typeattr))) + +(in ptytermdev.unconfined + + (call .sys.loginptytermdev_all_type_change_ptytermdev (typeattr))) + +(in sys + + (macro devpts_fs_type_transition_ptytermdev ((type ARG1)) + (call .devpts.fs_type_transition + (ARG1 ptytermdev chr_file "*"))) + + (macro loginptytermdev_all_type_change_ptytermdev ((type ARG1)) + (call .loginptytermdev.all_type_change + (ARG1 ptytermdev))) + + ;; support for unknown login services + (blockinherit .loginptytermdev.template) + + (call devpts_fs_type_transition_ptytermdev (subj))) + +(in termdev.unconfined + + (call .sys.loginptytermdev_all_type_change_ptytermdev (typeattr))) -- cgit v1.2.3