Skip to content

Commit

Permalink
xserver: add xdm user with role access to system_r and xdm_r
Browse files Browse the repository at this point in the history
Sync with upstream's xserver changes.

Previously reverted in dada9b3. The
reasoning for the revert:
```
This commit added the sddm user to the xserver module.
This caused problems loading the xserver module if the user did not
exist on the system.
```
no longer applies, as upstream hit this issue here:
SELinuxProject/refpolicy#488 and resolved it.

Fixes: #7

Signed-off-by: Rahul Sandhu <[email protected]>
  • Loading branch information
WavyEbuilder committed Jan 6, 2025
1 parent 2e823cb commit bb71130
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions policy/modules/services/xserver.te
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ gen_tunable(xserver_object_manager, false)
## </desc>
gen_tunable(xserver_allow_dri, false)

# for sddm to use pam for greeter
role xdm_r;
allow system_r xdm_r;

attribute x_domain;

# X Events
Expand Down Expand Up @@ -169,6 +173,7 @@ fs_associate_tmpfs(xconsole_device_t)
files_associate_tmp(xconsole_device_t)

type xdm_t;
role xdm_r types xdm_t;
type xdm_exec_t;
auth_login_pgm_domain(xdm_t)
init_domain(xdm_t, xdm_exec_t)
Expand Down Expand Up @@ -891,6 +896,9 @@ manage_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
manage_lnk_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
manage_sock_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)

# for sddm to use pam for greeter, sddm greeter needs execmod
allow xdm_t xdm_tmpfs_t:file execmod;

# Run Xorg.wrap
can_exec(xserver_t, xserver_exec_t)

Expand Down Expand Up @@ -1091,3 +1099,6 @@ ifdef(`distro_gentoo',`
cgmanager_stream_connect(xdm_t)
')
')

# for sddm to use pam for greeter
gen_user(xdm,, xdm_r system_r, s0, s0)

0 comments on commit bb71130

Please sign in to comment.