Skip to content

Commit

Permalink
Merge pull request #834 from dsugar100/main
Browse files Browse the repository at this point in the history
mozilla adds .mozilla directory to /etc/skel which useradd tries to copy
  • Loading branch information
pebenito authored Dec 4, 2024
2 parents de5329e + 16da307 commit facba43
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
3 changes: 3 additions & 0 deletions policy/modules/admin/usermanage.te
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,13 @@ seutil_run_setfiles(useradd_t, useradd_roles)

userdom_use_unpriv_users_fds(useradd_t)
# Add/remove user home directories
userdom_create_all_user_home_dirs(useradd_t)
userdom_create_all_user_home_files(useradd_t)
userdom_manage_user_home_dirs(useradd_t)
userdom_home_filetrans_user_home_dir(useradd_t)
userdom_manage_user_home_content_dirs(useradd_t)
userdom_manage_user_home_content_files(useradd_t)
userdom_write_all_user_home_files(useradd_t)
userdom_user_home_dir_filetrans_user_home_content(useradd_t, notdevfile_class_set)

optional_policy(`
Expand Down
62 changes: 62 additions & 0 deletions policy/modules/system/userdomain.if
Original file line number Diff line number Diff line change
Expand Up @@ -2109,6 +2109,68 @@ interface(`userdom_manage_user_home_content_dirs',`
files_search_home($1)
')

########################################
## <summary>
## Create all user home content directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_create_all_user_home_dirs',`
gen_require(`
attribute user_home_content_type;
type user_home_dir_t;
')

userdom_search_user_home_dirs($1)
create_dirs_pattern($1, { user_home_dir_t user_home_content_type }, user_home_content_type)
setattr_dirs_pattern($1, { user_home_dir_t user_home_content_type }, user_home_content_type)
')

########################################
## <summary>
## Create all user home content files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_create_all_user_home_files',`
gen_require(`
attribute user_home_content_type;
type user_home_dir_t;
')

userdom_search_user_home_dirs($1)
create_files_pattern($1, { user_home_dir_t user_home_content_type }, user_home_content_type)
setattr_files_pattern($1, { user_home_dir_t user_home_content_type }, user_home_content_type)
')

########################################
## <summary>
## Write all user home content files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_write_all_user_home_files',`
gen_require(`
attribute user_home_content_type;
type user_home_dir_t;
')

userdom_search_user_home_dirs($1)
write_files_pattern($1, { user_home_dir_t user_home_content_type }, user_home_content_type)
')

########################################
## <summary>
## Delete all user home content directories.
Expand Down

0 comments on commit facba43

Please sign in to comment.