Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions policy/modules/admin/usermanage.te
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ auth_use_nsswitch(groupadd_t)
# domtrans_chk_passwd() call.
auth_manage_shadow(groupadd_t)
auth_relabel_shadow(groupadd_t)
auth_etc_filetrans_shadow(groupadd_t)
auth_filetrans_shadow(groupadd_t)

seutil_read_config(groupadd_t)
seutil_read_file_contexts(groupadd_t)
Expand Down Expand Up @@ -346,7 +346,7 @@ auth_run_chk_passwd(passwd_t, passwd_roles)
auth_run_upd_passwd(passwd_t, passwd_roles)
auth_manage_shadow(passwd_t)
auth_relabel_shadow(passwd_t)
auth_etc_filetrans_shadow(passwd_t)
auth_filetrans_shadow(passwd_t)
auth_use_nsswitch(passwd_t)

# allow checking if a shell is executable
Expand Down Expand Up @@ -435,7 +435,7 @@ term_use_all_ptys(sysadm_passwd_t)

auth_manage_shadow(sysadm_passwd_t)
auth_relabel_shadow(sysadm_passwd_t)
auth_etc_filetrans_shadow(sysadm_passwd_t)
auth_filetrans_shadow(sysadm_passwd_t)
auth_use_nsswitch(sysadm_passwd_t)

# allow vipw to exec the editor
Expand Down Expand Up @@ -531,7 +531,7 @@ auth_use_nsswitch(useradd_t)
# domtrans_chk_passwd() call.
auth_manage_shadow(useradd_t)
auth_relabel_shadow(useradd_t)
auth_etc_filetrans_shadow(useradd_t)
auth_filetrans_shadow(useradd_t)

init_use_fds(useradd_t)
init_rw_utmp(useradd_t)
Expand Down
2 changes: 1 addition & 1 deletion policy/modules/services/nis.te
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ selinux_get_fs_mount(yppasswdd_t)

auth_manage_shadow(yppasswdd_t)
auth_relabel_shadow(yppasswdd_t)
auth_etc_filetrans_shadow(yppasswdd_t)
auth_filetrans_shadow(yppasswdd_t)

logging_send_syslog_msg(yppasswdd_t)

Expand Down
28 changes: 27 additions & 1 deletion policy/modules/system/authlogin.if
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,23 @@ interface(`auth_relabel_shadow',`
typeattribute $1 can_relabelto_shadow_passwords;
')

########################################
## <summary>
## File transitions for shadow files.
## </summary>
## <param name="domain">
## <summary>
## Domain with file transition.
## </summary>
## </param>
#
interface(`auth_filetrans_shadow',`
auth_etc_filetrans_shadow($1, "shadow")
auth_etc_filetrans_shadow($1, "gshadow")
auth_etc_filetrans_shadow($1, "shadow-")
auth_etc_filetrans_shadow($1, "gshadow-")
')

########################################
## <summary>
## Read/Write shadow lock files.
Expand All @@ -860,9 +877,18 @@ interface(`auth_relabel_shadow',`
interface(`auth_rw_shadow_lock',`
gen_require(`
type shadow_lock_t;
type shadow_t;
')

rw_files_pattern($1, shadow_lock_t, shadow_lock_t)
allow $1 shadow_lock_t:file rw_file_perms;
ifelse(`$2',`',`
files_etc_filetrans($1, shadow_lock_t, file, ".pwd.lock")
files_etc_filetrans($1, shadow_lock_t, file, "passwd.lock")
files_etc_filetrans($1, shadow_lock_t, file, "group.lock")
',`
refpolicywarn(`$0($*) second parameter is deprecated.')
files_etc_filetrans($1, shadow_t, file, $2)
')
Comment on lines +884 to +891
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right idea, but I meant to put it in auth_etc_filetrans_shadow(), making the changes in the other files unnecessary.

')

########################################
Expand Down
1 change: 1 addition & 0 deletions policy/modules/system/authlogin.te
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ term_dontaudit_use_console(updpwd_t)
term_dontaudit_use_unallocated_ttys(updpwd_t)

auth_manage_shadow(updpwd_t)
auth_filetrans_shadow(updpwd_t)
auth_use_nsswitch(updpwd_t)

logging_send_syslog_msg(updpwd_t)
Expand Down
2 changes: 1 addition & 1 deletion policy/modules/system/systemd.te
Original file line number Diff line number Diff line change
Expand Up @@ -2077,7 +2077,7 @@ kernel_read_kernel_sysctls(systemd_sysusers_t)
selinux_use_status_page(systemd_sysusers_t)

auth_manage_shadow(systemd_sysusers_t)
auth_etc_filetrans_shadow(systemd_sysusers_t)
auth_filetrans_shadow(systemd_sysusers_t)
auth_use_nsswitch(systemd_sysusers_t)

seutil_libselinux_linked(systemd_sysusers_t)
Expand Down
Loading